Commit 3e23b27c by BellCodeEditor

save project

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