Commit 3adcaad2 by BellCodeEditor

save project

parent e7454e44
Showing with 8 additions and 9 deletions
......@@ -4,12 +4,12 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def a():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
def b(a):
a.level=a.level+1
a.hp=a.hp+50
a.attack=a.attack+4
yase=Hero('亚瑟',300,20)
print("亚瑟的初始血量为:",yase.hp)
a()
a()
print("升级后的血量:",yase.hp)
\ No newline at end of file
yase.b()
print("等级:",yase.level)
print("血量:",yase.hp)
print("攻击力:",yase.attack)
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