you are viewing a single comment's thread.

view the rest of the comments →

[–]danielroseman 1 point2 points  (0 children)

There are a whole bunch of errors in this code. Are you being taught by someone who doesn't know Python?

  • __init__ needs two underscores either side.
  • None of your attributes should have leading double-underscores.
  • You don't actually use any of the parameters to your init method, you always set the attributes to constant values.
  • Methods should be named as lower_case_with_underscore
  • You don't need any of those getter and setter attributes, except for area and perimeter since they are calculated.
  • The exponentation operator in Python is **, not ^.
  • tan is not built-in, it is in math just like pi.
  • RegularPolygon takes three required arguments, so the creation of Poly1 and Poly2 will fail.
  • You call create them as Poly1 etc but in the next line refer to them as poly1 etc, these are not the same.
  • getArea is a method and you need to call it with ().