30 seconds of python

  Back to Home

reverse_string

stringbeginner

Returns the reverse of a string.

Use string slicing to reverse the string.

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