My program is written as shown below, but I can't make it return the opposite word even though I think everything is correct. What is the problem? Input word is word and should return drow. Thank you for the help.
Yeah, I know that the second argument prints the correct string, but maybe I have to change something in the else function, so the empty string isn't returned or will it be always returned cause then maybe i could use another if statement to exclude it from printing the empty string or change something in the else statement?
The output before "Reversed word: ", is what you expect.
Where does that output come from?
But why does the function return an empty string?
How can you change the base case so that it returns what you expect?
Sorry to beat around the bush, but I'm a firm believer that solving the problem yourself will be more worthwhile than for someone to tell you the solution.