+ 1

In the second code why the error is occurs?

code is in the below link https://code.sololearn.com/c9F9It3wRlc7/?ref=app

20th Jun 2020, 5:04 PM
Hari Krishna Sahu
Hari Krishna Sahu - avatar
2 ответов
+ 1
But MyClass it self is become an object while defining the MyClass then why should you used"MyClass()" ?
20th Jun 2020, 5:23 PM
Hari Krishna Sahu
Hari Krishna Sahu - avatar
+ 1
This solution works: class MyClass: a = 10 @classmethod def func(self): return 'hello'
20th Jun 2020, 5:26 PM
JaScript
JaScript - avatar