I've created a basic, multiple choice, interactive calculator in Python. I want the user to be able to have the option to stop the programme running by answering "No" when asked whether they want to test out my calculator.
I want to be able to print("Ok, no problem") which you can see is already there but I need something extra to stop the programme running if this is the answer that the user picks.
Code is below. See lines 12-13.
name = input("Hi There. What is your name? ")
print("Well Hi " + name + ", it sure is nice to meet you")
age = input("So how old are you anyway? ")
print("Wow, you're " + age + " huh? ")
print(name + " I would like you to try out the companies new calculator. Would you be
happy to do that? ")
answer = input("Please answer Yes or No ")
if answer == "Yes":
print("Thank you, I appreciated that. Let's begin")
elif answer == "No":
print("Ok, no problem")
else:
print("Sorry I didn't quite get that. Please answer yes or no")
import math
number_1 = int(input("Please pick a number "))
order = (input("Ok, now please pick either: +, -, / or * "))
number_2 = int(input("Great, now please pick a second number "))
if order == "+":
print(number_1 + number_2)
elif order == "-":
print(number_1 - number_2)
elif order == "/":
print(number_1 / number_2)
elif order == "*":
print(number_1 * number_2)
else:
print("Sorry that is not +, -, / or *. Please enter a relevant order")
Any help that you can give me would be much appreciated.