Module Expr Str Assign NameStore Str ClassDef bases body FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Lambda arguments args NameParam defaults SubscriptLoad Call NameLoad Lambda arguments args NameParam NameParam defaults ListLoad SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Call NameLoad NameLoad ListLoad Num Num Index Num Return Call NameLoad BinOpSub NameLoad Num decorator_list decorator_list
N/A N/A 
Find the Nth number in Fibonacci sequence.

A Fibonacci sequence is defined as follow:

The first two numbers are 0 and 1.
The i th number is the sum of i-1 th number and i-2 th number.
The first ten numbers in Fibonacci sequence is:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34 ...

Have you met this question in a real interview? Yes
Example
Given 1, return 0

Given 2, return 1

Given 10, return 34

Note
The Nth fibonacci number won't exceed the max value of signed 32-bit integer in the test cases.
 N/A __author__ Daniel Solution N/A N/A fibonacci N/A N/A self n N/A N/A N/A 
        For loop in a functional way
        :param n: an integer
        :return: an integer f(n)
         N/A f N/A N/A N/A n N/A N/A N/A reduce N/A N/A N/A x n N/A N/A N/A x N/A 1 N/A N/A x N/A 0 N/A x N/A 1 N/A range n N/A 0 1 N/A 0 N/A N/A f N/A n 1 N/A N/A