Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- z = 1
- while z < 2:
- select = input("Enter:\n"
- "+\n"
- "-\n"
- "*\n"
- "/\n"
- "\n")
- if select == "+" or select == "-" or select == "*" or select == "/":
- z += 1
- def addition():
- a = float(input("a = "))
- b = float(input("b = "))
- c = a + b
- print("The sum is: ", c)
- def subtraction():
- a = float(input("a = "))
- b = float(input("b = "))
- c = a - b
- print("The sum is: ", c)
- def multiplication():
- a = float(input("a = "))
- b = float(input("b = "))
- c = a * b
- print("The sum is: ", c)
- def division():
- a = float(input("a = "))
- b = float(input("b = "))
- c = a / b
- print("The sum is: ", c)
- if select == "+":
- addition()
- elif select == "-":
- subtraction()
- elif select == "*":
- multiplication()
- elif select == "/":
- division()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement