Commit d09ad4cf by BellCodeEditor

save project

parent 1f5805db
Showing with 9 additions and 0 deletions
...@@ -11,7 +11,15 @@ class Hero: ...@@ -11,7 +11,15 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def frfgrde():
wukong.level=wukong.level+1
wukong.hp=wukong.hp+50
wukong = Hero("悟空",200,40) wukong = Hero("悟空",200,40)
yase = Hero("亚瑟",300,20) yase = Hero("亚瑟",300,20)
print(wukong.hp) print(wukong.hp)
frfgrde()
frfgrde()
print("升级两次后",wukong.hp)
print(yase.attack) print(yase.attack)
\ 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