Created
July 4, 2020 08:32
-
-
Save prashanth-sams/0895adebf990b19413d8890251a00afd to your computer and use it in GitHub Desktop.
Python snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestClass: | |
i = 0 | |
@classmethod | |
def values(cls): | |
for k in range(5): | |
print(cls.incrementor()) | |
@classmethod | |
def incrementor(cls): | |
cls.i += 1 | |
return cls.i | |
TestClass.values() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment