Commit b06ea807 by BellCodeEditor

save project

parent 80ca61fc
Showing with 8 additions and 3 deletions
...@@ -9,12 +9,17 @@ class Hero(): ...@@ -9,12 +9,17 @@ class Hero():
name.hp=name.hp+50 name.hp=name.hp+50
name.attack=name.attack+4 name.attack=name.attack+4
yase=Hero('亚瑟',300,30) yase=Hero('亚瑟',300,30)
houyi=Hero('后羿',250,23) houyi=Hero('后羿',250,23)
zhugeliang=Hero('诸葛亮',270,40)
yase.upgrade() yase.upgrade()
houyi.upgrade() houyi.upgrade()
zhugeliang.upgrade()
print(yase.hp) print(yase.hp)
print(yase.attack) print(yase.attack)
print(yase.level) print(yase.level)
print(houyi.hp) print(houyi.hp)
print(houyi.attack) print(houyi.attack)
print(houyi.level) print(houyi.level)
\ No newline at end of file print(zhugeliang.hp)
print(zhugeliang.attack)
print(zhugeliang.level)
\ 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