I've been trying to solve a problem which asks for a function which returns the question of the title. One example of the output would be the following one:
sum_of_digits_sorted([56, 2131])
returns
[2131, 56]
Since 2+1+3+1
< than 5+6
, the new list would be sorted as we can see in the example.
I have used a code that iterates on the list and also coded a way to sum digits but I dont know how to apply them together
PD: I'm new in this web so I do not know how to attach my programs and that stuff. Thank you!