def rev(a): b = [] n = len(a) for i in range(n): b.append(a[n-i-1]) return b x = [1,2,3,8,20] y = rev(x) print x,y