"John" <[EMAIL PROTECTED]> writes:

> I just found ord(c), which convert ascii to integer.
>
> Anybody know what the reverse is?

The inverse of "ord" is "chr":

  % python
  Python 2.5 (r25:51908, Jan  5 2007, 00:12:45) 
  [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> ord('i')
  105
  >>> chr(105)
  'i'
  >>>

IIRC, the first use of the names "ord" and "chr" for these functions
appeared in the Basic language in the 1960's ... in case anyone is
interested in this bit of historical trivia.


-- 
 Lloyd Zusman
 [EMAIL PROTECTED]
 God bless you.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to