[Tutor] printing an acronym

andrade1@umbc.edu andrade1 at umbc.edu
Sun Sep 25 01:00:14 CEST 2005


Hello

How could I get the following to print out an acronym for each phrase
entered such as if I entered random access memory it word print out RAM?

import string

def main():


    phrase = (raw_input("Please enter a phrase:"))

    acr1 = string.split(phrase)


    acr2 = string.capwords(phrase)


    acr3 = acr2[0]

    print"",acr3

main()



More information about the Tutor mailing list