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

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem we need to write a Python function that takes a 3digit integer as an input and ... 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!