repl.it
@Diogogomes/

fibonacci

Python

fibonacci

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
num = int(input("Fibonacci: " ))

if (num >= 0):
    print ("0")

    fib1 = 0
    fib2 = 1
    fibn = -1
    while fibn <= num:
        fibn = fib1 + fib2
        print (fibn)
        fib2 = fib1 
        fib1 = fibn
?