Home / Expert Answers / Computer Science / multiple-ranges-in-python-name-this-script-34-q-loops-py-34-write-a-script-that-performs-the-same-ta-pa343

(Solved): Multiple ranges in Python Name this script "q-loops, py". Write a script that performs the same task ...



Multiple ranges in Python

Name this script q-loops, py.
Write a script that performs the same task as in q-steps.py, repeatedly.
- In an outer loop
Example run
Name this script "q-loops, py". Write a script that performs the same task as in "q-steps.py", repeatedly. - In an outer loop, ask for two floating point values. The two values must be on the same line, i.e. use a single input () statement to get a string that contains both values. Split the string and convert each piece into a floating-point number. - If the values are the same, quit the loop and end the program. - If the values are different, ask for an integer. As before, the two floating-point values are the endpoints of a range of numbers. The integer is the number of steps to divide the range into. Print out each of the steps, including the two endpoints, with three decimal points. However, all values must be printed on the same line. - Use a try-except block to catch errors including ZeroDivisionErro\}, If a ZeroDivision Error occurs, catch it and print the message "No steps.", and continue. If any other exception occurs, print the floating point values and the integer on a single line, then re-raise the exception to terminate the program. - Repeat all these steps until the user enters equal start and stop values (or until an exception terminates the program). See the example run below. Example run


We have an Answer from Expert

View Expert Answer

Expert Answer


The code for taking input for starting and ending elements with their steps and printing the each step value. while(1): #take input as string s=
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe