So i need to code that takes a string and print it backwards.
Got this error message:
Traceback (most recent call last):
File "rev_text2.py", line 10, in
File "rev_text2.py", line 7, in reverse
TypeError: Can't convert 'int' object to str implicitly
all i can get by myself that it's all about type of data.
So please, give me an slightly help, but not the full answer. Just want to really understand and not to just know the answer.
reverse_text="!gnirts desrever emoS" def reverse(text): result="" key=len(text)-1 for i in text: result+=key key-=1 return result reverse(reverse_text)