Can you write a function that reverses a string in your preferred programming language?
Implement reverse_string(s), which accepts a string and returns the characters in reverse order. Preserve spaces, punctuation, capitalization, and repeated characters. The input string is immutable, so use a mutable character sequence or another suitable technique.
s.s in reverse order.The function must also handle empty strings and one-character strings.
def reverse_string(s):