as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
implement a program to reverse a string.
user
def reverse_string(s):
    """
    function to reverse a string
    arguments:
        s: string to be reversed
    returns:
        string which is the reverse of given input
    """
    reversed_string = ""
    for char in s: 
        reversed_string = char + reversed_string
    
    return reversed_string

sample_string = "hello world!"
print(reverse_string(sample_string)) # "!dlrow olleh"
assistant