This is how to reverse a string:
def reverse_string(s):
"""
Reverse a given string using slicing.
:param s: The input string
:return: The reversed string
"""
return s[::-1] # Slicing: Start to end with a step of -1
This is how to reverse a string:
def reverse_string(s):
"""
Reverse a given string using slicing.
:param s: The input string
:return: The reversed string
"""
return s[::-1] # Slicing: Start to end with a step of -1