+ 2

What is the error in it??

class Item: def __init__(self,name): self.name=name def func(self): return name a = Item("shahir") print(a.func())

2nd Jan 2022, 2:41 PM
Ravi King
1 Réponse
+ 6
Function func() should return self.name, variable named <name> was nowhere defined in the function
2nd Jan 2022, 2:53 PM
Ipang