def str_rev(str):
    rstr = ''
    index = len(str)
    while index > 0:
        rstr += str[index - 1]
        index = index - 1
    return rstr


print(str_rev('string'))

4e1e078cdd8a892e5523c32bafb48f48f1ad347b
<mask token>

def str_rev(str):
    rstr = ''
    index = len(str)
    while index > 0:
        rstr += str[index - 1]
        index = index - 1
    return rstr


<mask token>

def str_rev(str):
    rstr = ''
    index = len(str)
    while index > 0:
        rstr += str[index - 1]
        index = index - 1
    return rstr


print(str_rev('string'))
