Need help figuring out why this code is not working.
def reverse(text): rev =  x = len(text) for i in range(x-1,-1): rev.append(text[i]) return "".join(rev)
Here is my logic as I see it. What am I missing.
rev is blank list
x is character length of argument (7)
iterate through the range 6 - 0 (6, 5, 4, 3, 2, 1, 0) with i as the variable
for each iteration append the Python![i] to the empty list rev
this should create a list that looks like ['!', 'n', 'o', 'h', 't', 'y', 'P']
when the iteration is complete join the items of the rev list with no space between and return it.