Commit bb99a16d by BellCodeEditor

save project

parent 9a43e85e
Showing with 10 additions and 4 deletions
...@@ -4,7 +4,13 @@ class zhuanwu: ...@@ -4,7 +4,13 @@ class zhuanwu:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
liuhaizhu = zhuanwu("刘海柱",240,23) def upgrade():
shazi.leave=shazi.leave+1
shazi.hp=shazi.hp+50
shazi.attack=shazi.attack+4
shazi = zhuanwu("傻子",300,30) shazi = zhuanwu("傻子",300,30)
print("刘海柱的血条是",liuhaizhu.hp) print("傻子的初始血量为",shazi.hp)
print("傻子的血条是",shazi.hp) upgrade()
\ No newline at end of file upgrade()
print("升级后2次,傻子的血条是",shazi.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