Commit ecb12f35 by BellCodeEditor

auto save

parent 43a039b7
Showing with 13 additions and 21 deletions
class Monster: a = []
def __init__(self,name,hp,attack): for i in range(10):
self.level = 1 n = input()
self.name = name n = int()
self.hp = hp a.append(n)
self.attack = attack print(a)
for j in range(len(a)):
for i in range(len(a)-j-1):
if a[i]>a[i+1]:
m=a[i]
a[i]=a[i+1]
a[i+1]=m
print(a)
frogy = Monster("frogy",10,2)
flowy = Monster("flowy",20,1)
creeper = Monster("creeper",20,25)
def upgrade(name):
name.level = name.level + 1
name.hp = name.hp + 5
name.attack = name.attack + 2
upgrade(frogy)
print(frogy.level)
print(frogy.hp)
print(frogy.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