In the first week of writing code for ME 305, we were tasked with creating a Fibonacci number calculator for any given (valid) index value.
The Fibonacci sequence is a mathematical pattern in which the next value is the sum of the last two values. Since this is a recursive pattern, it needs a root or base to go off of. Therefore, the zeroth and first Fibonacci numbers are 0 and 1. Accordingly, the second Fibonacci number is 0 + 1 = 1, the third is 1 + 1 = 2, and so on.
As this was our first real program written in Python, the goal of this lab was to become familiar with recursion, learn how to implement a function, and review simple logic. See Figure 1.1 below for an example of displayed messages from this program, or see Fibonacci.py for the full file documentation.
Click here for the next lab, 305 Lab 0x02: Getting Started With Hardware