Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: big letter -> small letter

Reply
Thread Tools

Re: big letter -> small letter

 
 
Andrew McNamara
Guest
Posts: n/a
 
      07-06-2004
>> 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.

>
>>>> 'e'.upper()

>'E'
>>>> 'E'.lower()

>'e'
>>>>


For more string goodness, look at the Library Reference Manual...

http://docs.python.org/lib/string-methods.html

--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
 
Reply With Quote
 
 
 
 
=?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=
Guest
Posts: n/a
 
      07-06-2004

Also yourtsring.lower() will correctly handle accented chars according to
locale, unicode, etc. which is very important !


>>> 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.

>>
>>>>> 'e'.upper()

>> 'E'
>>>>> 'E'.lower()

>> 'e'
>>>>>

>
> For more string goodness, look at the Library Reference Manual...
>
> http://docs.python.org/lib/string-methods.html
>


 
Reply With Quote
 
 
 
 
Scott David Daniels
Guest
Posts: n/a
 
      07-06-2004
Pierre-Frédéric Caillaud wrote:

.... yet another good answer about what you _should_ want to do....
>>>> 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.


Everyone else has given better ways to get the answer you want.
If, however, you are just playing with representations, and
exploring, you might try, for example:

char = 'Q'
print char, chr(ord(char) + 32)

--
-Scott David Daniels

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net 0 12-26-2008 09:29 AM
GIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf ASP .Net Web Controls 0 12-26-2008 06:11 AM
GIDS 2009 Java:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Shaguf Python 0 12-24-2008 07:35 AM
big letter -> small letter vertigo Python 4 07-06-2004 07:23 AM
RE: big letter -> small letter Tony Meyer Python 0 07-06-2004 07:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57