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: ') | |
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.
| def Lab1.fib | ( | idx | ) |
This function calculates the fibonacci sequence.
Note this function only works for positive integer indexes
| idx | An integer specifying the index in the fibonacci sequence to find |