这就是我所拥有的。但是,当我尝试传递有效的电子邮件(例如[email protected])时,它不起作用。请帮忙。
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
只是修改
elif not (".com" or ".org" or ".edu" or ".gov" or ".net") in email[-4:]:
至
elif not email[-4:] in ".com.org.edu.gov.net":
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句