Skip to content

Instantly share code, notes, and snippets.

@pknowledge pknowledge/car.py
Created Sep 12, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.