Commit 0310d97e by BellCodeEditor

save project

parent 026abe50
Showing with 9 additions and 8 deletions
...@@ -4,10 +4,11 @@ class Hero: ...@@ -4,10 +4,11 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero("亚瑟",200,10) yase=Hero(11,200,10)
print(yase.hp)
def a: def upgrade():
self.level=level+1 yase.name=yase.name+1
self.hp=hp+10 yase.hp=yase.hp+10
self.attack=attack+5 yase.attack=yase.attack+5
a() upgrade()
\ No newline at end of file print(yase.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