Commit 42d8cced by BellCodeEditor

save project

parent ce65ab6e
Showing with 11 additions and 6 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attack):
self.level=0 self.level=0
self.hp=1 self.name = name
self.attack=0 self.hp = hp
self.attack = attack
yase=Hero()
print(yase.hp) yase=Hero("亚瑟",100,120)
\ No newline at end of file dijia=Hero("迪迦",120,50)
print(dijia.name+str(dijia.hp))
print(yase)
\ 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