Commit 1203e93a by BellCodeEditor

save project

parent 324a30c5
Showing with 8 additions and 7 deletions
class Heros: class Heros:
def __init__(self): def __init__(self , name , attack , hp):
self.hp = 200 self.name = name
self.level = 1 self.level = 1
self.attack = 20 self.attack = attack
self.hp = hp
wukong = Heros() wukong = Heros("悟空" , 36 , 500)
print("hp:"+ str(wukong.hp)) yase = Heros("亚瑟" , 20 , 800)
\ No newline at end of file print(wukong.name +"的hp:"+ str(wukong.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