Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __author__ = 'Miguel'
- def addition(a,b):
- return a+b
- def soustraction(a,b):
- return a-b
- def multiplication(a,b):
- return a*b
- def procedure():
- instructions = input()
- instructions = instructions.split()
- for i in range(0, len(instructions), 3):
- a, b, proc = instructions[i:i+3]
- a, b = int(a), int(b)
- if proc == "A":
- print(addition(a, b))
- elif proc == "S":
- print(soustraction(a, b))
- elif proc == "M":
- print(multiplication(a, b))
- if __name__ == "__main__":
- procedure()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement