Question
Python Programming def create_usernames(names): Question 6 - Given a list of names, return a list with the names converted to usernames. to convert a
Python Programming
def create_usernames(names): """ Question 6 - Given a list of names, return a list with the names converted to usernames. to convert a name to a username, take the first character of the first name, the entire last name, put them together with no spaces, make all characters lowercase, and then add the number 3 to the end. - You can assume that all inputted names will only have one space character, which will separate the first name and the last name. >>> create_usernames(["Angela Martin", "Pam Beesly"]) ["amartin3", "pbeesly3"] >>> create_usernames(["Jan Levinson"]) ["jlevinson3"] >>> create_usernames([]) [] """ pass
def sort_by_age_desc(list_of_employees): """ Question 7 - Michael is thinking about giving his employees a raise based on how long they have worked at Dunder-Mifflin. Unfortunately, he has confused this number with the employee's ages. Return a list that starts with his oldest employees and ends with his youngest. >>> emps = [ ("Kelly Kapoor", 32), ("Pam Beesly", 30), ("Jim Halpert", 36), \ ("Creed Bratton", 73), ("Dwight Schrute", 38) ] >>> sort_by_age_desc(emps) [('Creed Bratton', 73), ('Michael Scott', 42), ('Dwight Schrute', 38), \ ('Jim Halpert', 36), ('Pam Beesly', 30)] """ pass
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started