Answer:
def sum_digits(number):
total = 0
if 1 <= number <= 999:
while number > 0:
r = int (number % 10)
total +=r
number /= 10
else:
return -1
return total
print(sum_digits(658))
Explanation:
Write a function named sum_digits that takes one parameter, number
Check if the number is between 1 and 999. If it is, create a while loop that iterates until number is greater than 0. Get the last digit of the number using mudulo and add it to the total. Then, divide the number by 10 to move to the next digit. This process will continue until the number is equal to 0.
If the number is not in the given range, return -1, indicating invalid range.
Call the function and print the result
<span>A document that promises to pay specified sums of money on specified dates and is a debt to the issuer is called a bond</span>
A copy and paste would be fastest and easiest. As you can pinpoint the exact location to where you want the picture to be.
Answer:
1. Understand your audience
2. Add a header
3. Put a face to the name
4. Write a professional headline
5. Be contactable
6. Summarize your story
7. Showcase your experience
8. Let your network speak for you
Hoped this helped