Skip to content

Instantly share code, notes, and snippets.

@JagDecoded
Created June 20, 2017 20:02
Show Gist options
  • Save JagDecoded/68e15b59401ca1b72a763b510ae7a9a1 to your computer and use it in GitHub Desktop.
Save JagDecoded/68e15b59401ca1b72a763b510ae7a9a1 to your computer and use it in GitHub Desktop.
import rockpaper
class Hero:
def __init__(self,name):
self.name=name
self.health=100
def eat(self,food):
if (food=='apple'):
self.health-=100
elif (food=='ham'):
self.health+=20
bob=Hero('bob')
print (bob.health)
bob.eat('apple')
print(bob.health)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment