Ask Question
20 February, 01:33

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. 20 February, 01: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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers