Commit 86980933 by BellCodeEditor

save project

parent a0c2b368
Showing with 9 additions and 7 deletions
...@@ -4,10 +4,12 @@ class Hero: ...@@ -4,10 +4,12 @@ class Hero:
self.name = name self.name = name
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def upgrade(self):
self.level=yase.level+1
self.hp=yase.hp+121216
self.attack=yase.attack+000000000
self=Hero("亚瑟",100,120)
yase=Hero("亚瑟",100,120) print("亚瑟血量为",yase.hp)
dijia=Hero("迪迦",120,50) yase.upgrade()
print(yase.name+str(yase.hp))
print(dijia.name +str(dijia.hp)) \ No newline at end of file
print(yase)
\ 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