Commit e47b2085 by BellCodeEditor

save project

parent e9fd1177
Showing with 8 additions and 7 deletions
class datas:
def __init__(self,name,level,hp,attack):
def __init__(self,name,level,hp,attack,df):
self.name = name
self.level = level
self.hp = hp
self.attack = attack
self.hp = hp + (50* level)
self.attack = attack + (2*level)
self.df = df + (2*level)
ys = datas("亚瑟",1,300,20)
hy = datas("后羿",1,240,23)
print(ys.name,"\n",hy.name)
\ No newline at end of file
ys = datas("亚瑟",2,300,20,10)
hy = datas("后羿",2,240,23,8)
print(ys.hp,"\n",hy.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