Commit c7931be4 by BellCodeEditor

save project

parent bc9b4e76
Showing with 6 additions and 6 deletions
...@@ -6,12 +6,12 @@ class Hero: ...@@ -6,12 +6,12 @@ class Hero:
self.attack=attack self.attack=attack
def upgrade(): def upgrade():
cxk.level=cxk.level=1 cxk.level=cxk.level+1
cxk.hp=yase.hp=50 cxk.hp=cxk.hp+50
cxk.attack=yase.attack=4 cxk.attack=cxk.attack+4
cxk=Hero('蔡徐坤',300,20) cxk=Hero('蔡徐坤',300,20)
print("蔡徐坤的初始血量值为:",yase.hp) print("蔡徐坤的初始血量值为:",cxk.hp)
upgrade() upgrade()
upgrade() upgrade()
print(“升级2次后,蔡徐坤的血量值为:",yase.hp) print("升级2次后,蔡徐坤的血量值为:",cxk.hp)
\ No newline at end of file \ 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