[Tutor] How can I get ASCII of 'a' and '1'?
bhaaluu at gmail.com
Sat Oct 6 19:36:35 CEST 2007
Here's a handy reference file for ASCII.
(See attached file)
b h a a l u u at g m a i l dot c o m
On 10/6/07, Kent Johnson <kent37 at tds.net> wrote:
> $BNSG]91(B wrote:
> > How can I get ASCII for alphabet and number, such as 'a' and '1'. I can get ASCII for character naturally in C but I don't how to in Python.
> You can get the character codes using ord():
> In : ord('a')
> Out: 97
> In : ord('1')
> Out: 49
> The inverse function is chr():
> In : chr(97)
> Out: 'a'
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Tutor