195k views
5 votes
Create a dictionary to store information pizza being ordered. The customer has entered a size of large, with thick crust, and toppings (mushrooms, extra cheese, green peppers, onion, sausage). a. Hint – You’ll want to save your toppings in a list inside your dictionary!

After you create the dictionary, summarize the order with a simple f string that states: "You ordered a pizza with "type of crust" and the following "toppings" (or some variation of this output)

User Alwin Jose
by
7.9k points

1 Answer

0 votes

Final answer:

A dictionary is created to store the size, crust type, and toppings for a large pizza with thick crust and various toppings. An f-string is then used to format and print the order summary.

Step-by-step explanation:

To store information about a pizza order, we can create a dictionary in a programming language such as Python. This dictionary will hold the size, crust type, and toppings of the pizza. Considering the customer's choice, we can set up the dictionary like this:

{
'size': 'large',
'crust': 'thick',
'toppings': ['mushrooms', 'extra cheese', 'green peppers', 'onion', 'sausage']
}

After creating the dictionary, we can use an f-string to print out the order summary:

order_summary = f"You ordered a {pizza_order['size']} {pizza_order['crust']} crust pizza with the following toppings: {', '.join(pizza_order['toppings'])}"
print(order_summary)



By running this code, you would get an output summarizing the pizza order in a friendly and clear manner.

User Mkomitee
by
8.6k points