Write a function that repeatedly reads numbers input by a user until the user enters done. Once done is entered, sort all the numbers in
Write a function that repeatedly reads numbers input by a user until the user enters ‘done’. Once ‘done’ is entered, sort all the numbers in ascending order. Print the total number of entered numbers and all the numbers in ascending order. Write a function that repeatedly reads numbers input by a user until the user enters ‘done’. Once ‘done’ is entered, sort all the numbers in ascending order. Print the total number of entered numbers and all the numbers in ascending order.
Below is an illustration that the user does not make errors when entering numbers. You need to consider exception handling in your code to get a full grade.
Please enter a new number. Enter done to end. 2 Please enter a new number. Enter done to end. 3 Please enter a new number. Enter done to end. 5.5 Please enter a new number. Enter done to end. 3 Please enter a new number. Enter done to end. done 4 numbers were entered. The numbers in an ascending order are: [2.0, 3.0, 3.0, 5.5]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Please let me know if you have any issues with this Note You didnt mention any ...See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started