Re: computing with characters



Hi,

2008/4/30 Gary Herron <gherron@xxxxxxxxxxxxxxxxxx>:
SL wrote:
How can I compute with the integer values of characters in python?
Like 'a' + 1 equals 'b' etc

You can get an integer value from a character with the ord() function.

So just for completion, the solution is:

chr(ord('a') + 1)
'b'

Lutz

--
Do you want a Google Mail invitation? Just write me an email!
.