Question: Python 3.6 - Create a program that uses ITERATION (not recursive function) to determine fibonacci numbers from 1-50. This is how to do it: create
Python 3.6 - Create a program that uses ITERATION (not recursive function) to determine fibonacci numbers from 1-50. This is how to do it: create a Python dictionary with two entries: the keys 0 and 1, and the Fibonacci numbers for those as the values. Then, use a loop to extend the dictionary by adding more entries, up to the limit specified by the user. Inside the loop, the two previous Fibonacci numbers are drawn from the dictionary and summed to create the next Fibonacci number, which is then put into the dictionary. This work should be carried out in a function, which is called from the main program to produce a dictionary of stored Fibonacci numbers. They can then be output for display.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
