Commit 7a14213b by BellCodeEditor

save project

parent 24e3777b
Showing with 7 additions and 1 deletions
...@@ -5,4 +5,9 @@ class Hero: ...@@ -5,4 +5,9 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
houyi=Hero("后羿",3182,398) houyi=Hero("后羿",3182,398)
print(houyi.hp) def shengji():
houyi.level=houyi.level+1
houyi.hp=houyi.hp+30
houyi.attack=houyi.attack+17
shengji()
print(houyi.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