Created
March 25, 2015 03:56
-
-
Save letuananh/3845288a361064d4a437 to your computer and use it in GitHub Desktop.
Revisions
-
letuananh created this gist
Mar 25, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ import sys class Player: def __init__(self, name, age): self.lives = 10 self.name = name self.age = age def eat(self, food): if food == "apple": self.health -= 10 elif food == "banana": self.health += 10 def introduce(self): print("I'm %s and I'm %s year(s) old." % (self.name, self.age)) #----------------------------------------- name = raw_input("What is your name? ") age = raw_input("How old are you? ") player1 = Player(name, age) player1.introduce()