Commit a1b72b43 by BellCodeEditor

save project

parent 67ec137d
Showing with 7 additions and 4 deletions
class Hero:
def __init__(self):
def __init__(self,name,hp,attack):
self.leve1 = 5
self.name = name
self.hp = 500
self.attack = 40
yase = Hero()
print(yase.hp)
\ No newline at end of file
yase = Hero("齐天大圣",500,40)
qqqqq = Hero("众神之王",1000,20)
print("齐天大圣血量为:",yase.hp,"齐天大圣攻击力为:",yase.attack)
print("众神之王血量为:",qqqqq.hp,"齐天大圣攻击力为:",qqqqq.attack)
\ 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