class GeometricObject:
def __init__(self,color = 'green',filled='true'):
self.__color=color
self.__filled=filled
def getColor(self):
return self.__color
def setColor(self,color):
self.__color=color
def isFilled(self):
return self.__filled
def setFilled(self,filled):
self.__filled=filled
def __str__(self):
return "Color: " + self.__color + " Filled: " + str(self.__filled)
And this is the Triangle class:
from GeometricObject import GeometricObject
class Triangle(GeometricObject):
def __int__(self,side1=1.0,side2=1.0,side3=1.0):
super().__init__()
self.__side1=side1
self.__side2=side2
self.__side3=side3
def getPerimeter(self):
return self.__side1 + self.__side2 + self.__side3
def __str__(self):
return super().__str__()+" side 1: "+str(self.__side1)+" side 2: "+str(self.__side2)+" side 3: "+str(self.__side3)
from triangle import Triangle
from GeometricObject import GeometricObject
def main():
side1=int(input("Enter first side: "))
side2=int(input("Enter second side: "))
side3=int(input("Enter third side: "))
t1=Triangle(side1,side2,side3)
print(t1.getColor())
print(t1.getPerimeter())
print(t1.__str__())
main()
The error is occuring when I create the triangle object t1 in the main function: init() takes from 1 to 3 positional arguments but 4 were given...
I know there is other posts on similar errors like this but a lot of them were if you provided not enough arguments and the one's that did provide too many arguments did not answer my question.