Commit bc367a3d by BellCodeEditor

save project

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