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

Fibonacci numbers


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.

Advertising by Google, may be based on your interests

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

Advertising by Google, may be based on your interests