Re: big letter -> small letter

Discussion in 'Python' started by Andrew McNamara, Jul 6, 2004.

  1. Andrew McNamara, Jul 6, 2004
    #1
    1. Advertisements

  2. 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
    >
     
    =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=, Jul 6, 2004
    #2
    1. Advertisements

  3. 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
     
    Scott David Daniels, Jul 6, 2004
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    11
    Views:
    1,008
    Roedy Green
    Sep 18, 2005
  2. vertigo

    big letter -> small letter

    vertigo, Jul 6, 2004, in forum: Python
    Replies:
    4
    Views:
    1,067
    Reinhold Birkenfeld
    Jul 6, 2004
  3. Replies:
    5
    Views:
    661
    Stephen Sprunk
    Aug 31, 2006
  4. Replies:
    2
    Views:
    462
    Larry I Smith
    Jun 21, 2005
  5. Shaguf
    Replies:
    0
    Views:
    797
    Shaguf
    Dec 24, 2008
  6. Shaguf
    Replies:
    0
    Views:
    688
    Shaguf
    Dec 26, 2008
  7. Shaguf
    Replies:
    0
    Views:
    438
    Shaguf
    Dec 26, 2008
  8. Shaguf
    Replies:
    0
    Views:
    442
    Shaguf
    Dec 24, 2008
Loading...