Hello, please write the following code in Python: Write a function orderPizza that allows the user input to build a pizza. It then prints a thank you message, the cost of the pizza and then returns the Pizza that was built. >>> orderPizza() Welcome to Python Pizza! What size pizza would you like (S,M,L): M Type topping to add (or Enter to quit): mushroom Type topping to add (or Enter to quit): onion Type topping to add (or Enter to quit): garlic Type topping to add (or Enter to quit): Thanks for ordering! Your pizza costs $14.299999999999999 Pizza('M',{'mushroom', 'onion', 'garlic'}) >>> orderPizza() Welcome to Python Pizza! What size pizza would you like (S,M,L): L Type topping to add (or Enter to quit): calamari Type topping to add (or Enter to quit): garlic Type topping to add (or Enter to quit): Thanks for ordering! Your pizza costs $16.65 Pizza('L',{'garlic', 'calamari'}) >>> p=orderPizza() Welcome to Python Pizza! What size pizza would you like (S,M,L): S Type topping to add (or Enter to quit): Thanks for ordering! Your pizza costs $6.25 >>> p Pizza('S',set())
Hello, please write the following code in Python:
- Write a function orderPizza that allows the user input to build a pizza. It then prints a thank you message, the cost of the pizza and then returns the Pizza that was built.
>>> orderPizza()
Welcome to Python Pizza!
What size pizza would you like (S,M,L): M
Type topping to add (or Enter to quit): mushroom
Type topping to add (or Enter to quit): onion
Type topping to add (or Enter to quit): garlic
Type topping to add (or Enter to quit):
Thanks for ordering!
Your pizza costs $14.299999999999999
Pizza('M',{'mushroom', 'onion', 'garlic'})
>>> orderPizza()
Welcome to Python Pizza!
What size pizza would you like (S,M,L): L
Type topping to add (or Enter to quit): calamari
Type topping to add (or Enter to quit): garlic
Type topping to add (or Enter to quit):
Thanks for ordering!
Your pizza costs $16.65
Pizza('L',{'garlic', 'calamari'})
>>> p=orderPizza()
Welcome to Python Pizza!
What size pizza would you like (S,M,L): S
Type topping to add (or Enter to quit):
Thanks for ordering!
Your pizza costs $6.25
>>> p
Pizza('S',set())
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images