Commit 7f6f09cd by BellCodeEditor

auto save

parent 3f54fa14
Showing with 6 additions and 8 deletions
class hero():
def __init__(self):
self.level=1
self.hp=300
self.attack=20
yase=hero()
print(yase.hp)
print(yase.level)
\ No newline at end of file
def __init__(self,name,level,hp,attack):
self.level=level
self.hp=hp
self.attack=attack
yase=hero('亚瑟',5,500,2)
print('亚瑟的攻击',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