Recap - Email Validator
Part of the Logic & Flow section of Coddy's Python journey. Lesson 74 of 78.
Challenge
MediumCreate a function named clean_email_list that takes a list of email addresses and returns a list of valid, standardized email addresses.
Requirements:
- Convert all emails to lowercase and strip all whitespace at the beginning or end
- Only keep emails that:
- Contain exactly one '@' symbol
- Have at least one character before the '@'
- Have at least one character after the ‘@’
Use map() and filter() to solve the problem. Do not use for or while loops, comprehensions or generator expressions anywhere in your code, including inside helper functions.
Try it yourself
def clean_email_list(emails):
# Write your code below
valid_emails =
return list(valid_emails)All lessons in Logic & Flow
1Variables Exploration
ConstantsMultiple Variable AssignmentsSwapping VariablesPlaceholder VariablesRound NumbersList Casting4Contact Book Application
Display MenuAdd Contact7Sets Part 2
Mathematical Operations Part 1Mathematical Operations Part 2Recap - Treasure HuntSubsets and SupersetsIterating Over SetsRecap - Tournament Tracker2Dictionaries Part 1
What is a Dictionary?Creating a DictionaryAccessing ValuesModifying DictionariesRecap - Recipe Manager5Advanced Decision Making
Ternary OperatorMembership ChecksIdentity ChecksIndentation ErrorsRecap - Vacation Filter8Student Records Manager
Project OverviewAdd Student11Advanced Functions
Returning Multiple ValuesLambda Functions Part 1Lambda Functions Part 2Recap Challenge - Lambda SortRecursive Functions Part 1Recursive Functions Part 2Recap - Sum Nested List14Higher-Order Functions
The Map FunctionThe Filter FunctionRecap - Email ValidatorRecap - Number Processor3Dictionaries Part 2
Dictionary MethodsNested DictionariesChecking for KeysLooping Through DictionariesRecap - Frequency Counter9Advanced Data Aggregation
Using SumFinding Minimum and MaximumSorting Data EfficientlyRecap - Dictionary SorterPractice on your own: Online Python compiler