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
Archy [21]
4 years ago
12

Write a function get_initials(the name) that takes a string of a name and returns the initials of the name, in upper case, separ

ated by periods, with an additional period at the end. Input-Output Samples John Q Public J.Q.P. Homer J Simpson H.J.S. Gloria kind of a big deal Tropalogos G.O.O.D. If the argument to the function is the string on the left, then return the string on the right. You don't need to print, since that's the job of wherever the value is returned.
Computers and Technology
1 answer:
spayn [35]4 years ago
3 0

Answer:

Following are the code to this question:

def get_initials(the_name): #defining a method get_initials

   name = the_name.split(" ") #defining name variable that splits value

   val = ''#defining a string variable val  

   for n in name:  #defining loop to convert value into upper case and store first character

       val = val + n[0].upper() + "."  # use val variable to hold value

   return val # return val

print(get_initials("Gloria kind of a big deal Tropalogos"))#call method and print return value

print(get_initials("Homer J Simpson"))#call method and print return value

print(get_initials("John Q Public")) #call method and print return value

Output:

J.Q.P.

H.J.S.

G.K.O.A.B.D.T.

Explanation:

In the given code, the last is incorrect because if we pass the value that is "Gloria kind of a big deal Tropalogos" so, will not give G.O.O.D. instead of that it will return G.K.O.A.B.D.T.  So, the program description can be given as follows:

  • In the given python code, a method "get_initials" is declared, that accepts "the_name" variable as a parameter, inside the method "name" variable is declared, which uses the split method that splits all values.
  • In the next step, a string variable "val"  and for loop is used, in which the "val" variable converts the first character of the string into the upper case and stores its character with "." symbol in "val" variable and return its value.
  • In the last step, the print method is used, that passes the string value and prints its sort value.
You might be interested in
Each high-level language has its own __________, or rules of the language. group of answer choices
il63 [147K]

Each high-level language has its own syntax which is also called rules of the programming language. Therefore, the correct choice is syntax.

High-level languages have a greater level of abstraction from details of the computer. They focus more on the programming logic which is closely associated with human understanding instead of the underlying hardware modules. Each high-level programming language has its own specific set of rules which is known as the syntax of that language.

Syntax of the high-level languages define structure and formation of the statements in the language. In order to write a program in any high-level programming language, proper syntax of that programming language requires to be followed.

If the syntax of the programming language is not followed properly, the compiler will produce errors. In result, required output of the program will not be generated because of the failure of the program execution.

You can learn more about syntax at

brainly.com/question/831003

#SPJ4

5 0
2 years ago
What type of file is MyFile.dll?
vampirchik [111]

Answer:

The answer to this question is given below in the explanation section

Explanation:

A DLL  (Dynamic Link Library ) file is a compiled library that contains a set of procedures and/or drivers that are referenced and executed by a Windows program. It allows multiple programs to access shared functions through common libraries. DLL file has .dll extension at the end of file name.

When a program is launched, links to the necessary .dll files are created. If a static link is created, the .dll files will be in use as long as the program is active. If a dynamic link is created, the .dll files will only be used when needed. Dynamic links help programs use resources, such as memory and hard drive space, more efficiently. These files can be used in more than one program and in multiple programs at the same time. Some .dll files come with windows operating system while others are added as a new program is installed on system.

7 0
3 years ago
Read 2 more answers
What structure in the eye plays a role in accommodation by holding the lens in place?
Neko [114]
<span>The answer is Ciliary body.  It is the </span>structure in the eye that plays a role in accommodation by holding the lens in place.  <span>The </span>ciliary body<span> has 3 </span>functions<span>: 1) accommodation  2) aqueous humor production and resorption                      3) maintenance of the lens zonules for the purpose of securing the lens in place.</span>
7 0
4 years ago
Print numbers 2 to 10 in increments of two.​
Sedaia [141]
In increments of two it should be 2,4,6,8,10
7 0
3 years ago
How do I make my kali Linux faster in my virtual box?
vagabundo [1.1K]
Not sure to be honest
7 0
3 years ago
Other questions:
  • Desktop Management software requires managers to install software such as antivirus updates or application updates on client com
    7·1 answer
  • The design activity key question, "how will this system interact with other systems..." is part of which design activity?​
    7·1 answer
  • What is the default shell in linux called?
    7·1 answer
  • The ____ is the configuration of a system documented at the beginning of the project and consists of all necessary system requir
    8·1 answer
  • Does Android have text-to-voice?
    11·1 answer
  • A common approach of networking multiple computers as opposed to a single computer is? called:
    14·1 answer
  • Which formula is used to measure accuracy?
    7·1 answer
  • John's father specifically asked him to get a magnetic disk from the store in his neighborhood. What should John buy?
    5·1 answer
  • Would you rather be rich and unknown or famous and poor
    9·1 answer
  • Write a new method in the Rectangle class to test if a Point falls within the rectangle. For this exercise, assume that a rectan
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!