Objective
Create a Python program that validates email addresses with a simple pattern.
Instructions
- Read an integer
nand thennaddresses, one per line. - An address is valid if it has: a user made up of letters, numbers, dots or underscores; an
@; a domain made up of letters or numbers; a dot; and an extension of 2 or more lower-case letters. The pattern isr"[A-Za-z0-9_.]+@[A-Za-z0-9]+\.[a-z]{2,}". - Use
re.fullmatch. - Show
ValidorNot validfor each address.
4
ana@mail.com
ana@mail
@mail.com
ana.perez_1@empresa.es
Valid
Not valid
Not valid
Valid
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise