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

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!