Commit ca70a836 by BellCodeEditor

save project

parent c1c3b2ef
Showing with 12 additions and 7 deletions
class daye:
def __init__(self,name,hp,attack,):
def __init__(self,level,name,hp,attack,):
self.level=level
self.name=name
self.hp=hp
self.attack=attack
nakelulu=daye("娜可露露",784,243)
hanxin=daye("韩信",664,214)
libai=daye("李白",671,184)
print(nakelulu.name,nakelulu.hp,nakelulu.attack)
print(hanxin.name,hanxin.hp,hanxin.attack)
print(libai.name,libai.hp,libai.attack)
def shengji():
nakelulu.level+=1
nakelulu.hp+=5
nakelulu.attack+=10
nakelulu=daye(1,"娜可露露",784,243)
shengji()
shengji()
print(nakelulu.name,nakelulu.hp,nakelulu.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