Skip to content

Instantly share code, notes, and snippets.

@danggrianto
Created November 6, 2013 23:38
Show Gist options
  • Select an option

  • Save danggrianto/7346231 to your computer and use it in GitHub Desktop.

Select an option

Save danggrianto/7346231 to your computer and use it in GitHub Desktop.
x = input("Please input your first number : ")
y = input("Please input your second number : ")
print("Menu:")
print("1. Sum")
print("2. Subtract")
print("3. Multiply")
print("4. Divide")
print("5. Remainder of numbers")
print("6. Compare numbers")
print("7. Exit")
choice= ''
while choice== '':
choice = input()
#this use integer instead of string
if choice == 1:
# x and y here you put as string literal so it willl be read as string
# Sum=("x+y")
print(x + y)
elif choice== '2':
Subtract=("x-y")
elif choice== '3':
Multuply=("x*y")
elif choice== '4':
Divide=("x/y")
elif choice== '5':
Remainder=("x%y")
elif choice== '6':
Compare=("x,y")
elif choice== '7':
print(exit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment