Commit c06bcc94 by BellCodeEditor

save project

parent f5fe770d
Showing with 8 additions and 4 deletions
...@@ -4,7 +4,11 @@ class Hero: ...@@ -4,7 +4,11 @@ class Hero:
self.level = 1 self.level = 1
self.attack = attack self.attack = attack
self.name = name self.name = name
def upgrade():
yase.level+=1
yase.hp+=50
yase.attack+=4
yase = Hero(300,20,'亚瑟') yase = Hero(300,20,'亚瑟')
houyi = Hero(240,23,'后羿') upgrade()
print(yase.hp) upgrade()
print(houyi.hp) print(yase.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