Commit bf5cd186 by BellCodeEditor

save project

parent 92aaec90
Showing with 9 additions and 6 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,HP,attack):
self.level=1 self.level=1
self.HP=300 self.name=name
self.attack=20 self.HP=HP
yase=Hero() self.attack=attack
print(yase.HP) yase=Hero("亚瑟",300,20)
\ No newline at end of file houyi=Hero("后羿",240,27)
print("亚瑟的血量是:",yase.HP)
print("后羿的血量是:",houyi.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