def reverse(text):
length = len(text)
length -= 1
a = ''
for pos in range(length/2):
a[pos] = text[length]
text[pos] = a[pos]
length -= 1
print text
While I was coding in codecademy I typed this code and found the error which is:
Does your reverse function take exactly one argument (a string)? Your code threw a "'str' object does not support item assignment" error.
which step am I doing wrong? how to proceed without using .join() or any in-built?
astarting in range len(s) down ?