Commit d10a9c07 by BellCodeEditor

save project

parent e307caa3
Showing with 11 additions and 12 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): def __init__(self,name,xueliang,gongjili):
self.level=1 self.level = 100
self.name=name self.name = name
self.hp=hp self.xueliang = xueliang
self.attack=attack self.gongjili = gongjili
yase=Hero('yase',300,20) zhangweijia = Hero("张洧嘉",1000,10000)
hy=Hero('hy',250,23)
k=Hero('K',5600,199) print(zhangweijia.name)
print(yase.attack) print(zhangweijia.xueliang)
print(hy.attack) print(zhangweijia.gongjili)
print(k.attack) \ No newline at end of file
\ 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