How do I convert characters into integers?

Kent Johnson kent3737 at
Wed Dec 15 00:58:04 CET 2004

Markus Zeindl wrote:
> I have got a string from the user, for example "Hi!".
> Now I get every character with a loop:
> <code>
> buffer = ""
> for i in range(len(message)):
>   ch = message[i-1:i]

for ch in message:

is simpler and more idiomatic.


More information about the Python-list mailing list