Feb-10-2019, 08:25 PM
Hi experts. I am new to Python but understand programming and have a fair idea about it. I need your help for following.
I am trying to execute the following code but getting an error. Both error and code provided below.
TypeError: Circum() takes 0 positional arguments but 1 was given
I am trying to execute the following code but getting an error. Both error and code provided below.
class Circle(): pie=3.14 def __init__(self,radius=1): self.radius=radius self.area=pie*radius*radius def Circum(self): return(2*self.pie*self.radius) mycircle=Circle() mycircle.Circum() # I get error here when calling this functionError:
TypeError: Circum() takes 0 positional arguments but 1 was given