SHARE
TWEET

code

a guest Nov 14th, 2019 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def fibonakki(loppu, asti):
  2.     fibolista = [0, 1]
  3.     for i in range(2, loppu):
  4.         fibonumero = fibolista[i-1] + fibolista[i-2]
  5.         if fibonumero > asti:
  6.             fibolista.append(fibonumero)
  7.             break
  8.         else:
  9.             fibolista.append(fibonumero)
  10.  
  11.     return fibolista
  12.  
  13. searchlist = []
  14. def fiboetsi(start, end):
  15.     lista = fibonakki(100, end)
  16.     alkufibo = 0
  17.  
  18.     for num in lista:
  19.         if num < start:
  20.             pass
  21.         else:
  22.             alkufibo = lista[lista.index(num)]
  23.             break
  24.  
  25.     for e in range(lista.index(alkufibo), lista.index(lista[-1])):
  26.         searchlist.append(lista[e])
  27.  
  28.     return(searchlist)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top