Commit 1203e93a by BellCodeEditor

save project

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