Commit f498fc29 by BellCodeEditor

save project

parent 5cf58be8
Showing with 11 additions and 7 deletions
class Hero:
def __init__(self,hp,attack):
def __init__(self,level,hp,attack):
self.level = 1
self.hp = 300
self.attack = 20
yase = Hero(300,20)
def upd():
yase.hp += 50
yase.attack += 4
def upd(self):
self.level += 1
self.hp += 50
self.attack += 4
upd()
upd()
yase = Hero(1,300,20)
for i in range(14):
yase.upd()
print('yase的等级为:',yase.level)
print('yase的血量值为:',yase.hp)
print('yase的攻击值为:',yase.attack)
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