Set init() method to take four arguments


#1



Can someone look at this basic code and see why am i getting "Did you set your init() method to take four arguments: self, angle1, angle2, and angle3?" error log?


class Triangle(object):
    def _init_(self, angle1, angle2, angle3):
        self.angle1 = angle1
        self.angle2 = angle2
        self.angle3 = angle3


#2

@venkat87
Try it with __init__

http://stackoverflow.com/questions/625083/python-init-and-self-what-do-they-do


#3

@venkat87 The problem with your code is the fact you have one underscore on each side of the "init" function(underscore is this: _ in case to don't know). You should have two underscores on each side instead. Hope that help! :slight_smile:

-- @chipjumper36731


#4

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