Commit f5fe770d by BellCodeEditor

save project

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