CALPOLY MECHATRONICS
Documentation for all Mechatronics Labs
Lab1.py File Reference

A program that calculates the fibonacci number at given index. More...

Functions

def Lab1.fib (idx)
 This function calculates the fibonacci sequence. More...
 

Variables

 Lab1.requestedInx = input('Enter a Fibonacci index: ')
 

Detailed Description

A program that calculates the fibonacci number at given index.

Link to Source Code: https://bitbucket.org/ebriefer/me305_lab/src/master/Lab%201/Lab1.py This program prompts the user to input an index for the fibonacci sequence into the console. It then prints out the fibonacci number at that index to the console. If the user inputs a non-integer or negative value the program will prompt the user to enter a valid index. Note that problems occur with indexes larger than 1 million due to the fibonacci numbers becoming extremely large.

Author
Eliot Briefer
Date
1/21/2020

Function Documentation

◆ fib()

def Lab1.fib (   idx)

This function calculates the fibonacci sequence.

Note this function only works for positive integer indexes

Parameters
idxAn integer specifying the index in the fibonacci sequence to find
Returns
The associated Fibonacci number at the specified index