Question: Write a function called sum.digits ) that takes a single argument, a positive integer up to five digits long (i.e., between 0 and 99999), and

 Write a function called sum.digits ) that takes a single argument,

Write a function called sum.digits ) that takes a single argument, a positive integer up to five digits long (i.e., between 0 and 99999), and returns its sum. For example, for 5378 the sum is 5 + 3 + 7 + 8 = 23, Your output should look like the following: 1 >>> sum digits (5378) 2 23 >sum digits (1) s >sum digits (11) 7 > 9 >sum digits (11113) sum digits (111) 10 7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!