Commit ceaba00f by BellCodeEditor

save project

parent 7c7e100c
Showing with 6 additions and 3 deletions
...@@ -6,5 +6,8 @@ class Hero: ...@@ -6,5 +6,8 @@ class Hero:
self.attack = attack self.attack = attack
yase = Hero('亚瑟',300,30) yase = Hero('亚瑟',300,30)
houyi = Hero('后羿',200,40) houyi = Hero('后羿',200,40)
print(yase.hp) def upgrade():
print(houyi.name) yase.level=yase.level+1
\ No newline at end of file yase.hp = yase.hp+50
yase.attack=yase.attack+4
upgrade()
\ 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