Re: computing with characters
- From: "Lutz Horn" <lutz.georg.horn@xxxxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 08:44:26 +0200
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:
'b'chr(ord('a') + 1)
Lutz
--
Do you want a Google Mail invitation? Just write me an email!
.
- Follow-Ups:
- Re: computing with characters
- From: SL
- Re: computing with characters
- References:
- computing with characters
- From: SL
- computing with characters
- Prev by Date: Re: Problem with variables assigned to variables???
- Next by Date: Re: simple chemistry in python
- Previous by thread: Re: computing with characters
- Next by thread: Re: computing with characters
- Index(es):