#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. numbers = list(map(int, input().split())) negative = [n for n in number if n < 0 ] negative.sort(reverse = True) # take everything inside the list negatives and pass each item to print as a separate argument (*) #end = '' prevents from creating a new line after you print the list of numbers print( *negative, end = '')
To embed this project on your website, copy the following code and paste it into your website's HTML: