Commit 6703bdfc by BellCodeEditor

save project

parent d46de046
Showing with 8 additions and 1 deletions
......@@ -4,4 +4,11 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
pengpenglaoshi=Hero()
pengpenglaoshi=Hero("彭彭老师",300,20)
#print(pengpenglaoshi.hp)
def upgride():
pengpenglaoshi.level=pengpenglaoshi.level+1
pengpenglaoshi.hp=pengpenglaoshi.hp+50
pengpenglaoshi.attack=pengpenglaoshi.attack+4
upgride()
print(pengpenglaoshi.hp)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment