Ask Question
4 October, 11:13

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

+2
Answers (1)
  1. 4 October, 15:02
    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?
Find 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 you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers