Answer must be submitted in a python file (.py at the end of the file)
You will ask three questions (1-3 below). Based on the answer from question 3, you will determine to add, subtract, divide or multiply question 1 and 2.
Make sure to cover all four scenarios from question 3.
n1 = float(input("Enter value one? ")) n2 = float(input("Enter value two? ")) choice = int(input("What operation would you like to perform? 1 to add, 2 to subtract, 3 to divide and 4 to multiply: ")) if choice == 1: print(n1 + n2) elif choice == 2: print(n1 - n2) elif choice == 3: print(n1 / n2) elif choice == 4: print(n1 * n2) else: print("Invalid choice!")
Get Answers For Free
Most questions answered within 1 hours.