+ 1
Creating a python method and it gives error
Creating a python method inside a class and it gives error. Here is the code: class Cat: def __init__(self, color, legs): self.color = color self.legs = legs def showcolor(self): print(self.color) felix = Cat("ginger", 4) print(felix.color) showcolor(felix)
1 Odpowiedź
+ 6
try
felix.showcolor()