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.
Error:
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.
1 2 3 4 5 6 7 8 9 10 11 12 |
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 function |
TypeError: Circum() takes 0 positional arguments but 1 was given