Skip to content

Instantly share code, notes, and snippets.

@mkwatson
Created January 11, 2016 18:59
Show Gist options
  • Select an option

  • Save mkwatson/a0cdc22c751685545d27 to your computer and use it in GitHub Desktop.

Select an option

Save mkwatson/a0cdc22c751685545d27 to your computer and use it in GitHub Desktop.
class Dog(object):
def __init__(self):
self.age = 1
self.weight = 15
def feed(self, amount):
self.weight += amount
def bark(self):
print "Bark! I weigh " + str(self.weight) + " pounds!"
Shaggy = Dog()
Shaggy.feed(10)
Shaggy.bark()
# Bark! I weigh 25 pounds!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment