Didn't go through everything, but why do you do:
> for phrase in string.split(phrase):
> acronym = string.upper(phrase[0])
you are iterating with the name of the list? bad juju
try something like
acronym = ""
for word in string.split(phrase):
acronym = acronym + string.upper(word[0])
then the acronym variable will hold the initial letter to every word
Hugo
[EMAIL PROTECTED] wrote:
> Hello
>
> 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
> main()
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tutor maillist - [email protected]
> http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor