Commit d160b762 by BellCodeEditor

save project

parent 167dc191
Showing with 8 additions and 7 deletions
class hero: class hero:
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
self.e=1
self.c=name self.c=name
self.b=hp self.b=hp
self.a=attack self.a=attack
d=hero('yase',300,20) def upgrade(self):
f=hero('simayi',500,236) self.a=self.a+50
def upgrade(h): self.b=self.b+50
h.a=h.a+50 kk=hero('yase',300,20)
h.b=h.b+50 kk.upgrade()
upgrade(f) print(kk.b)
print(f.a) \ 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