View Full Version : tryng to make a python acronym maker
Feb 8, 2008, 11:28 PM
thanks to agbot. i took what you wrote modified it and got what i needed. thanks from a python n00b!
Feb 9, 2008, 12:17 AM
You want to iterate through the result of split():
>>> from string import *
>>> def acro(phrase):
... result = ""
... for word in split(phrase):
... result += word.upper()
... return result
>>> acro("hello python how are you")
I'm a Python newbie so there may be 100 different and better ways to do acronyms, but there's my take at least. :)
Feb 9, 2008, 02:46 AM
I suggest not erasing your original post in case someone ever reads the thread again, that way they can see what people were responding to.