Python How To Find If A Value Is Invalid