MCQOPTIONS
Saved Bookmarks
| 1. |
What is the output of the following code? class test: def __init__(self,a): self.a=a def display(self): print(self.a) obj=test() obj.display() |
| A. | Runs normally, doesn’t display anything |
| B. | Displays 0, which is the automatic default value |
| C. | Error as one argument is required while creating the object |
| D. | Error as display function requires additional argument |
| Answer» D. Error as display function requires additional argument | |