Commit 8d5d3fea by BellCodeEditor

save project

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