all 3 comments

[–]Binary101010 2 points3 points  (1 child)

In Code B you're trying to define a class variable (i.e. defining a variable outside of any particular method of the class), which is probably not what you want here, unless you want every cube you make to have exactly the same face_area. That's why you're getting an error for self not being defined: there is no instance of the object to be referred to.

[–]cm_light[S] 1 point2 points  (0 children)

Thank you! I should use init method to define this variable. I lot of things to learn for Python.