Commit cb584d50 by BellCodeEditor

save project

parent 851fa07a
Showing with 13 additions and 6 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,HP,attack):
self.lever = 1 self.leve = 1
self.HP = 1 self.name = name
self.attack = 99 self.HP = HP
yase = Hero() self.attack =attack
print('等级:%d'%yase.lever) yase = Hero('亚瑟',300,20)
houyei = Hero('后羿',250,25)
print('等级:%s'%yase.name)
print('血量:%d'%yase.HP) print('血量:%d'%yase.HP)
print('伤害:%d'%yase.attack) print('伤害:%d'%yase.attack)
print('等级:%s'%houyei.name)
print('血量:%d'%houyei.HP)
print('伤害:%d'%houyei.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