Question: in python code please Task 3a: Summing Digits Write a function called sum.digits that takes a single argument, a positive integer up to five digits

 in python code please Task 3a: Summing Digits Write a function

called sum.digits that takes a single argument, a positive integer up to

in python code please

Task 3a: Summing Digits 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 sum digits (5378) 23 >>> 2 3 sum-digits (1) sum digits (11) sum digits (111) sum digits (11113) 10 Task 3b: If you sum the digits of a number and the result is a multiple of 3, then the original number is a multiple of 3. For large sums, you may have to think a bit before deciding whether a sum is a multiple of 3. To make life easier, you can sum the digits in the sum and see whether it results in a multiple of 3. You can continue to do this until it becomes obvious that the number is a multiple of 3-or not. Write a program that will prompt the user for an integer up to 5 digits long, sum the digits in this number, and display the results. It should then sum the digits in the sum and display the results. Your program should consist of a main function and the sum.digitsfunction. (Hint: Recall how you used divmod () to find the number of dollars, quarters, dimes, nickels, and pennies to make change in your last lab.) The output should be similar to the following 1 Enter an integer up to 5 digits long: 99999 2 Sum of digits in 99999: 45 Sum of digits in 45: 9 1Enter an integer up to 5 digits long: 1234 2 Sum of digits in 1234: 10 3 Sum of digits in 10:1 1 Enter an integer up to 5 digits long:75 2 Sum of digits in 75 12 Sum of digits in 12: 3

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!