Commit 14ee2047 by BellCodeEditor

save project

parent 3da0410a
Showing with 12 additions and 6 deletions
......@@ -4,8 +4,14 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
yase=Hero('yase',300,20)
hy=Hero('hy',250,23)
dy=Hero('dy',280,28)
print(yase.attack)
print(hy.attack)
\ No newline at end of file
def upgrde():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
yase. = Hero("垭瑟",300,20)
print("垭瑟的初始血量为:",yase.hp)
upgrde()
upgrde()
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