How would you convert a string to ASCII values?
For example, \"hi\" would return 104105.
I can individually do ord(\'h\') and ord(\'i\'), but it\'s going to
Here is a pretty concise way to perform the concatenation:
>>> s = "hello world" >>> ''.join(str(ord(c)) for c in s) '10410110810811132119111114108100'
And a sort of fun alternative:
>>> '%d'*len(s) % tuple(map(ord, s)) '10410110810811132119111114108100'