Ask Question
13 February, 06:19

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:

+2
Answers (1)
  1. 13 February, 06:54
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers