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
Natalka [10]
3 years ago
10

An acronym is a word formed by taking the first letters of the words in a phrase and making a word from them. For example, AGH i

s an acronym for Alumni Guest House. Write a code snippet that allows a user to type in a phrase, and then outputs the acronym for that phrase. Even if the user doesn't enter the words in all caps, the acronym must be returned with all caps. You may find the methods .split(), .upper() and .lower() helpful, but make sure you test what they do!

Computers and Technology
1 answer:
gregori [183]3 years ago
7 0

Answer:

Here is the Python program:

#the method acronym that takes an argument phrase

def acronym(phrases):  

   acronym = ""  #to store acronym of a phrase

#loop to split the input phrase and return its acronym in upper case letters

   for phrase in phrases.split():  

       acronym = acronym + phrase[0].upper()

   return acronym

#main function that takes input phrase from user and display its acronym

def main():

   phrases = input("Enter a phrase: ")

   print("The acronym for your phrase is ",acronym(phrases))

main()

Explanation:

First let me explain the method acronym. This method takes a parameter phrase to return its corresponding acronym. First the phrase is split using split() method which is used to return the list of words in a phrase. For loop is used that will keep splitting the words in the string (phrase) entered by the user.

In this statement: acronym = acronym + phrase[0].upper()  the acronym is computed. phrase[0] means the first character of each word in the phrase which is found out by the split() method is converted to upper case by using upper() function and then stored in acronym variable. Each time the acronym is found and its first character is converted to upper case and added to the acronym variable.

Then the main() function prompts the user to enter a phrase and then calls the acronym function and passed that phrase as parameter to that function. Then the computed acronym for the phrase is printed on the screen.

You might be interested in
A server can be added to Server Manager by which of the following methods?
solmaris [256]
C. Importing a text file.  Server manager is where you can remotely administer your servers. Answer a. isn't true because you don't need a web server running to be remotely managed. b. Isn't true because wscript is old technology and microsoft would most likely use powershell, and DHCP is used to hand out IP addresses.
3 0
3 years ago
Choose the best answer to complete the sentence.
zhuklara [117]

Answer:

the first one is A

the second question is B,C,F

Explanation:edg2020

5 0
4 years ago
In “Plugged In” what is the author's point of view on technology and jobs?
ira [324]
Phones are stop people from being social at where is the answers be
4 0
3 years ago
I NEED HELP RIGHT NOW !!!!!!!!!!!!!!!1
Alex17521 [72]
Are tools used to assist in conveying information during a presentation. When a speaker is verbally addressing an audience it is often necessary to use supplementary equipment and media to clarify the point. [ If the audience is large or the speaker is soft-spoken, a public address system may be employed

hope this help       plz mark brainliest
5 0
3 years ago
Read 2 more answers
Consider the following code segment which makes use of the list deck and the positive integer i: Which of the following could be
ANEK [815]

Answer: A) Steve Andrew Kevin

B) Alex Joe Matt C) Sally Heather Barbie D) Tim Tim Tim

Explanation:

6 0
3 years ago
Other questions:
  • Can the redirection shell metacharacter be used to redirect between a command and another command?
    8·1 answer
  • Jeff is preparing for a presentation on effective communication skills. He has to face an audience of over 50 people. Which stra
    9·2 answers
  • You created a vm and installed windows server 2008 r2 over the network, using pxe boot. when you start the vm, it doesn't attemp
    7·1 answer
  • _______is the equal distribution of visual weight on either side of an imaginary axis through the center of a design. A building
    6·2 answers
  • In a nested repetition structure, one loop, referred to as the ____ loop, is placed entirely within another loop, called the ___
    5·1 answer
  • H&R Block's stated purpose is: to be the leading global consumer tax company bringing tax and related solutions to clients y
    15·1 answer
  • What is a central idea for 3 Despite this lack of precision, Galileo had constructed a wonderful invention. Yet, he considered i
    5·1 answer
  • PLEASE I NEED HELP, WILL MARK BRAINLYEST!!! 50 POINTS!!!
    14·1 answer
  • Explica porque se afirma que la existencia de estaciones cambia las combstumbres y la cultura​
    14·1 answer
  • Practising some questions for board exams for class 12 python,pls help with detailed answer
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!