+ 3

in lesson magic method on python, examples in my idle gives error please help, it confused me? i cant write codes from there

magic method

9th Apr 2017, 6:32 AM
Nasibillo Muhamedov
Nasibillo Muhamedov - avatar
3 RĂ©ponses
+ 3
Try like this: class Test: def __init__(self, var1, var2): self.var1=var1 self.var2=var2 obj=Test(1, 2)
9th Apr 2017, 7:01 AM
Ali Emir Kızıl
Ali Emir Kızıl - avatar
+ 2
__init__ method is used to make variables for each object in this class.
9th Apr 2017, 6:49 AM
Ali Emir Kızıl
Ali Emir Kızıl - avatar
+ 2
ok but each code gives error from these lesson in my idle, scripter i cant find the mistakes
9th Apr 2017, 6:54 AM
Nasibillo Muhamedov
Nasibillo Muhamedov - avatar