-2

In Python, I don't know the meaning of the following usage:

sample[::-1]

Who knows that? Do you know what [::-1] means?

Ozgur Vatansever
  • 45,449
  • 17
  • 80
  • 115
Jun-Beom Park
  • 114
  • 1
  • 10

1 Answers1

0
>>> range(10)[::-1]
[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
Chen Xu
  • 332
  • 1
  • 4
  • 14