Created
December 1, 2022 20:36
-
-
Save secemp9/af4a5e433f957907ea0298a087bb3987 to your computer and use it in GitHub Desktop.
Example of a class (3.8)
This file contains 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 ClassTester: | |
def __init__(self): | |
self.to_modify = "hello" | |
def msg(self): | |
print(self.to_modify) | |
# do something with the to_modify function beside printing, since it's just an example | |
Tester = ClassTester() | |
Tester.msg() | |
Tester.to_modify = 20 | |
Tester.msg() | |
Tester.to_modify = 30 | |
Tester.msg() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment