Commit 75d600a7 by BellCodeEditor

save project

parent 3e5d30ae
Showing with 6 additions and 4 deletions
...@@ -5,6 +5,9 @@ class Hero: ...@@ -5,6 +5,9 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yese=Hero("亞瑟",300,20) yese=Hero("亞瑟",300,20)
houyi=Hero("后羿",240,23) def upgrade():
print(houyi.hp) yese.level=yese.level+1
print(yese.hp) yese.hp=yese.hp+50
\ No newline at end of file yese.attack=yese.attack+4
upgrade()
upgrade()
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