Commit bd38907b by BellCodeEditor

save project

parent 8e29945b
Showing with 9 additions and 2 deletions
...@@ -5,4 +5,12 @@ class Hero(): ...@@ -5,4 +5,12 @@ class Hero():
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero("垭瑟",100,300) yase=Hero("垭瑟",100,300)
print("垭瑟的血量为:",yase.hp)
\ No newline at end of file def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
upgrade()
upgrade()
print(yase.hp)
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