Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add():
- a = int(input("Enter the first number you'd like to add"))
- b = int(input("Enter the second number you'd like to add"))
- c = a + b
- print(f"The result is {c}!")
- def sub():
- a = int(input("Enter the first number you'd like to subtract"))
- b = int(input("Enter the second number you'd like to subtract"))
- c = a - b
- print(f"The result is {c}!")
- def mult():
- a = int(input("Enter the first number you'd like to multiply"))
- b = int(input("Enter the second number you'd like to multiply"))
- c = a * b
- print(f"The result is {c}!")
- def divis():
- a = int(input("Enter the first number you'd like to divide"))
- b = int(input("Enter the second number you'd like to divide"))
- c = a / b
- print(f"The result is {c}!")
- for i in range(4):
- calc_mode = int(input("Please pick a mode" + "\n"
- "1 is addition\n"
- "2 is subtraction\n"
- "3 is multiplication\n"
- "4 is division\n"))
- if calc_mode == 1:
- add()
- elif calc_mode == 2:
- sub()
- elif calc_mode == 3:
- mult()
- elif calc_mode == 4:
- divis()
- elif i == 3:
- print("Shutting down.")
- else:
- print("You didn't pick a mode, try again.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement