Skip to main content
edited body
Source Link
Ionuț G. Stan
  • 179.6k
  • 19
  • 197
  • 206

You can use the slice operataroperator like this:

l = [1,2,3,4,5]
l2 = l[::2] # get subsequent 2nd item

You can use the slice operatar like this:

l = [1,2,3,4,5]
l2 = l[::2] # get subsequent 2nd item

You can use the slice operator like this:

l = [1,2,3,4,5]
l2 = l[::2] # get subsequent 2nd item
Source Link
Nick Dandoulakis
  • 43.4k
  • 17
  • 106
  • 139

You can use the slice operatar like this:

l = [1,2,3,4,5]
l2 = l[::2] # get subsequent 2nd item