Class it up check angles


#1



https://www.codecademy.com/courses/python-intermediate-en-WL8e4/3/2?curriculum_id=4f89dab3d788890003000096#


When I submit my code, I encounter the following error:
Oops, try again. It looks like your check_angles method doesn't return True for valid triangle angle values.


class Triangle(object):
    number_of_sides=3
    def __init__(self,angle1,angle2,angle3):
        self.angle1=60
        self.angle2=60
        self.angle3=60
    def check_angles(self):
        return self.angle1+self.angle2+self.angle3==180


#2

This is a Triangle class, meaning the angles are not fixed, but set from the supplied parameters.

self.angle1 = angle1
self.angle2 = angle2
self.angle3 = angle3

#3

Thanks! It helped, I was able to complete the lesson!


#4

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