Class it up


I don't understand why it keeps saying the error below:-

Oops, try again. It looks like your Triangle class doesn't have a number_of_sides member variable.

class Triange(object):
  number_of_sides = 3
  def __init__(self, angle1, angle2, angle3):
    self.angle1 = angle1
    self.angle2 = angle2
    self.angle3 = angle3
  def check_angles(self):
    if self.angle1+self.angle2+self.angle3 == 180:
      return True
      return False


Your code raises the following error:

Oops, try again.
Your code threw the following error when it tried to check Triangle: global name 'Triangle' is not defined

See the error?

You appear to be using the typical 2 space indentation common in Ruby. That won't fly in Python. It must be 4 spaces..


The check_angles function may be simplified to:

def check_angles(self):
    return self.angle1 + self.angle2 + self.angle3 == 180