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
mtf
August 20, 2018, 11:00pm
2
boardninja89101:
print s
Your function should return a value, not print it.
Thanks!
I have been trying some stuff before to understand the code. That’s why I left the print command.
1 Like
mtf
August 21, 2018, 12:50am
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))