Commit 9b445076 by BellCodeEditor

save project

parent a187a719
Showing with 5 additions and 2 deletions
...@@ -4,7 +4,10 @@ class Hero: ...@@ -4,7 +4,10 @@ class Hero:
self.level = name self.level = name
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
yase=Hero("老六",500,70) def upgrade():
yase.level = yase.level+1
yase.hp=yase.hp+20
yase.attack=yase.attack+10
yase=Hero("老皮鸭",540,60) yase=Hero("老皮鸭",540,60)
print(yase.hp) print(yase.hp)
print(yase.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