0

How to solve attribute error? What is wrong in this code.

On running code the python idle showing me Attribute Error. I have checked everything but i found nothing wrong in my code. Program👇🏻👇🏻👇🏻 class pri: def__init__(self,num1,num2): self.num1=num1 self.num2=num2 def add(self): print('Addn Result:', self.num1+self.num2) p1=pri(96,85) p2=pri(93,78) p1.add()

23rd Jun 2019, 2:51 PM
Pritish Sarkar
Pritish Sarkar - avatar
1 Odpowiedź
+ 2
Your code seems to run without any problems in the code playground. The only issue is that there's a space missing between def and __init__
23rd Jun 2019, 3:06 PM
Anna
Anna - avatar