Created
January 11, 2016 18:59
-
-
Save mkwatson/a0cdc22c751685545d27 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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