Convert string to ASCII value python January 19, 2023 by Tarik You can use a list comprehension: >>> s="hi" >>> [ord(c) for c in s] [104, 105]