Commit 5f213cdd by BellCodeEditor

save project

parent 61a55033
Showing with 10 additions and 8 deletions
...@@ -4,10 +4,12 @@ class Hero: ...@@ -4,10 +4,12 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def updeta(): def updeta():
yase.level = yase.level + 1 self.level = yase.level + 1
yase.hp = yase.hp + 100 self.hp = yase.hp + 100
yase.attack = yase.attack + 5 self.attack = yase.attack + 5
yase = Hero("yase",200,25) yase = Hero("亚瑟",200,25)
updeta() yase.updeta(yase)
print(yase.attack) print("等级为",yase.level)
\ No newline at end of file print("血量",yase.hp)
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