1.

What is the output of the following code? class test: def __init__(self,a="Hello World"): self.a=a def display(self): print(self.a) obj=test() obj.display()

A. The program has an error because constructor can’t have default arguments
B. Nothing is displayed
C. Hello World” is displayed
D. The program has an error display function doesn’t have parameters
Answer» D. The program has an error display function doesn’t have parameters


Discussion

No Comment Found