How To Handle Invalid Input In Python