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
The seven basic parts of a computer are
True [87]
Monitor, keyboard, CPU, mouse, and I believe the USB drive , DVD drive and hardware system
4 0
3 years ago
Read 2 more answers
Imagine that you are a professional white hat hacker, testing a company’s system to make sure they are ready for attacks. What m
liberstina [14]

Answer:

A white hat hacker, or ethical hacker, uses penetration testing techniques to test an organization's information technology

Explanation:

3 0
2 years ago
1. Write a generic method that compares its 2 arguments using the equals method and returns true if they are equal and false oth
Ganezh [65]

Answer:

Explanation:

The following piece of code is written in Java. It creates the method as requested that takes in two generic objects and compares them using the .equals() built in Java method. This method will return True if the objects are identical or False if they are not. A test case is used in the code and the output can be seen in the attached image below.

   public static <T> boolean comparePerez(T a, T b) {

       return a.equals(b);

   }

5 0
3 years ago
Is there apps/ websites like brainly?
Virty [35]

Answer:

Mathpix Snip, Socratic, Microsoft Math Solver....etc.

Explanation:

Hope this helps! :)

6 0
3 years ago
Read 2 more answers
The 16 broad career options developed by the US department of education are called
In-s [12.5K]
The answer is career clusters. 
6 0
3 years ago
Other questions:
  • What is the best way to protect computer equipment from damage caused by electrical spikes?
    9·2 answers
  • A speaker takes a variety of information from the results of a web search, and puts it together in an outline to make up his spe
    8·1 answer
  • The hardware to keep the output data when finished is a
    9·1 answer
  • Select the antonym for given word freedom
    7·2 answers
  • Write smallest to largest: Byte, bit, MB, PB, GB, nibble
    12·2 answers
  • What is said to be the first mechanical calculator​
    7·2 answers
  • IN C++
    13·1 answer
  • Difference between switch and switch lite
    10·1 answer
  • ________ is the use of information technology to support the sharing of content among networks of users.
    14·1 answer
  • Web résumés allow you to include extra graphics and images that you would not include in a traditional résumé. please select the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!