Skip to content

Commit 115dd38

Browse files
authored
Create addition parser.py
1 parent 9845f9e commit 115dd38

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

addition parser.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
calc = input("enter calculation: ")
2+
calc = calc.split("+")
3+
l = len(calc)
4+
print(calc, l)
5+
c = 0
6+
answer = 0
7+
while(c < l):
8+
answer = answer + int(calc[c])
9+
c = c + 1
10+
11+
print(answer)

0 commit comments

Comments
 (0)