Page 1 of 1

(Sum the digits in an integer using recursion) Write a recursive function that computes the sum of the digits in an inte

Posted: Sun May 15, 2022 8:46 am
by answerhappygod
Sum The Digits In An Integer Using Recursion Write A Recursive Function That Computes The Sum Of The Digits In An Inte 1
Sum The Digits In An Integer Using Recursion Write A Recursive Function That Computes The Sum Of The Digits In An Inte 1 (29.52 KiB) Viewed 62 times
(Sum the digits in an integer using recursion) Write a recursive function that computes the sum of the digits in an integer. Use the following function header: def sumDigits (n): For example, sumDigits (234) returns 9. Write a test program that prompts the user to enter an integer and displays the sum of its digits. Sample Run Enter an integer: 231498 The sum of digits in 231498 is 2 If you get a logical or runtime error, please refer