Commit c476a452 by BellCodeEditor

save project

parent 2ccb03ca
Showing with 12 additions and 7 deletions
class Hero: class Hero:
def __init__(yase): def __init__(self,name,hp,attack):
yase.level=1 self.level=1
yase.hp=300 self.name=name
yase.attack=20 self.hp=hp
yase=Hero() self.attack=attack
print(yase.hp) yase=Hero("yase",300,20)
\ No newline at end of file houyi=Hero("houyi",250,23)
k=Hero('k',5600,200)
print(yase.attack)
print(houyi.attack)
print(k.attack)
\ 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