Advertisement
Parasect

ex2b

Nov 12th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. a = input("firstnum")
  2. b = input("secondnum")
  3. operation = input("op")
  4. if operation == '+':
  5. print(a+b)
  6. elif operation == '*':
  7. print(a*b)
  8. elif operation == '/':
  9. if b == 0:
  10. print("division by 0")
  11. else:
  12. print(a/b)
  13. elif operation == '%':
  14. if b == 0:
  15. print("division by 0")
  16. else:
  17. print(a%b)
  18. else:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement