For the next solution, I would add a refusal: "do not do this at home" ...
lst = [18, 8]
map(int, sum(map(lambda x: list(str(x)), lst), [])) #[1, 8, 8]
Explanation :
str(x)converts each integer to a string, then uses the built-in function listto split the string into a list of characters (each of which is a single digit).
sum(..., [])aligns the list, and the latter map(int, ...)converts all "string digits" to integers.
source
share