Reverse a string
Write a function named reverse_string that takes a string text as input and returns a new string with the characters of text reversed. Use a for loop rather than slicing with [::-1].
Complete the supplied function in Listing 1. Keep its signature and use the checks below it.
TipHint
len(text) returns the number of characters, so len("cat") is 3 and len("") is 0. A for loop over a string visits its characters in order. String indexing starts at 0, so "cat"[0] is "c"; the index must refer to an existing character.
assert condition stops the check with an AssertionError when the condition is false.