def print_string_reversed(text): <FILL_HERE> print(reversed_text)

#4
by lvwerra HF staff - opened
BigCode org

Question:

def print_string_reversed(text):

print(reversed_text)

Answer:

def print_string_reversed(text):
    """Prints the text in reverse order."""


    reversed_text = ''
    for i in range(len(text)-1, -1, -1):
        reversed_text += text[i]


    print(reversed_text)
<|endoftext|>

Sign up or log in to comment