Created
December 16, 2021 22:08
-
-
Save StephanieSunshine/682dfff4fbe079fea2c007a79b5c8c4f to your computer and use it in GitHub Desktop.
Python classes example
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
#!/usr/bin/env python3 | |
class Gesture: | |
# initalizer with default values for variables not defined on init | |
def __init__(self, art = "", name = "noname"): | |
self.art = art | |
self.name = name | |
choices = [ | |
Gesture("@", "Ro"), | |
Gesture("-", "Sham"), | |
Gesture("X", "Bo") | |
] | |
print("Options:") | |
for c in choices: | |
print(f"{c.name} == {c.art}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment