Commit f5fe770d by BellCodeEditor

save project

parent ae9569ab
Showing with 8 additions and 4 deletions
class Hero:
def __init__(self):
self.hp = 300
def __init__(self,hp,attack,name):
self.hp = hp
self.level = 1
self.attack = 20
yase = Hero()
self.attack = attack
self.name = name
yase = Hero(300,20,'亚瑟')
houyi = Hero(240,23,'后羿')
print(yase.hp)
print(houyi.hp)
\ 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