You are viewing a single comment's thread. Return to all comments →
Not necessary. I just take whatever comes as the second input, create a list from it, reverse it and print the elements glued with a space.
Your code didn't work.
>> print(input()==0 or " ".join(input().split()[::-1]))
10 20 30 40
I guess that you forgot to press Enter after the first integer input.