Skip to content

Instantly share code, notes, and snippets.

@mbn-code
Created March 18, 2021 10:08
Show Gist options
  • Select an option

  • Save mbn-code/ef3d5df82707f6ca5180a8e15af38791 to your computer and use it in GitHub Desktop.

Select an option

Save mbn-code/ef3d5df82707f6ca5180a8e15af38791 to your computer and use it in GitHub Desktop.
x = int
y = int
math = input("What do you want to do with the calculator: ")
if math.lower() == "add":
num1 = input("Please enter the first number: ")
num2 = input("Please enter the second number: ")
print(int(num1) + int(num2))
if math.lower() == "sub":
num1 = input("Please enter the first number: ")
num2 = input("Please enter the second number: ")
print(int(num1) - int(num2))
if math.lower() == "devide":
num1 = input("Please enter the first number: ")
num2 = input("Please enter the second number: ")
print(int(num1) / int(num2))
if math.lower() == "mul":
num1 = input("Please enter the first number: ")
num2 = input("Please enter the second number: ")
print(int(num1) * int(num2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment