Created
March 23, 2021 09:01
-
-
Save AnisahTiaraPratiwi/54b5ced811911a71e7bd8ab4876ae286 to your computer and use it in GitHub Desktop.
The email_list function receives a dictionary, which contains domain names as keys, and a list of users as values. Fill in the blanks to generate a list that contains complete email addresses (e.g. [email protected]).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def email_list(domains): | |
emails = [] | |
for domain, users in domains.items(): | |
for user in users: | |
emails.append("{}@{}".format(user, domain)) | |
return(emails) | |
print(email_list({"gmail.com": ["clark.kent", "diana.prince", "peter.parker"], "yahoo.com": ["barbara.gordon", "jean.grey"], "hotmail.com": ["bruce.wayne"]})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank You. this really helped.