Commit 08d9abaf by BellCodeEditor

auto save

parent 22354288
Showing with 27 additions and 0 deletions
class Helo:
def __init__(self,name,hp,attack):
self.level=1
self.hp=hp
self.attack=attack
def a(self):
self.level=self.level+1
self.hp=self.hp+80
self.attack=self.attack+10
yase=Helo('yase',300,20)
hy=Helo('hy',250,23)
k=Helo('k',5600,199)
Helo.a(yase)
Helo.a(hy)
Helo.a(k)
print(yase.hp)
print(hy.hp)
print(k.hp)
print(yase.attack)
print(hy.attack)
print(k.attack)
print(yase.level)
print(hy.level)
print(k.level)
\ 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