Newbie question

Michael Hudson mwh at python.net
Mon Mar 11 06:44:12 EST 2002


"Nick" <nick at nick8325.freeserve.co.uk> writes:

> How do you get the ordinal value (ASCII) of a character? For example, to
> make a ROT13 program.

with 2.2:

>>> 'yvxr jr arrq gb obgure jvgu beq()'.encode('rot-13')

Cheers,
M.

-- 
  if-you-need-your-own-xxx.py-you-know-where-to-shove-it<wink>-ly 
  y'rs - tim
              -- Tim Peters dishes out versioning advice on python-dev



More information about the Python-list mailing list