• + 1 comment

    I did something similar, every time I tried to print x in the for loop I was getting a vertical output, so I made it a string.

    *Edit: I copy and pasted your code, and didn't pass due to having the vertical output. Did it work for you?

    This passed for me.

    import sys
    
    n = int(input().strip())
    arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
    
    c = ""
    for x in arr[::-1]:
        c += str(x) + " "
    print(c)