Ask Question
Today, 05:36

9.17 LAB: Name format Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName, and whose output is: lastName, firstName middleInitial. Ex: If the input is: Pat Silly Doe the output is: Doe, Pat S. If the input has the form firstName lastName, the output is lastName, firstName. Ex: If the input is: Julia Clark the output is: Clark, Julia

+1
Answers (1)
  1. Today, 08:03
    0
    name=input ("Enter a name: ")

    names = name. split ()

    if

    (len (names) = =3) : middle=names[1] mid=middle[0]. upper () + "." last=names[2]+"," first=names[0] print ('Formatted Name:', last, first, mid) elif (len (names) = =2) : last=names[1]+',' first=names[0]

    print ('Formatted Name:', last, first)

    else:

    print ('The input does not have the correct form')
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “9.17 LAB: Name format Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName ...” in 📙 Engineering if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers