Commit ec8756c5 by BellCodeEditor

save project

parent dbd9efda
Showing with 9 additions and 6 deletions
class Hero:
def __init__(self):
def __init__(self,name,hp,attack):
self.level=1
self.hp=100
self.attack=10
yese=Hero()
self.name=name
self.hp=hp
self.attack=attack
yese=Hero('亚瑟',100,10)
print('亚瑟的等级:',yese.level)
print('亚瑟的等级:',yese.hp)
print('亚瑟的等级:',yese.attack)
print('亚瑟的血量:',yese.hp)
print('亚瑟的攻击力:',yese.attack)
print('他的名字:',yese.name)
\ 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