I have all the neccesary codes in order to perfom the actions that are neccessary when someone presses the customer or product value.All i am asking is to help me find a way to repeat the question of asking a value as an input if it is not one of the three optons(customers or products or q).
In addition how to repeat the whole procedure until the value that is given is q
And finally how to stop the progrm if it gives the value q.
The program should like this:
Welcome to the Global Grocery, where world leaders do their shopping!
To view sales information for each customer type 'customers'.
To view sales information for each product type 'products'.
To quit type 'q'.
clientsPlease choose 'customers', 'products', or 'q' to quit.
itemsPlease choose 'customers', 'products', or 'q' to quit.
customersbarakobama
----------
cereal: 9.21 crisps: 1.09 potatoes: 2.67 parsley: 0.76 sugar: 1.98vladimirputin
-------------
bread: 0.66 parsley: 1.33 milk: 2.87Please choose 'customers', 'products', or 'q' to quit.
qThank you for visiting, come again!
Until now i only have this:
print("Welcome to the Global Grocery, where world leaders do their shopping!","\n")
print("To view sales information for each customer type \'customers\'.")
print("To view sales information for each product type \'products\'.")
print("To quit type \'q\'.")
data=input("")
while data!="customers" or data!="products" or data!="q":
print("Please choose \'customers\', \'products'', or \'q\' to quit.")
data=input("")
if data=="customers":
elif data="products":
else:
print("Thank you for visiting, come again!")
break