Re: computing with characters



"Gabriel Genellina" <gagsl-py2@xxxxxxxxxxxx> writes:

En Wed, 30 Apr 2008 04:19:22 -0300, SL <ni@xxxxxxx> escribió:

"Lutz Horn" <lutz.georg.horn@xxxxxxxxxxxxxx> schreef in bericht
news:mailman.360.1209537877.12834.python-list@xxxxxxxxxxxxx

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?

--
Arnaud

.



Relevant Pages

  • Re: Controlling Javascript from server side
    ... but five different language implementations here. ... 'true' means that the request must be handled asynchronously. ... There is exactly *no* reason for such a thing here. ... | percent-endoded string). ...
    (comp.lang.javascript)
  • Re: Is that a good design?
    ... I would have been able to reason the first gotcha. ... public string FirstName; ... has a reference architecture that shows the use of patterns. ... Public Shared Function GetUserInstance() As User ...
    (microsoft.public.dotnet.framework)
  • Re: packagemaker script assistance needed.
    ... Is there a reason you're conditionalizing the whole block instead of one ... string will do as you want.) ...
    (comp.sys.mac.programmer.help)
  • Re: Allow Zero Length String Property - 2000 vs 2003
    ... Well, if that was the reason, I believe my second point still stands - ... Web Interfaces do empty strings. ... > "Brendan Reynolds" <brenreyn at indigo dot ie> wrote in message ... >> Are you the same person who posted the 'Allow Zero Length String in MS ...
    (microsoft.public.access.tablesdbdesign)
  • Re: a method to make js have the ability to inherit
    ... but without the implied type-conversion of the string ... that uses the name of a specific constructor. ... programmer has no idea at all what types of object they are ... no reason for ever doing so. ...
    (comp.lang.javascript)