I have some code that turns a list of intergers into the characters they represent in ascii This all works fine but it prints every character in a new line. I fixed this by adding 'end=''' to the print statement. However, I want this output (a one line string) inside a variable so I can do different things with it. How do I do this?
This is the code with the working print statement:
a = [116, 101, 115, 116, 115, 116, 114, 105, 110, 103]
for x in range(len(a)):
data = (chr(a[x]))
print(data, end='')
I already tried things like rsplit and join but nothing gives the correct outcome.
Thank you for any help you can give me.