Commit da822d23 by BellCodeEditor

save project

parent 6a2aecfc
Showing with 12 additions and 3 deletions
class Zui: class Zuiren:
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
self.name=name self.name=name
self.level=1 self.level=1
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yi=Zui("1",100,25) def up(self):
er=Zui("2",100,20) self.level+=1
self.hp+=5
self.attack+=10
yi=Zuiren("1",100,25)
er=Zuiren("2",100,20)
print(yi.hp)
print(er.hp)
yi.up()
er.up()
print(yi.hp) print(yi.hp)
print(er.hp) print(er.hp)
\ 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