Interchange First and Last Element of a List

list3 = [1, 2, 4, 6]



a=list3[0]

list3[0]=list3[-1]

list3[-1]=a


print (list3)

Comments

Popular posts from this blog

Guess game!

Path for chromedriver