Created
February 27, 2019 22:58
-
-
Save Gerst20051/682a3ef73d8cbc49882f8662a63efff0 to your computer and use it in GitHub Desktop.
Quiz 3 Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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