Commit 690b57d0 by BellCodeEditor

save project

parent 393b46f7
Showing with 9 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.name = name
self.attack = 20 self.hp = hp
self.attack = attack
yase = Hero() yase = Hero("亚瑟",100,20)
print(yase.level) dijia = Hero("迪迦",120,50)
print(yase.name+str(yase.hp))
print(dijia.name+str(dijia.hp))
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