For example:
I have an array number like
n = int(input().strip()) # 4
arr = map(int,input().strip().split(' ')) #2 4 3 1
print(arr[::-1])
inputs:
4
2 4 3 1
My output is [1,3,4,2]
But actual output must be 1 3 4 2
How do I implement this using python 3?
print(*arr[::-1]), as chepner said, it's the outputting that your question's about.mapisn't sliceable in Python 3, so your code doesn't produce the output you claim it does.