lst = [1, 4, 2, 3] for i in range(len(lst) // 2): result = len(lst) - i - 1 temp = lst[i] lst[i] = lst[result] lst[result] = temp print(lst)
To embed this project on your website, copy the following code and paste it into your website's HTML: