1# Here, first a complex input is used to determine the sum of all the integers in that input.
2
3# Rules : 1
4
5s = input()
6c = ""
7for i in s:
8 if i.isdigit():
9 c += i
10sum_d = sum(int(j) for j in c)
11print(sum_d)
12
13# Rules : 2
14
15s = input()
16c = ""
17sum = 0
18for i in s:
19 if i.isdigit():
20 c += i
21for j in c:
22 sum += int(c)%10
23 c = int(c)//10
24print(sum)
25
26# Sample input: murad#123#$%&*$%!@*34
27# Sample output: 13
28
29
30# Eval method using to problem:
31# Problem name: Python Evaluation
32# Code
33string = eval(input(""))
34print()
35
36# Sample Input: print(2 + 3)
37# Sample Output: 5
38
39
1number = 123 # the number you want to sum the digits of
2
3sum_of_digits = sum(int(digit) for digit in str(number))
4
5print(sum_of_digits)
1number = 123 # the number you want summed up
2sum_of_digits = 0
3for digit in str(number):
4 sum_of_digits += int(digit)
5
6print(sum_of_digits) # printing the final sum of number