Commit 42ea2805 by BellCodeEditor

save project

parent 48fbb25f
Showing with 9 additions and 3 deletions
...@@ -5,7 +5,13 @@ class Hero: ...@@ -5,7 +5,13 @@ class Hero:
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def upgrade():
xiao.level=xiao.level+10
xiao.hp=xiao.hp+650
xiao.attack=xiao.attack+780
xiao = Hero("魈",300,20) xiao = Hero("魈",300,20)
hutao = Hero("胡桃",240,23)
print(xiao.hp) print(xiao.hp)
print(hutao.hp) upgrade()
\ No newline at end of file upgrade()
print(xiao.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