I'm writing a program in python 3 to convert input string to integers. There is just one problem with the code. That whenever a space comes it prints -64. I've tried editing a code but it prints -64 along with the space. Any advice?
n = input("please enter the text:").lower() print(n) a = [] for i in n: a.append(ord(i)-96) if (ord(i)-96) == -64: a.append(" ") print(a) Thanks
Input: "BatMan is Awesome" Output: [2, 1, 20, 13, 1, 14, -64, ' ', 9, 19, -64, ' ', 1, 23, 5, 19, 15, 13, 5]