Python error validating verification code