swap elements in list python using for loop