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
Identify the end-to-end processes that should appear in the process landscape model.
antoniya [11.8K]

The end-to-end processes that need to appear in the process landscape model  are:

  • Design
  • Plan
  • Services
  • Stores, etc.

<h3>What are the end-to-end processes?</h3>

End-to-end is known to be a term that connote a process that takes a system or service from the start to finish.

Note that it often delivers a full functional solution, and it is one that is without needing to get  anything from a third party.

The process landscape is known to be made up of domain map that tends to captures core processes of industrial firms such as forecast to plan and others.

Hence, The end-to-end processes that need to appear in the process landscape model  are:

  • Design
  • Plan
  • Services
  • Stores, etc.

Learn more about landscape model from

brainly.com/question/7027022

#SPJ1

8 0
2 years ago
The primary key is a field that uniquely and completely identifies a record.
Leokris [45]
True

----------------------------------
6 0
3 years ago
Read 2 more answers
Write a program that will add up the series of numbers: 99, 98, 97… 3, 2, 1. The program should print the running total as well
Elanso [62]

Answer:

a = 99

b = 99

while(a > 0):

    b += a

    print(b)

    a -= 1

Explanation:

4 0
3 years ago
Weber believed that there is an inevitable destructive quality to which one of the four types of action?
weqwewe [10]

Answer:

instrumental-rational                                        

Explanation:

  • A sociologist Max Weber interpreted the effects of Industrial Revolution on social actions. He described the four types of social actions:

                     Traditional Social Action

                      Affective/Affectional Social Action

                     Value Rational Social Action

                  Instrumental-Rational  Social Action

  • Instrumental-rational means to pursue most efficient means to achieve a specific goal.
  • The goals of the actions are also used as a way of achieving certain objectives.
  • So instrumental rational means doing anything it takes to reach a certain goal that does not take into account the consequences of the actions taken to achieve this goal.  
  • For example an organization's goal is to make maximize profit so it will use most effective and economical means to achieve this goal. For example by decreasing workers not considering the affects on the workers of this action.
  • Another example is of a person who wants to gain money. He might rob others or sell drugs etc to get money. A student whose goal is to pass an exam in order to get a degree will give his time to study and might cheat in exam to pass the test.
  • In short any actions can be taken which leads to the achievement of  a certain goal.
  • According to Weber instrumental rationality is destructive because rather than pursuing means and making decisions by taking moral values into consideration, the basic focus is to achieve a goal and make decisions using efficiency not considering moral values.
8 0
3 years ago
When did outdoor air pollution first become a significant problem?
zmey [24]
Out door air pollution has been a problem since ancient Romans...but the industrial revouloution was when outdoor air pollution increased and it a significant problem...
hope this helps
6 0
3 years ago
Other questions:
  • The rod and crankshaft convert the up-and-down motion of the piston into
    12·2 answers
  • A web client is sending a request for a webpage to a web server. from the perspective of the client, what is the correct order o
    14·1 answer
  • Which should you use to find a saved file?
    15·2 answers
  • What is the printout of the call nPrint("a", 4)?
    14·1 answer
  • True or false.the color attribute cannot recognized the hexadecimal code.
    7·2 answers
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • Given coins of denominations (value) 1 = v1 &lt; v2&lt; … &lt; vn, we wish to make change for an amount A using as few coins as
    11·1 answer
  • How does an extranet work?
    15·1 answer
  • From which country samsung is​
    6·2 answers
  • What do you think entertainment or gaming platforms will look like in the future?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!