Skip to content

Instantly share code, notes, and snippets.

@pknowledge
Created September 12, 2018 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pknowledge/de01384daa9f62d0219803987bdd159d to your computer and use it in GitHub Desktop.
Save pknowledge/de01384daa9f62d0219803987bdd159d to your computer and use it in GitHub Desktop.
python Class example
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