Queer European MD passionate about IT

response.py 425 B

1234567891011121314151617181920212223
  1. from validator_collection import validators
  2. def main():
  3. if validate_email(input("What's your email address?\t\t")):
  4. print("Valid")
  5. else:
  6. print("Invalid")
  7. def validate_email(email: str) -> bool:
  8. try:
  9. email_address = validators.email(email, allow_empty = True)
  10. except Exception as e:
  11. email_address = None
  12. if not email_address:
  13. return False
  14. return True
  15. if __name__ == '__main__':
  16. main()