Question: Question # 2 : Write a program that finds the range ( difference between the smallest and largest ) of 8 positive integer numbers the

Question #2:
Write a program that finds the range (difference between the smallest and largest) of 8 positive integer numbers the user inputs inside a "for loop" with a range().
The "for" loop range() function should start at 0 and go 8.
The user should enter the numbers as integers (there should only be one input statement inside the for loop, not 8 input statements for the integers).
Before the loop starts - create variables for the largest and smallest numbers and set them equal to zero. Then inside of the loop determine the largest and smallest number. You do that with an "if" test.
When the loop ends - and you are outside the loop-determine the range (difference between the smallest and largest number).
Print the range.
Then ask the user if they want to do this again (use a while loop for this).
Don't forget comments at the top of the code.
And don't forget to test the input (integer) to make sure the code does not error out when a user enters a float or a letter. Use try and except inside the loop where you convert the input from string to int().In python please
 Question #2: Write a program that finds the range (difference between

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!