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

Given a phrase stored in the variable phrase, write code to construct an acronym made up of the first letter of each word in the

phrase. For example, the phrase 'Portable Network Graphics' would produce the acronym 'PNG'. Store the result in a variable named acronym, ensuring that it is composed of all uppercase letters. Assume that there is no whitespace on either end of the phrase and that one space character separates each word.
this is what I put but its wrong
phrase = input()
acronym = ""
lst = phrase.split()
for x in lst:
if (len(x) > 0):
acronym += x[0]
acronym=acronym.upper()
print(acronym)
Computers and Technology
1 answer:
makkiz [27]3 years ago
3 0

Answer:

Your program is correct; it only lacks proper indentation

See Explanation

Explanation:

The only correction to your question is to rewrite using proper indents.

<em>See below</em>

phrase = input()

acronym = ""

lst = phrase.split()

for x in lst:

       if (len(x) > 0):

               acronym += x[0]

               acronym=acronym.upper()

print(acronym)

<em>Note that:</em>

<em>You make use of indents when you have loop statements like (for) and conditional statements like (if)</em>

You might be interested in
A(n)__________, the heart of an information system, is a collection of all relevant facts organized in a series of integrated fi
max2010maxim [7]

Answer:

database

Explanation:

6 0
3 years ago
Are NOT likely to stop suddenly.
german

Answer:

trains

Explanation:

4 0
3 years ago
The internet is an example of
DochEvi [55]
A large multi user program
6 0
3 years ago
Read 2 more answers
Each device attached to your computer has a special program called a(n ________ that enables the device and operating system to
koban [17]
The answer is Device Driver
8 0
3 years ago
How does join work? a. You write separator.join('a', 'b', 'c', 'd', ...) where 'a', 'b', 'c', 'd' can be replaced with other str
Ulleksa [173]

Answer:

c. You use separator.join(a_list) where a_list is a list of strings.

Explanation:

The join() is an in-built string method which returns a string concatenated with the elements of an iterable. It concatenates each element of an iterable (such as list, string and tuple) to the string and returns the concatenated string.

The syntax of join() is:

string.join(iterable)

From the above syntax, the string usually mean a separator and the iterable will be a string or list or tuple.

The answer is C.

c. You use separator.join(a_list) where a_list is a list of strings.

It is not A because the iterable could be a string. It is not D because the separator is outside not in the bracket.

6 0
3 years ago
Other questions:
  • You can deselect multiple selected sheets beginning with the sheet1 tab by pressing the ____ key and clicking the sheet1 tab.
    15·1 answer
  • The best presentations try to include as much text as possible on each slide. True False
    6·2 answers
  • Your boss asks you to transmit a small file that includes sensitive personnel data to a server on the network. The server is run
    9·1 answer
  • Which of the following statements is NOT true regarding the Security Configuration and Analysis (SCA) tool?
    12·1 answer
  • The older computer had a CPU that ran at 266MHz compared to a current CPU that runs 3.7GHz. How many times faster is the new CPU
    7·1 answer
  • The reader can tell from the Article that __________.
    9·1 answer
  • Which statement best describes one reason why assembly language is easier
    14·1 answer
  • Complete each sentence. To add a graphic to a Word document, start by clicking the tab. Next, click . Then, navigate to the grap
    14·1 answer
  • Alice is watching a speech over the internet. what type of message is alice attending to?
    10·1 answer
  • a) consider the binary number 11010010. what is the base-4 representation of (11010010)2? (there is a way to do this without con
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!