Commit 14ee2047 by BellCodeEditor

save project

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