PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import re
numbers =input("Enter :")
calc=re.findall(r"[^\w\d]",numbers)[0]
lst=numbers.split(calc)
print(lst)
total=0
for num in lst:
if calc=="+" :
total+=num
elif calc =="-":
total-=num
elif calc =="/":
total=int(num)/int(num)
else:
print("sorry for the inconvinience!")
print(total)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run