Commit 3eecce1a by BellCodeEditor

save project

parent 527ecf8c
Showing with 6 additions and 3 deletions
...@@ -4,5 +4,9 @@ class Hero: ...@@ -4,5 +4,9 @@ class Hero:
self.name = name self.name = name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
guanyu=Hero("关羽",300,89) yao=Hero("瑶",300,89)
print(guanyu.hp) def upgrade():
\ No newline at end of file yao.hp=yao.hp+40
yao.attack=yao.attack+20
upgrade()
print(yao.hp)
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