Convert Letters to Numbers in Python using ord() method
text= "itsmycode"
num_list = []
# iterate each characters in string
# and convert to number using ord()
for c in text:
num_list.append(ord(c) - 96)
# print the converted letters as numbers in list
print("After converting letters to numbers",num_list)
letters = "zjkswa"
numbers = [ord(l) - 96 for l in letters]
print(numbers)