Question: 2. Fibonacci Sequence. Fibonacci numbers are numbers in a sequence, where each number is the sum of the two previous numbers. Starting with 0 and

2. Fibonacci Sequence. Fibonacci numbers are numbers in a sequence, where each number is the sum of the two previous numbers. Starting with 0 and 1, Fibonacci sequence goes like 1, 1, 2, 3, 5, 8, 13 etc. Write a Python program stored in a file L472.py that asks for a starting number and an ending number, and then prints all the Fibonacci numbers between them (and including the starting and ending numbers, if they are also Fibonacci numbers). Each Fibonacci number, must be separated by a space. Example #1. The user enters start and end numbers (lines 23). The program then outputs the total number of Fibonacci numbers within range, along with the numbers. Sample output 1. ************************************************** 2. Enter starting number: 5 3. Enter ending number: 500 4. 5. The 10 Fibonacci numbers between 5 and 500 are: 6. 5 8 13 21 34 55 89 144 233 377 7. ***************** ************** *********** Example #2. The user enters start and end numbers (lines 12). The program then outputs the total number of Fibonacci numbers within range, along with the numbers. ******* Sample output 1. *** 2. Enter starting number: 55 3. Enter ending number: 999 4. 5. The 7 Fibonacci numbers between 55 and 999 are: 6. 55 89 144 233 377 610 987 7. ********* **********
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
