The Python 3 code for the program described in the question:
def sum_digits(str):
sum = 0
for c in str:
sum += int(c)
return sum
def main():
print("Enter series of single-digit numbers with no spaces: ")
str = input()
print("The sum of digits of the entered number is", sum_digits(str))
main()
What’s the question?
Always remember to add any reasonable information for someone to help or answer!!
Have a good rest of your day.