0
classes
class Student: def __init__(self, name): self.name = name def greet(): print(self.name+" says hi") obj = Student("John") obj.greet(self) class Student: def __init__(self, name): self.name = name def greet(): print(self.name+" says hi") obj = Student("John") obj.greet(self) can anybody help me out there...?
2 Respostas
+ 2
give self parameter in the greet method :
i.e. ---> def greet(self)