15.Class Basics



why this works

and this doesn't


Hi @rafeen ,

Check the spellings of all the variables.

For example, angle2 differs from angel2.


thanx..it worked....

bt i cant understand why both codes work


__init__() is a magic method, an important word her: method

a method is a function which is part of a class.

just like a normal function, we can make pass the function content:

def example():

or declare variables:

def example():
   angle1 = 60


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