Commit fdcd6711 by BellCodeEditor

save project

parent 9a0d2c93
Showing with 9 additions and 8 deletions
......@@ -4,11 +4,12 @@ class Hero:
self.name = name
self.hp=hp
self.attack = attack
def upgrade(self):
self.yase.level=self.yase.level+1
self.yase.hp=self.yase.hp+50
self.yase.attack=self.yase.attack+4
yase=Hero("亚瑟",300,20)
print(yase.attack)
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
upgrade()
\ No newline at end of file
print(yase.hp)
yase.upgrade()
yase.upgrade()
print("等级为:yase.level")
\ 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