computing with characters

SL ni at hao.com
Wed Apr 30 04:06:12 EDT 2008


"Arnaud Delobelle" <arnodel at googlemail.com> schreef in bericht 
news:m2d4o7bwmd.fsf at googlemail.com...
> "Gabriel Genellina" <gagsl-py2 at yahoo.com.ar> writes:
>
>> En Wed, 30 Apr 2008 04:19:22 -0300, SL <ni at hao.com> escribió:
>>
>>> "Lutz Horn" <lutz.georg.horn at googlemail.com> schreef in bericht
>>> news:mailman.360.1209537877.12834.python-list at python.org...
>>>>
>>>> So just for completion, the solution is:
>>>>
>>>>>>> chr(ord('a') + 1)
>>>> 'b'
>>>
>>> thanks :) I'm a beginner and I was expecting this to be a member of
>>> string so I couldnt find it anywhere in the docs.
>>
>> And that's a very reasonable place to search; I think chr and ord are
>> builtin functions (and not str methods) just by an historical
>> accident.  (Or is there any other reason? what's wrong with "a".ord()
>> or  str.from_ordinal(65))?
>
>
> Not a reason, but doesn't ord() word with unicode as well?

yes it does, I just read the documentation on it :)


>
> -- 
> Arnaud
> 




More information about the Python-list mailing list