Commit c4f2f49c by BellCodeEditor

save project

parent e25d2c58
Showing with 8 additions and 5 deletions
class Hero: class Hero:
def __inti__(self): def __init__(self,name,hp,attack):
self.name = name
self.level = 1 self.level = 1
self.hp = 300 self.hp = hp
self.sttack = 20 self.attack = attack
yase = Hero() yase = Hero("亚瑟",1000,2000)
print(yase.hp) houyi = Hero("后裔",550,100)
print("输出亚瑟的血量:"yase.hp)
print("输出后裔的血量:"houyi.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