Commit 739a5d01 by BellCodeEditor

save project

parent ac5f1e40
Showing with 8 additions and 3 deletions
...@@ -5,6 +5,10 @@ class Hero: ...@@ -5,6 +5,10 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero('yase',300,20) yase=Hero('yase',300,20)
houyi=Hero('houyi',300,3000) def upgrade():
print("yaseyxxlw",yase.hp) yase.level=yase.level+1
print("houyiyxxlw",houyi.attack) yase.hp=yase.hp+50
yase.attack=yase.attack+5
upgrade()
upgrade()
print(yase.attack)
\ 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