Commit dd207cca by BellCodeEditor

save project

parent 0bc3f25a
Showing with 7 additions and 5 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.hp=100 self.hp=hp
self.attack=30 self.attack=attack
yase=Hero() self.name=name
print('亚瑟的等级:',yase.level) yase=Hero('亚瑟',100,30)
print('亚瑟的名字:',yase.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