+ 1
i want the email --input()-- to be an actual email instead of string because the user will enter anything and this is a Messđ„č?
3 RĂ©ponses
+ 9
BLK ,
there is a special python modul available for the purpose of email validating that can be installed. you should read the key features.
https://pypi.org/project/email-validator/
+ 4
For exaple to check if an email is valid you can check if the string contains â@â
You can check it like this
(âbad_emailâ).__contains__(â@â) -> False
(âgood_email@gmail.com).__contains__(â@â) -> True
Other method:
email = input() -> âbad_emailâ
email2 = input() -> âgood_email@gmail.comâ
print(â@â in email) -> False
print(â@â in email2) -> True
Hope this helps you