On Apr 23, 1:28 am, Dennis Lee Bieber <[email protected]> wrote:
> But what if /I/ want
> "A" + 1
> to return
> "B"
No problem! Python even allows you to create your own functions! I
know, amazing! 8-O
>>> def succ(s):
return chr(ord(s) + 1)
>>> succ('a')
'b'
>>> succ('B')
'C'
>>> succ('Z')
'['
PS: The cases of (s > 255) or (s < 0) will be for the advanced reader
to solve.
--
http://mail.python.org/mailman/listinfo/python-list
