Commit 8d5d3fea by BellCodeEditor

save project

parent b0132c38
Showing with 8 additions and 6 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,attack,hp):
self.hp=300 self.name=name
self.hp=hp
self.level=1 self.level=1
self.attack=20 self.attack=attack
yase=Hero() yase=Hero('yase',120,300)
print(yase.hp) hoyi=Hero('hoyi',130,250)
\ No newline at end of file print('亚瑟的血量是',yase.hp)
print('后裔的血量是',hoyi.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