Commit 0a5a14d4 by BellCodeEditor

save project

parent fcea2171
Showing with 7 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.name = name
self.hp = hp
self.attack= 20 self.attack= 20
yase = Hero() libill = Hero("李bill",800,20)
print("yase的血量值为:",yase.hp) bill = Hero("bill",0.0001,100)
print("yaseATTACK",yase.attack) print("李billHP",libill.hp)
print("billHP",bill.hp)
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