-2

Is it possible to reorder a list by given index in python ?

If i have the list: [1,2,3,4,5]

I would like to reorder by the second index to have something like this: [3,4,5,1,2]

Fedour
  • 367
  • 1
  • 3
  • 18

1 Answers1

0

try this:

result = list[:index] + list[index:]

elod
  • 9