Commit 0310d97e by BellCodeEditor

save project

parent 026abe50
Showing with 8 additions and 7 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)
def upgrade():
yase.name=yase.name+1
yase.hp=yase.hp+10
yase.attack=yase.attack+5
upgrade()
print(yase.hp) print(yase.hp)
\ No newline at end of file
def a:
self.level=level+1
self.hp=hp+10
self.attack=attack+5
a()
\ 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