[Solved] What is wrong with my class code [Python]?
You need to pass argument to your constructor. s1 = Square(1) # will call Square.__init__(self, 1) s2 = Square(2) # will call Square.__init__(self, 2) It’s not a big problem. Update I rewrite your class: import math class Square(): def __init__(self, length): #return an instance of this class with ‘length’ as the default length. self.length = … Read more