Python: Compute the digit number of sum of two given integers
Sum Digit Count
Write a Python program to compute the digit number of the sum of two given integers.
Input:
Each test case consists of two non-negative integers x and y which are separated by a space in a line.
0 ≤ x, y ≤ 1,000,000
Visual Presentation:

Sample Solution:
Python Code:
Sample Output:
Input two integers(a b): 5 7 Number of digit of a and b.: 2
Explanation:
Here is the breakdown of the above Python exercise:
- Print Statement: Prompts the user to input two integers.
- Input Processing: Takes user input, expecting two space-separated integers, and converts them to integers.
- Print Statement: Indicates that it will print the number of digits in the sum of a and b.
- Calculating and Printing Digits: Converts the sum of a and b to a string, then calculates and prints the length (number of digits) of the resulting string.
Flowchart:

For more Practice: Solve these Related Problems:
- Write a Python program to compute the number of digits in the product of two integers.
- Write a Python program to determine the difference in digit counts between the sum and product of two numbers.
- Write a Python program to iteratively sum the digits of a number until a single digit remains, and count the number of iterations.
- Write a Python program to find, from a list of number pairs, the pair whose sum produces the maximum digit count.
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a python program to find heights of the top three building in descending order from eight given buildings.
Next: Write a Python program to check whether three given lengths (integers) of three sides form a right triangle. Print "Yes" if the given sides form a right triangle otherwise print "No".
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.