Solve problem "Fibonacci numbers" online - Learn Python 3 - Snakify

Problem «Fibonacci numbers» (Hard)


Statement

The Fibonacci sequence is defined as follows: $$ \phi_0 = 0, \ \phi_1 = 1, \ \phi_n = \phi_{n-1} + \phi_{n-2} . $$ Given a non-negative integer \( n \), print the \( n \)th Fibonacci number \( \phi_n \).

This problem can also be solved with a for loop.


In all the problems input the data using input() and print the result using print().



Saved solutions

Tests

Input Correct answer Result
6
8
0
0
2
1
3
2
4
3
1
1
5
5
7
13
8
21
9
34
10
55
11
89
12
144
13
233
14
377
15
610
16
987
17
1597
18
2584
19
4181
20
6765