Python and simple recursion

This afternoon my husband and I talked about recursion, and we decided to write some recursion functions with different languages. He uses JavaScript, and I use Python.

Here is the simple question: Please use recursion to revert 12345 to 54321

def reverse(val, new_val):
    if val == '':
        print(new_val)
    else:
        reverse(val[:-1], new_val + val[-1:])

if __name__ == '__main__':
    reverse(raw_input('Please provide any number: '), '')

Continue reading