Commit d160b762 by BellCodeEditor

save project

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