Commit 7821aa75 by BellCodeEditor

save project

parent 4db02318
Showing with 8 additions and 4 deletions
...@@ -4,8 +4,11 @@ class Hero: ...@@ -4,8 +4,11 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def dengji(): yase=Hero('yase',300,20)
def upgarde():
yase.level=yase.level+1 yase.level=yase.level+1
yase.hp=yase.hp+1 yase.hp=yase.hp+50
yase.attack=yase.attack+1 yase.attack=yase.attack+4
dengji() upgarde()
upgarde()
print("升两级后,亚瑟生命值为:",yase.hp)
\ No newline at end of file
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