Skip to content

Instantly share code, notes, and snippets.

@conradludgate
Created March 13, 2019 21:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save conradludgate/1ad7d11a67e7f2f20894e6144fb0babf to your computer and use it in GitHub Desktop.
fluffy = Labrador("fluffy")
scruffy = GoldenRetriever("scruffy")
cat = Cat(fluffy)
cat.say() # Meow, I am a cat and my enemy says: 'Bark, I am a Labrador'
cat.move() # I am running away from fluffy
scruffy.say() # Bark, I am a Golden Retriever
scruffy.move() # I am chasing cats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment