from validator_collection import validators def main(): if validate_email(input("What's your email address?\t\t")): print("Valid") else: print("Invalid") def validate_email(email: str) -> bool: try: email_address = validators.email(email, allow_empty = True) except Exception as e: email_address = None if not email_address: return False return True if __name__ == '__main__': main()