Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 0
- s = '+'
- m = 0
- for x in input().split():
- if x in ('+', '-', '/', '*'):
- s = x
- else:
- m = int(x)
- if s == '+':
- n = n + m
- if s == '-':
- n = n - m
- if s == '*':
- n = n * m
- if s == '/':
- if m != 0:
- n = n / m
- if s == '=':
- print(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement