Reverse


#1

Hello guys!

I have a question regarding my code for the reverse exercise.

My code seems to work but it tells me that it does not.

Here it is:

def reverse(text):
cont = len(text)
s = ‘’
while cont > 0:
cont = cont - 1
s = s + text[cont]
print s

Thank you


#2

Your function should return a value, not print it.


#3

Thanks!

I have been trying some stuff before to understand the code. That’s why I left the print command.

:sweat_smile:


#4

For testing, print is your friend, but once you are ready to submit, be sure they are removed. You can print the function call, itself. The return value is what will print.

print (foo(bar))