Commit de990932 by BellCodeEditor

save project

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