Commit 6adc10e3 by BellCodeEditor

save project

parent b0152c1c
Showing with 8 additions and 5 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attck):
self.level = 1 self.level = 1
self.hp = 100 self.name = name
self.attack = 20 self.hp = hp
self.attck = attck
yase = Hero() yase=Hero("亚瑟",100,20)
print(yase.hp) dijia=Hero("迪迦",120,23)
print(yase.name+str(yase.hp))
print(dijia)
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