Created
September 12, 2018 20:57
-
-
Save pknowledge/de01384daa9f62d0219803987bdd159d to your computer and use it in GitHub Desktop.
python Class example
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 Car: | |
pass | |
ford = Car() | |
honda = Car() | |
audi = Car() | |
ford.speed = 200 | |
honda.speed = 220 | |
audi.speed = 250 | |
ford.color = 'red' | |
honda.color = 'blue' | |
audi.color = 'black' | |
print(ford.speed) | |
print(ford.color) | |
ford.speed = 300 | |
ford.color = 'blue' | |
print(ford.speed) | |
print(ford.color) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment