Coding Challenge 1: Email Usernames PYTHON********************************************************* In this coding chall

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Coding Challenge 1: Email Usernames PYTHON********************************************************* In this coding chall

Post by answerhappygod »

Coding Challenge 1: Email Usernames
PYTHON*********************************************************
In this coding challenge, you will be retrieving email usernames
from a string. You will write a function named get_usernames() that
takes in a string as it's input parameter, and returns a list of
email usernames in the string. The input
strings will contain 0 or more emails in the format
username@domainname, and the '@' symbol will only appear in the
context of an email. The order of usernames should match the order
in the input text.
For example:
EXAMPLE 1 text: "If you need help on an
assignment, email [email protected] or [email protected]" return:
['help', 'support']
EXAMPLE 2 text: "Good morning! I hope
you're having a great time with CSE 8A!" return: []
EXAMPLE 3 text: "I've been having a lot of
trouble reaching you, can you please email me at [email protected]?
Again, my email is [email protected]!" return: ['cse', 'cse']
Here is the problem description:
Function Name: get_usernames
Parameter: text - A string corresponding to a
piece of text containing 0 or more emails.
Return: A list of the email usernames in the
input text.
Description: Given a piece of text, extract
all email usernames and return them in a list.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply