1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
amid [387]
4 years ago
8

Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName, and who

se 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.
Computers and Technology
1 answer:
never [62]4 years ago
4 0

Answer:

Python Program:

if __name__ == '__main__':

   a = input("Enter Name: ")

   b = a.split()

   print(b[2] + ',' , b[0], b[1][0])

Explanation:

The input function will be used to prompt user to enter the name of the person. The person's name will be stored in variable a.

Let us assume that the user entered a name mentioned in the example, which is Pat Silly Doe, Now variable a = 'Pat Silly Doe'.

The function a.split() is used to split a string into a list. The splitting (by default) is done on the basis of white-space character. Therefore, a.split() will give a list

['Pat', 'Silly', 'Doe']

which will be later on stored in variable b.

We can use the subscript operator [] to access the values in a list. Suppose if we have a list a, then a[i] will give us ith element of a, if i < length of a.

Finally, we print the answer. b[2] will give us the last name of the person. We append a comma using '+' operator. b[0] will give us the first name. b[1] will give us the middle name, but since we only need one character from the middle name, we can use another subscript operator b[1][0] to give us the first character  of the middle name.

Note: Characters of strings can be accessed using subscript operator too.

You might be interested in
Which of the following terms refers to the horizontal line of continuous cells in a table?
vova2212 [387]

I believe it's a Row and A Intersection, though I'm not completely sure.

3 0
4 years ago
Read 2 more answers
Sftp uses which mechanism to provide security for authentication and data transfer?
12345 [234]

Sftp uses SSH mechanism to provide security for authentication and data transfer.

<h3>What are SSH known for?</h3>

SSH or Secure Shell is known to be a kind of a network communication protocol that helps two computers to be able to communicate and also  share their data.

Therefore, one can say that Sftp uses SSH mechanism to provide security for authentication and data transfer.

Learn more about  SSH mechanism from

brainly.com/question/13086077

#SPJ12

3 0
3 years ago
Define binary number and decimal number with example​
photoshop1234 [79]

Answer:

The Decimal Number System is a number system for which every real number x can be written in terms of the ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 as the sum of powers of 10. A number in the decimal number system is said to be of base 10 and to specify this we attach a subscript 10 to x, written (x)10.

The Binary Number System is a number system for which every real number x can be written in terms of the two digits 0 and 1 as the sum of powers of 2. A number written in the binary number system is said to be of base 2, and to specify this we attach a subscript 2 to x, written (x)2.

4 0
3 years ago
_______ can be used more than once.
torisob [31]
EPROMS, (sorry for late answer)

5 0
3 years ago
WILL MARK BRAINLIEST FOR ANYONES ANSWER!
Anvisha [2.4K]

Answer:

just know that bit gonna be running when I make mine Imma have 720 fps btw today sponsored is nord VPN

4 0
3 years ago
Other questions:
  • The bluecross blueshield federal employee program (fep) is a(n) __________ health benefits program established by an act of cong
    8·1 answer
  • Use the SAS dataset insure to create a dataset, work.insure10, that (a) only reads in the variables Name, Policy, Company, PctIn
    9·1 answer
  • You are using a wireless client adapter with a site survey utility and a notebook computer to perform a manual site survey in a
    7·1 answer
  • Which quality is likely to ensure consistent career growth in the computer field?
    9·2 answers
  • What is a systems development life cycle?
    5·1 answer
  • Use the drop-down menus to complete each sentence about the layers of the atmosphere.
    14·2 answers
  • Ayuda necesito 7 objetos que se utilizan en la vida diaria
    8·1 answer
  • A router periodically goes offline. Once it goes offline, you find that a simple reboot puts the router back online. After doing
    12·1 answer
  • Staff in several departments interact with the order processing system and will be affected by any
    9·1 answer
  • This seems like a good time to ask the basic question, “How’s it going in class?” Feel free to offer constructive feedback about
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!