Question: Write a Python function, add_digits, that sums the digits of a 3-digit integer number. Function add_digits should have one parameter, n, a positive integer with
Write a Python function, add_digits, that sums the digits of a 3-digit integer number. Function add_digits should have one parameter, n, a positive integer with 3 digits, and return the sum of the digits of n.
For example,
>>> add_digits(123) 6
>>> add_digits(101) 2
Step by Step Solution
There are 3 Steps involved in it
To solve this problem we need to write a Python function that takes a 3digit integer as an input and ... View full answer
Get step-by-step solutions from verified subject matter experts
