Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Going to the grocery store later solution in Clear category for Feed Pigeons by bafflepitch
def checkio(food):
piegons = [] #piegon feed count
minute = 0 #the minute
while food > 0:
minute += 1 #advance minute
for new_bird in range (0,minute): #get new birds @UnusedVariable
piegons.append(0)
for index, piegon in enumerate(piegons): #feed the birds
if food > 0: #but only if you have f ood
piegons[index] += 1
food -= 1
return sum([1 for piegon in piegons if piegon > 0]) #count the pigs
May 24, 2016