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
How can I use HTML to express a personal value
Mama L [17]

Answer: Order list

Explanation:

7 0
2 years ago
It creates an SQL statement to find the project that has the most employees from the same department. If more than one project m
NARA [144]

Answer:

Check the explanation

Explanation:

As per requirement submitted above kindly find below solution.

This demonstration is using SQL Server.

Table Names used as

department

project

works_on

SQL query :

select proj_name,dept_name,count(emp_no) as 'most employees ' from

project,department,works_on

where

project.proj_no=works_on. proj_no and

department. dept_no=works_on. dept_no

group by proj_name,dept_name

having count(emp_no)=(

select max(empCount) from (

select proj_name,dept_name,count(emp_no) empCount from project,department,works_on where project. proj_no=works_on. proj_no and department. dept_no=works_on. dept_no

group by proj_name,dept_name) as emp);

6 0
3 years ago
unlike the barcode-based tracking system, a radio frequency identification system offers a .
Over [174]

Unlike the barcode-based tracking system, a radio frequency identification system offers a <u>no-contact, no-line-of-sight reading, and tracking system</u>.

What is a tracking system?

A tracking system often referred to as <u>a locating system, is used to keep </u><u>track </u><u>of people or objects in motion and provide an accurate, timely sequence of location data for processing</u>. Human tracking should be understood; more information is provided below.

<u>Any stolen car can be kept </u><u>track </u><u>of across the nation</u> with the use of a tracking system, ensuring that it is returned as soon as possible. A tracking system is a crucial tool for making sure your personnel is safe.

To learn more about tracking system, use the link given
brainly.com/question/15237193
#SPJ4

8 0
1 year ago
A technician has a client’s laptop that is randomly shutting down. Which of the following is the FIRST step of the troubleshooti
Bad White [126]

Answer:

B

.Identify the problem

6 0
3 years ago
USDA-APHIS Animal Care Resource Policy #12 "Considerations of Alternatives to Painful/Distressful Procedures" states that when a
katrin2010 [14]

Answer:

C. The specific field of study

C. change in anesthetic agent

Explanation:

In the consideration for the procedure, some information are required and examples are the strategy of the search/the database name. However, the area of study is not one of the information.

The animal use proposal can general be altered based on the type of change required. However, an anesthetic agent alteration is not a significant change.

6 0
3 years ago
Other questions:
  • Which of the following is LEAST needed when programming a computer?
    7·1 answer
  • The box plot represents this data set. {16, 16, 16, 18, 18, 20, 24, 28, 30, 34} What value does the letter A represent on the bo
    8·2 answers
  • ____ is the name of a particularly nasty automated program that attacks a network by exploiting Internet Protocol (IP) broadcast
    15·1 answer
  • Write the code that creates a public class named Vehicle that has one private data member. The private data member is an integer
    13·1 answer
  • Complete the function void update (int *a, int *b), which reads two integers as argument, and sets a with the sum of them, and b
    8·1 answer
  • What is variable declaration in java ​
    6·2 answers
  • Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent singl
    12·1 answer
  • How do I delete my brainly account?<br> I don't need anymore.
    13·2 answers
  • The _____ component of a decision support system (DSS) includes mathematical and statistical models that, along with the databas
    14·1 answer
  • Write a program named split_me.py that accepts a string in the format Age.FirstName and returns the value FirstName is Age years
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!