What is the error in it?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answer
+ 6
Function func() should return self.name, variable named <name> was nowhere defined in the function
2nd Jan 2022, 2:53 PM
Ipang