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
# Created by Ratnapal Shende
# adapted by me to solve an issue with division
# as of question https://www.sololearn.com/Discuss/2652546/?ref=app
import re
numbers =input("Enter :")
calc=re.findall(r"[^\w\d]",numbers)[0]
lst=numbers.split(calc)
print(lst)
total=int(lst[0])
for num in lst[1::]:
if calc=="+" :
total+=int(num)
elif calc =="-":
total-=int(num)
elif calc =="/":
total=int(total)/int(num)
else:
print("sorry for the inconvinience!")
print(total)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run