Challenge 02b

Fibonacci Number

Each line of input contains an integer.

For each input integer n, print the nth number in the Fibonacci sequence.

For more on Fibonacci number, see https://en.wikipedia.org/wiki/Fibonacci_number

Hint: submission will fail if your code took too long to run.

Example

Input (stdin):

1
2
3
4
5
6

Output (stdout):

1
1
2
3
5
8

Input (stdin):

0
6
5
1
4

Output (stdout):

0
8
5
1
3
numbers = [] while 1: try: numbers.append(int(input().strip())) except: break def fib(n): # your code here for i in numbers: print(fib(i))
测试输入

(result will show up here)
example notif text