Advertisement
nanokatka

task3

Jan 31st, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. a=float(input("Enter first number:"))
  2. b=float(input("Enter second number:"))
  3. c=input("Enter operation (+, -, *, /):")
  4. if c=="+":
  5. d=a+b
  6. print("Result:", d)
  7. elif c=="-":
  8. d=a-b
  9. print("Result:", d)
  10. elif c=="*":
  11. d=a*b
  12. print("Result:", d)
  13. elif c=="/":
  14. if b==0:
  15. print("division by zero!")
  16. else:
  17. d=a/b
  18. print("Result:", d)
  19. else:
  20. print("you entered unsupported operation")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement