python : an integer is required (got type str)

You are passing a string value into the chr() function. This should work:

a=list(str(12345))
for q in a:
    print(chr(int(q)))

#The above code will work but this will print out characters, as 1-5
# in the ASCII table are not visible characters.

a = [65,66,67,68,69]
for q in a:
    print(chr(q))

Leave a Comment