Wednesday, June 6, 2012

Python: convert char to int


>>> ord('a')
97
>>> chr(97)
'a'
>>> chr(ord('a') + 3)
'd'
>>>

No comments:

Post a Comment