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
  • 137,073
  • 23
  • 153
  • 219
Chinmoy Acharjee
  • 520
  • 5
  • 16

0 Answers0