human
Can you provide a Python code to compute the sum of digits of each number of a given list given the following:
Write a function to compute the sum of digits of each number of a given list. Here is a solution in Python:
assistant
#Here is Python code to compute the sum of digits of each number of a given list.
 def sum_of_digits(nums):
    return sum(int(el) for n in nums for el in str(n) if el.isdigit())