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
In how many ways can the letters of the word APPROXIMATION be arranged?
ZanzabumX [31]

Answer:

2494800

Explanation:

A lot of math and time.

5 0
2 years ago
Which item was key to how Microsoft got its start in the 1970s? a. artificial intelligence b. vacuum tubes c. Altair 8800 d. UNI
tigry1 [53]

Answer:

A??

Explanation:

6 0
3 years ago
What are the factors that influence the selection of access control software and/ or hardware? Discuss all aspects of access con
skelet666 [1.2K]

Answer:

While selecting the access control system (software or hardware), there are many factors that influence it and those factors are campus location, network capabilities, number of users using it, size of campus, the motive for using it, etc.

Explanation:

The access control system is electronic device that needs to be connected to the network for providing security control and authorization to the user to enter into the Campus.  

Access control systems are used to control access into premises or any IT area which is control in two ways either in a physical way or a logical way.

8 0
3 years ago
You can set a ________, which is automatically displayed in a field unless the user enters something different.
Wittaler [7]

Answer:

Place holder

Explanation:

In computer programming, placeholder is a word, character or series of characters that is used to take up the space until the time when the space is actually needed. It is widely used in the sign up or login forms for web and mobile applications. For example, First Name, Last Name etc.

A programmer might have an idea that he will require this number of characters or values but he don't knows what the input will be, that’s why he uses the place holder.

Hope it helps!

6 0
3 years ago
What is the only language a microprocessor can process directly but most programmers almost never write programs in this code?
Phantasy [73]
Assembly language, a.k.a. machine language.
6 0
3 years ago
Other questions:
  • In dt.py, you will implement a basic decision tree classifier for
    5·1 answer
  • IF YOU KNOW THE ANSWER TO THIS PLEASE ANSWER ASAP
    12·1 answer
  • TRUE OR FALSE, databases allow you to search for content on the internet based on certain criteria (PLS ANSWER RIGHT)
    10·2 answers
  • A text-only forum accessed through a bulletin board service (BBS) is known as a _____.
    14·1 answer
  • 1. Which of the following should NOT be in a tagline?
    12·1 answer
  • Choose two browsers and compare their security features.
    5·1 answer
  • What is the name of the function used to open a file in C?
    8·1 answer
  • The most important hardware device for connecting supercomputers over a wide area
    10·1 answer
  • I dont uderstand dis my teacher no helping pls help me i need to understand TEch
    10·1 answer
  • if someone has become very attached to their mobile device and feels anxious if the cannot connect to the internet, what are the
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!