12/18: Inheritance Syntax


So I have no idea why this isn't working..

class Shape(object):
"""Makes shapes!"""
def init(self, number_of_sides):
self.number_of_sides = number_of_sides

class Triangle(Shape):
def init(self, side1, side2, side3):
self.side1 = side1
self.side1 = side2
self.side3 = side3

What is this topic looking for? I'm getting the error "Oops, try again. Did you define Triangle's init() method to take the four arguments listed?"


Python init is the __init__ method
Have a read in a discussion/opinion


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.