Commit 9d78c8e8 by BellCodeEditor

save project

parent 324809b6
Showing with 7 additions and 4 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attcack):
self.level=1 self.level=1
self.hp=300 self.name = name
self.attcack=20 self.hp=hp
yase = Hero() self.attcack=attcack
yase = Hero("亚瑟",300,100)
houyi = Hero("后裔",250,20)
print(yase.hp) print(yase.hp)
print(houyi.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