Skip to content

Commit f912fcd

Browse files
committed
sum of even or add numbers
1 parent a57f4a5 commit f912fcd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

coding_ninjas/sum_of_even_or_add.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sum_of=input()
2+
odd=0
3+
even=0
4+
for i in sum_of:
5+
a=int(i)
6+
if a%2==0 or a==0:
7+
even+=a
8+
else:
9+
odd+=a
10+
11+
print(even,odd)

0 commit comments

Comments
 (0)