0

What does this expression mean: string[::-1] in python. Here is the sample code:

def reverse_string(string): return string[::-1]

I know this is used for reversing a string, but how does this expression work?

Jean-François Fabre
  • 131,796
  • 23
  • 122
  • 195
Chinmoy Acharjee
  • 435
  • 4
  • 11

0 Answers0