Class definition that I donā€™t understand | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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