Question: Write a function called user_name that takes two arguments, first_name and last_name and creates a user name consisting of the first three letters of the
- Write a function called user_name that takes two arguments, first_name and last_name and creates a user name consisting of the first three letters of the first name concatenated with the first three letters of the last name. You can assume ach name is at least three letters long.
Return the new user name. <25>
your results should yield something like these test cases.
>>> print(user_name("bob", "taft"))
bobtaf
>>>
>>> print(user_name("Ralph", "Waldo"))
RalWal
>>>
(For extra credit, Accept shoter names and pad them with Xs to fill out the 3 characters needed. So for example
>>> print(user_name("Bo", "Li"))
BoXLiX
>>> )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
