Ryan McLaughlin | Mechatronics Portfolio
Fibonacci.py File Reference

Determine the Fibonacci number at any valid index value. More...

Functions

def Fibonacci.fib (idx)
 This function calculates a Fibonacci number at a specific index. More...
 

Variables

 Fibonacci.idx = input('Please enter a Fibonacci index value ')
 Users must enter a Fibonacci index value, stored as idx More...
 

Detailed Description

Determine the Fibonacci number at any valid index value.

This lab is intended to serve as an introduction to Python. See code here: https://bitbucket.org/ryanmclaug/me_305/src/master/Lab0x01/Fibonacci.py

Author
Ryan McLaughlin
Date
01/20/21

Function Documentation

◆ fib()

def Fibonacci.fib (   idx)

This function calculates a Fibonacci number at a specific index.

Using a while loop and a bottom up approach solution method, this function determines the Fibonacci number for a given index. Note that this function is only designed to handle valid index values, such that any invalid indecies should be handled by the test program.

Parameters
idxA postivie integer specifying the index of the desired Fibonacci number
Returns
Value of Fibonacci number for given index

Variable Documentation

◆ idx

Fibonacci.idx = input('Please enter a Fibonacci index value ')

Users must enter a Fibonacci index value, stored as idx

Each time the user is prompted for input, the index value input defines which Fibonacci number will be calculated.