Commit bc367a3d by BellCodeEditor

save project

parent 0e2585bb
Showing with 6 additions and 5 deletions
class Hero: class Hero:
def __init__(self): def __init__(self , name , hp , attack):
self.level = 1 self.level = 1
self.hp = 300 self.hp = 300
self.attack = 30 self.attack = attack
yase = Hero() self.name = name
print(yase.level) yase = Hero("亚瑟" , 300 , 30)
\ No newline at end of file print(yase.name + "的hp是" + str(yase.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