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]
3 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]3 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
In a computer spreadsheet, tool used to construct formulas is called *
zubka84 [21]

Formula bar is the tool used to contrust formula

3 0
2 years ago
Briefly explain the conceptual of effective computer based instruction for adults outlining the three units output process and i
Shtirlitz [24]

Based on the research analysis, the concept of effective computer-based instruction for adults is the integration of the key organs of computer-based instruction to deliver desired guidelines for research in CBI for adults.

<h2>The three units output process and input</h2><h3>Output process</h3>
  • External support
  • CBI Design
  • Instructional Strategy design

<h3>Input Process</h3>
  • Self Directedness
  • Computer Self Efficacy
  • Learning Goal Level

Hence, in this case, it is concluded that computer-based instructions can be practical for adult learning.

Learn more about CBI here: brainly.com/question/15697793

4 0
2 years ago
The _____ is the task force formed by the World Wide Web Consortium to set standards on accessibility for web pages.
brilliants [131]

Answer:

Web Accessibility Initiative

Explanation:

This is the group that creates disability standards online.

8 0
2 years ago
Which of the following is an example of new and emerging classes of sofware
malfutka [58]
We need to know what was listed :)!
3 0
2 years ago
How will you find and replace particular text in a document​
blsea [12.9K]

Answer:

Find and replace text

Go to Home > Replace or press Ctrl+H.

Enter the word or phrase you want to locate in the Find box.

Enter your new text in the Replace box.

Select Find Next until you come to the word you want to update.

Choose Replace. To update all instances at once, choose Replace All.

Explanation:

6 0
2 years ago
Other questions:
  • Skylar is viewing her personal and business calendar in a side-by-side fashion, but she would like to view a single calendar tha
    6·1 answer
  • Identify measures to protect your computer against threats from human actions. You cannot access a file in a computer that belon
    10·1 answer
  • How do i build a supercomputer.?
    11·1 answer
  • 1. What is the relationship between liquidity and the interest rates?
    8·1 answer
  • Technology trends in education play a key role in a student’s
    15·1 answer
  • Is a pocket watch consider a computer
    15·1 answer
  • The ______________ shows that you have fully researched the topic and gives you a chance to prove your claim.
    8·1 answer
  • User defined blocks of code can be created in
    13·1 answer
  • Wesley purchased a word-processing software program. He used it for a year, during which he got regular updates every two months
    9·1 answer
  • Film’s importance in today’s economy?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!