I understand how this works to produce the result but not the rationale behind the code itself.
Initially my code is like this:
a = ''
for i in text:
a += text[len(text)-1-i]
and it didnt work for the len(text)-1-i part.
However by putting a range like this:
for i in range(0, len(text)):
it worked instead?
Replace this line with your code.