python get ascii code from string code example
Example 1: python ascii
>>> ord('a')
97
>>> chr(97)
'a'
>>> chr(ord('a') + 3)
'd'
>>>
Example 2: string to ascii value python
>>> s = 'hi'
>>> [ord(c) for c in s]
[104, 105]
>>> ord('a')
97
>>> chr(97)
'a'
>>> chr(ord('a') + 3)
'd'
>>>
>>> s = 'hi'
>>> [ord(c) for c in s]
[104, 105]