Ask Question
11 October, 07:07

python An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose input is a phrase and whose output is an acronym of the input. If a word begins with a lower case letter, don't include that letter in the acronym. Assume there will be at least one upper case letter in the input. Ex: If the input is: Institute of Electrical and Electronics Engineers the output is:

+3
Answers (1)
  1. 11 October, 07:33
    0
    text = input ("enter text: ")

    print (text)

    acronym = ''

    for c in text:

    if c. isupper ():

    acronym + = c

    list (acronym)

    print ('.'. join (acronym))

    Explanation:

    The code above takes an input phrase, an empty string string "acronym" is created to hold the the acronym.

    A FOR loop is used with an IF statement to check if any of the characters begin with an uppercase letter and adds it to the acronym string.

    The acronym string is converted to a list so that each letter can be recombined using a dot (.) and finally the acronym is printed to the screen.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “python An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose input is a phrase and whose ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers