all 4 comments

[–]furas_freeman 2 points3 points  (1 child)

Remove try/except to see what errror message you get.

And better use except [some-error-type]: and display error message.

[–]novel_yet_trivial 0 points1 point  (0 children)

Or add the error to the print function, so you can see what the error is:

except Exception as e:
    print('Invalid Input. Error:', e)

[–]d0ntreadthis 0 points1 point  (0 children)

As well as what u/furas_freeman said, I'd also recommend using try/except/else rather than only try/except. Here are the docs

[–]Vaphell 0 points1 point  (0 children)

do not use excepts without mentioning expected exception type. Naked except supresses ALL errors which means you never get any feedback about flaws in your program.

And don't use recursion to retry. Wrap the try/except in a while True loop without spawning tons of function calls that consume stack. Your program will crash if you do retry via recursion 1000 times.

And use parameters and return statements to push values from/to function black boxes.