Commit 61dd6486 by BellCodeEditor

save project

parent bdc42d61
Showing with 9 additions and 2 deletions
......@@ -4,6 +4,13 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
self.level=self.level+1
self.attack=self.attack+100
self.hp=self.hp+10
houyi=Hero("后裔",100,1010)
yase=Hero("亚瑟",10001,10)
print(yase.hp)
\ No newline at end of file
print(houyi.hp)
upgrade()
\ 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