I was trying to write some code that would take in the number of sides of a polygon and a user can just randomly input the length of each side
I wanted to make a separate class polygon and the following was my code:
#numSides=int(input(Number of sides))
def __init__(self,x): #useless code
self.x=x #useless code
self.x= #useless code
#for i in range(x):
numSides=int(input("number of sides"))
for i in range(numSides):
for i in list_:
but then in the second to last line i was getting an error that said :
Traceback (most recent call last):
File "python", line 23, in <module>
TypeError: __init__() missing 1 required positional argument: 'x'
I was wondering how can i fix this and why I am getting this error?