I'm having trouble understand how to fix the below code so the function will print a_string in reverse. I know rev is not defined...just couldn't figure out how to make it work. Any help would be great, thanks.
def reverse(a_string):
  for i in range(len(a_string)-1, -1, -1):
    rev =rev+ a_string[i]
    return rev
reverse("cat")
print(rev)


revto an empty string before the for loop.