0

Class definition that I don’t understand

In a challenge I encounter the following class definition : class MyClass(): n=0 def __init__(self): MyClass.n +=1 What means MyClass.n ? I have never seen this in the lectures. In general It is something like self.property=something. Could someone explain to me. Thanks. Brindille

2nd Mar 2018, 9:10 PM
Brindille
Brindille - avatar
1 Resposta
+ 1
Thanks @maxcookmax. However it seems to me still mysterious. I will have a look on the net?
2nd Mar 2018, 9:23 PM
Brindille
Brindille - avatar