Commit d51a9afc by BellCodeEditor

save project

parent aca266a7
Showing with 9 additions and 2 deletions
...@@ -7,4 +7,11 @@ class Hero: ...@@ -7,4 +7,11 @@ class Hero:
yase=Hero('yase',300,20) yase=Hero('yase',300,20)
houyi=Hero('houyi',240,50) houyi=Hero('houyi',240,50)
print('yase的血量是:',yase.hp) print('yase的血量是:',yase.hp)
print('houyi的血量是:',houyi.hp) print('houyi的血量是:',houyi.hp)
\ No newline at end of file def upgrad():
yase.level=yase.level+1
yase.hp=yase.hp+20
yase.attack=yase.attack+4
upgrad()
upgrad()
print('yase的血量是:',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