Currently I have a list of strings, lets say:
list1 = [1,2,3,4]
I want to convert this list of numbers into their corresponding letters, using:
output = [chr(ord((str(x+96)))) for x in list1]
When I do this, I get an error saying the program expects a string length of one, but in my code it gives a string length of 3 because of the '' around each number after it is converted into a string. The conversion into a string is necessary because it has to be in the string format in order for ord to work.
So my question to you guys is how can I fix this and/or get rid of these quotes?
In case anyone was wondering, it is supposed to come out as
output = [a,b,c,d]
list1is a list of integers, not a list of strings.awihout quotes is 'some object'. That object is not defined in this particular case. Would you please explain 'why' you want the output to be in the format the way you want it?