Gmail normalization
Input
normalize_email('User.Name+tag@gmail.com')
Output
'username@gmail.com'
Gmail domain: dots removed and plus-tag removed; result lowercased.
Full lesson preview
Clean and validate an email string, returning a normalized form or None for invalid inputs.
Problem statement
Task
Examples
Input
normalize_email('User.Name+tag@gmail.com')
Output
'username@gmail.com'
Gmail domain: dots removed and plus-tag removed; result lowercased.
Input
normalize_email(' Admin@Example.COM ')
Output
'admin@example.com'
Trim spaces and lowercase; local part kept as-is for non-gmail domains.
Input format
Output format
Constraints
Samples
Input
normalize_email('john.doe+newsletter@googlemail.com')
Output
'johndoe@googlemail.com'
Googlemail is treated like gmail: dots and plus-tags removed.