Skip to content

Instantly share code, notes, and snippets.

@Gerst20051
Created February 27, 2019 22:58
Show Gist options
  • Save Gerst20051/682a3ef73d8cbc49882f8662a63efff0 to your computer and use it in GitHub Desktop.
Save Gerst20051/682a3ef73d8cbc49882f8662a63efff0 to your computer and use it in GitHub Desktop.
Quiz 3 Python
num1 = int(raw_input("Please input first number: "))
num2 = int(raw_input("Please input second number: "))
def multiply():
print "{} multiplied by {} is {}".format(num1, num2, num1 * num2)
def divide():
print "{} divided by {} is {}".format(num1, num2, num1 / num2)
operator = raw_input("Would you like to multiply these numbers, or divide them? : ")
while operator != "multiply" and operator != "divide":
operator = raw_input("Would you like to multiply these numbers, or divide them? : ")
if operator == "multiply":
multiply()
elif operator == "divide":
divide()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment