What is the output of the following code ?
class Foo: def printme(self, data): print(data) p = Foo() p.printme('hello') Foo.printme(p, 'hello')
Syntax Error
hello AttributeError
hello NameError
hello hello
instance.method(args...)is same as class.method(instance, args...) p.printme('hello') is same as Foo.printme(p, 'hello') So the output will be
instance.method(args...)
class.method(instance, args...)
p.printme('hello')
Foo.printme(p, 'hello')
Comment here: