Solved:

Checkmark

Answered by AI, Verified by Human Experts

12.17 lab: filter and sort a list write a program that gets a list of integers from input, and outputs negative integers in descending order (highest to lowest). ex: if the input is: 10 -7 4 -39 -6 12 -2 the output is: -2 -6 -7 -39 for coding simplicity, follow every output value by a space. do not end with newline.

12.17 lab: filter and sort a list write a program that gets a list of integers from input, and outputs negative integers in descending order (highest to lowest). ex: if the input is: 10 -7 4 -39 -6 12 -2 the output is: -2 -6 -7 -39 for coding simplicity, follow every output value by a space. do not end with newline.

Here's a simple Python program that takes a list of integers as input and outputs the negative integers in descending order.# Get a list of integers from inputinput_list = list(map(int, input().split()))# Filter and sort negative integers in descending ordernegative_numbers = sorted(filter(lambda x: x < 0, input_list), reverse=True)# Output the result with each value followed by a spaceoutput_str = ' '.join(map(str, negative_numbers))print(output_str, end=' ')You can run this program and input a list of integers, and it will output the negative integers in descending order, each followed by a space. For example:Input: 10 -7 4 -39 -6 12 -2Output: -2 -6 -7 -39...

Unlock full access for 72 hours, watch your grades skyrocket.
For just $0.99 cents, get access to the powerful quizwhiz chrome extension that automatically solves your homework using AI. Subscription renews at $5.99/week.