big letter -> small letter

Irmen de Jong irmen at -nospam-remove-this-xs4all.nl
Tue Jul 6 03:17:13 EDT 2004


vertigo wrote:
> Hello
> How can i change big letter to small letter ?
> 
> When i tried char=char+32 i received error that can not add int to sring.

Which is ofcourse, correct behavior. You cannot add numbers to strings.

Use the tolower string method. It even works on strings of length >1:

 >>> print "BiGLeTtEr".lower()
bigletter

There's also an upper().

--Irmen



More information about the Python-list mailing list