Skip to content

Commit 95e4788

Browse files
authored
Sum of digits in python using for loop
1 parent 052ae3a commit 95e4788

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
number = "123456"
2+
sum = 0
3+
4+
for loop_variable in number:
5+
s += int(loop_variable)
6+
7+
print(s)

0 commit comments

Comments
 (0)