What will be the output of the following Python code? class test: def __init__(self,a="Hello World"): self.a=a def display(self): print(self.a) obj=test() obj.display()
1. The program has an error because constructor can’t have default arguments
2.Nothing is displayed
3. “Hello World†is displayed
4.The program has an error display function doesn’t have parameters
Posted Date:-2022-01-02 11:42:58