0
MMahendra Kumar
Python Program to Compute Sum of Digits in a String
0 Comments
# take input string = input("Enter any string: ") # find sum of digits sum_digit = 0 for x in string: if x.isdigit(): sum_digit += int(x) # display result print("Sum of digits =", sum_digit)