SHARE
TWEET

Untitled

a guest Nov 14th, 2019 93 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. def fiboetsi(start, end):
  14.     lista = fibonakki(1000000000000000000000000000, end)
  15.     searchlist = []
  16.    
  17.     for num in lista:
  18.         if num < start:
  19.             pass
  20.         else:
  21.             alkufibo = lista[lista.index(num)]
  22.             break
  23.  
  24.     for e in range(lista.index(alkufibo), lista.index(lista[-1])):
  25.         searchlist.append(lista[e])
  26.  
  27.     return(searchlist)
  28.  
  29. print(fiboetsi(100,10000))
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top