What Will Be The Output Of The Following Code?
def __init__(self, s):
self.s = s
a = Test("Python Class")
The program gives an error because there is no constructor for class Test.
Signature for the print method is incorrect, so an error is thrown.
The correct output is.
The above code will execute correctly on changing print(s) to print(self.s).
© 2017 QuizBucket.org