[SOLVED] Help needed with the hunt begins

i don’t really know what to write on this level. here’s my code:

``````def averageSize(burls):
sum = sumSize(burls)
return sum / burls.length

def sumSize(burls):
pass

while True:
burls = hero.findEnemies()
averege = averageSize(burls)
hero.say(averege)

``````

In the sumSize function, you need to iterate through the burls array, totalling their health.

Is this function

Find and return the sum of the health values of the elements in the burls array.

@dedreous and @AnSeDra, i don’t get what you mean.

Do you remember the level with the function that finds out the sum of the healths of all the enemies? ( like in the level Gas Attack) Well, do the same thing just for burls instead of enemies.
Do you understand now?

what should the hero say though?

That part you have just fine…hero.say(average) is perfect

here’s my code:

``````def averageSize(burls):
sum = sumSize(burls)
return sum / burls.length

def sumSize(burls):
totalHealth = 0
for burl in burls:
totalHealth += burl.health
pass

while True:
burls = hero.findEnemies()
averege = averageSize(burls)
hero.say(averege)
``````

You already have it in the base code.

How return the variabile totalHealth out of the sumSize function and you will complete the level.

He’s handling that with this code.

so what am i supposed to do?

``````burl.size
``````

Before this

Put this:

Put this:

``````len(burls)
``````

Does it work now?

no. here’s my new code:

``````def averageSize(burls):
sum = sumSize(burls)
return sum / burls.length

def sumSize(burls):
totalHealth = 0
for burl in burls:
totalHealth += hero.size
pass

while True:
burls = hero.findEnemies()
averege = averageSize(burls)

hero.say(averege)
``````

Recheck post 14 because I edited it.
Does it work now?

i saw, but instead of what?