https://devhubby.com/thread/how-to-check-for-invalid-input-in-my-python-code