1

This is what I have. However when I try to pass a valid email such as asm@aol.net it doesn't work. Please help.

 email = email.strip().lower()
        if not "@" in email:
            print("Invalid email")
            print()
            return
        elif not (".com" or ".org" or ".edu" or ".gov" or ".net") in email[-4:]:
            print("Invalid email")
            print()
            return
user14947804
  • 13
  • 1
  • 3

1 Answers1

0

just modify

elif not (".com" or ".org" or ".edu" or ".gov" or ".net") in email[-4:]:

to

elif not email[-4:] in ".com.org.edu.gov.net":
Nour-Allah Hussein
  • 1,439
  • 1
  • 8
  • 17