making all letters Caps/Small Letters

Peter Otten __peter__ at web.de
Fri Dec 14 04:46:30 EST 2007


Merrigan wrote:

> I'm sure I have done this before, but cannot remember how, or find out
> how to do it quickly - but is there a way/function/something in python
> to make all the letters of a raw_input() string small/capital letters?

Typing

>>> dir("")

in the interactive interpreter gives you a list of candidates. If you
think that "title" is a good candidate try it with

>>> "alpha BETA".title()
'Alpha Beta'

Probably not what you want, but there are more.

Peter



More information about the Python-list mailing list