Write a program that repeatedly asks the user to enter numbers (or blank to exit). After the user enters a blank line, the numbers will be sorted into ascending order and displayed as a sorted list. The program will also calculate and display the median value.
Write a program that repeatedly asks the user to enter numbers (or blank to exit). After the user enters a blank line, the numbers will be sorted into ascending order and displayed as a sorted list. The program will also calculate and display the median value.
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
Related questions
Question
Please send me answer of this question immediately and i will give you like sure sir
![Write a program that repeatedly asks the user to enter numbers (or blank to exit). After the user enters a blank
line, the numbers will be sorted into ascending order and displayed as a sorted list. The program will a
calculate and display the median value.
Notes:
• You can assume all the input numbers will be integer values
• If the list has an odd number of items, then the median is the middle value in the sorted list.
• If the list has an even number of items, then the median is the average of the middle two values.
Printing a list will produce the output in the correct format (e.g., [1, 2, 3, 4])
• The output must be in the format shown in the example, including the format of the prompt, and all spaces and
punctuation.
●
For example:
Input Result
3
2
1
Enter a number (blank to exit): 3
Enter a number (blank to exit): 2
Enter a number (blank to exit): 1
Enter a number (blank to exit):
Data: [1, 2, 3]
Median: 2
Show Transcribed Text
use python only](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1dabcb93-d2cc-40cb-800c-5d2107f27f94%2F950741e5-9f5b-4b33-8fb1-5e1885dc6fba%2Fk9hatgl_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Write a program that repeatedly asks the user to enter numbers (or blank to exit). After the user enters a blank
line, the numbers will be sorted into ascending order and displayed as a sorted list. The program will a
calculate and display the median value.
Notes:
• You can assume all the input numbers will be integer values
• If the list has an odd number of items, then the median is the middle value in the sorted list.
• If the list has an even number of items, then the median is the average of the middle two values.
Printing a list will produce the output in the correct format (e.g., [1, 2, 3, 4])
• The output must be in the format shown in the example, including the format of the prompt, and all spaces and
punctuation.
●
For example:
Input Result
3
2
1
Enter a number (blank to exit): 3
Enter a number (blank to exit): 2
Enter a number (blank to exit): 1
Enter a number (blank to exit):
Data: [1, 2, 3]
Median: 2
Show Transcribed Text
use python only
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage