PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#created by me with the help of Lisa
import re
numbers =input("Enter :")
calc=re.findall(r"[^\w\d]",numbers)[0]
lst=[int(i) for i in re.findall(r"[\d]+",numbers )]
print(lst)
total=lst[0] #setting the first value if input
lst=iter(lst)
next(lst) #skiping first iteration
for num in lst:
if calc=="+" :
total+=num
elif calc =="-":
total-=num
elif calc =="/":
try:
total=total/num
except ZeroDivisionError:
print("Warning : You are dividing with zeros !")
exit()
elif calc=="*":
total*=num
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run