python convert to char code example

Example 1: python string to list of chars

l = list('abcd')  	        # ['a', 'b', 'c', 'd']
l = map(None, 'abcd')       # ['a', 'b', 'c', 'd']
l = [i for i in 'abcd']	    # ['a', 'b', 'c', 'd']

import re               # importing regular expression module
l = re.findall('.', 'abcd')
print(l)                	# ['a', 'b', 'c', 'd']

Example 2: python convert ascii to char

>>> chr(104)
'h'
>>> chr(97)
'a'
>>> chr(94)
'^'

Example 3: python convert ascii to char

>>> ord('h')
104
>>> ord('a')
97
>>> ord('^')
94

Example 4: int ot char python

print(ord('a'))

#Output
97