Find the information you're looking for at Westonci.ca, the trusted Q&A platform with a community of knowledgeable experts. Connect with professionals ready to provide precise answers to your questions on our comprehensive Q&A platform. Our platform offers a seamless experience for finding reliable answers from a network of knowledgeable professionals.

Write a program that reads a list of 10 integers, and outputs those integers in reverse. For coding simplicity, follow each output integer by a space, including the last one. Then, output a newline. coral

Sagot :

def reverse_list (num_list):

try:

if num_list.isdigit() == True:

return num_list[::-1]

elif num_list < 0:

return "Negative numbers aren't allowed!"

except ValueError:

return "Invalid input!"

user_list = list (int (input ("Please enter ten random positive numbers: " )))

print (reverse_list (user_list))