Commit 13906dda by BellCodeEditor

save project

parent 22354288
Showing with 20 additions and 0 deletions
class Hero:
def __init__(self):
self.level = 1
self.hp = 300
self.attack = 20
def a(self):
self.level=yaes.level+1
self.hp=yaes.hp+50
self.attack=yaes.attack+5
yaes = Hero()
print("yaes的血量值为:",yaes.hp)
print("yaes的攻击值为:",yaes.attack)
print("yaes的等级为:",yaes.level)
yaes.a()
yaes.a()
yaes.a()
print("yaes的血量值为:",yaes.hp)
print("yaes的攻击值为:",yaes.attack)
print("yaes的等级为:",yaes.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