Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
while listenin to eminem... solution in Clear category for Ghosts Age by Adrian_W
def checkio(opacity):
fibs=[0,1]
while fibs[len(fibs)-1]<5000:
fibs.append(fibs[len(fibs)-1]+fibs[len(fibs)-2])
myopacity=10000
years={10000:0}
age=1
while age<=5000:
if age in fibs:
myopacity-=age
years[myopacity]=age
else:
myopacity+=1
years[myopacity]=age
age+=1
return years[opacity]
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio(10000) == 0, "Newborn"
assert checkio(9999) == 1, "1 year"
assert checkio(9997) == 2, "2 years"
assert checkio(9994) == 3, "3 years"
assert checkio(9995) == 4, "4 years"
assert checkio(9990) == 5, "5 years"
Oct. 16, 2016