Question: Write a program in Python that given a list of positive integers, return another list where each element corresponds to the sum of the digits

Write a program in Python that given a list of positive integers, return another list where each element corresponds to the sum of the digits of the elements o#f the given list.
#Example:
# input
# alist=[124, 5, 914, 21, 3421]
# output
# sum=[7, 5, 14, 3, 18]

Step by Step Solution

3.25 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem you will write a Python program that processes a list of positive integers cal... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!