Q:

How to convert ASCII values from a string of strings

Is it possible to convert a string of ASCII characters from a list of strings:
[['You '], ['have '], ['made '], ['my '], ['day.']]
I understand that the conversion is done using ord(i) as explained here. I just can't seem to figure out how to retain the list of list structure after the conversion that reads something like this:
[[ 1, 2, 3 ], [ 1, 2, 3, 4 ], etc. ]
Thank you!

A:

use list comprehension or maps to traverse into the inner elements and apply the ord function:
example:
# python 3 (py2 syntax slightly different)
x = [['You '], ['have '], ['made '], ['my '], ['day.']]
[list(map(ord, i[0])) for i in x]
# outputs
Out[41]:
[[89, 111, 117, 32],
 [104, 97, 118, 101, 32],
 [109, 97, 100, 101, 32],
 [109, 121, 32],
 [100, 97, 121, 46]]

