[Tutor] help getting acronym to print?

Goofball223@wmconnect.com Goofball223 at wmconnect.com
Mon Sep 26 01:25:13 CEST 2005


How could I get the following program to output UDP from the user entering 
user datagram protcol or IP if internet protocla was entered?

currently it only prints out on letter

import string

def main():

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

    acr1 = string.split(phrase)
    print"",acr1 #only using print to see where I am

    acr2 = string.capwords(phrase)
    print"",acr2 #only using print to see where I am
    for phrase in string.split(phrase): 
     acronym = string.upper(phrase[0])
    print "", acronym
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050925/ed2771ba/attachment.htm

More information about the Tutor mailing list