What your Python program should do In the main part of your code outside of the functions You need to create this code. Ask the user to type in an order in this format (without the square brackets): [table number]&[the name of the dish]$[c, g, s, or p] The number is the table number. This is followed by an ampersand ‘&’. Next is the name of the dish. This is followed by a dollar sign ‘$’. At the end is c, g, s, or p, in lowercase. This denotes which chef will receive the order. ‘c’ means that the order will go to the cold bar (salads, appetizers). ‘g’ means that it will go to the grill. ‘s’ means that it will go to the saute station. ‘p’ means that it will go to the pastry chef. For example: 3&creme brulee$p This means table number 3, the dish is called ‘creme brulee’, and it is going to the pastry chef. The user will type all of this on one line with no spaces except for in the dish name. Store this order into a list. Let the user keep typing in orders. Store all orders in the same list. The user stops entering orders by typing in ‘x’ without quotes. Once you have all of the orders, access each order in the list and send it to a function called profrich() that takes in the order as a parameter. Send each order to a function called profrich(order) You need to create the code for this function. The function definition and the parameter is given to you in the starter code. Do not change the name of this function. The function separates out the various components of the order: table number, dish name, and which chef it is going to. You need to send these three components to another function that will return a string. Send these three components to a function called printout(table, dish, chef) You need to create the code for this function. The function definition and the parameter is given to you in the starter code. Do not change the name of this function. The output of this function is a string with the order details that is nicely formatted so the chef can easily read it. First, add “T“, the table number, and a space to the string. Next, process the dish name. Add the dish name to the string. If the length of the dish name is 10 characters or fewer, add the text “easy” to the string to let the chef know it’s an easy dish to cook. If the length of the dish name is more than 10 characters, add the text “RUSH” to the string to let the chef know they’re going to have to cook quickly to get the dish out on time. Finally, look at the last letter in the order. If it is ‘c’, add ‘cold’ to the string. If it is ‘g’, add ‘grill’ to the string. If it is ‘s’, add ‘saute’ to the string. If it is ‘p’, add ‘pastry’ to the string. Include spaces in the string like in normal writing. Using our example from above, the order “3&creme brulee$p” would result in a string: T3 creme brulee RUSH pastry Return this string back to profrich(). Back inside profrich() You need to continue creating the code for this function. Store the string returned from printout(). Print it for the user. profrich() does not need to return anything. Back inside the main part of your program This kicks the program back down to the main part (outside of the functions) where your code should automatically pull the next order from the list and send it to profrich(). You need to create this functionality. Once you’ve processed all the orders, your program can end and show a funny message to the wait staff (e.g., your TA).
What your Python program should do
In the main part of your code outside of the functions
You need to create this code.
Ask the user to type in an order in this format (without the square brackets):
[table number]&[the name of the dish]$[c, g, s, or p]
The number is the table number. This is followed by an ampersand ‘&’.
Next is the name of the dish.
This is followed by a dollar sign ‘$’.
At the end is c, g, s, or p, in lowercase. This denotes which chef will receive the order. ‘c’ means that the order will go to the cold bar (salads, appetizers). ‘g’ means that it will go to the grill. ‘s’ means that it will go to the saute station. ‘p’ means that it will go to the pastry chef.
For example:
3&creme brulee$p
This means table number 3, the dish is called ‘creme brulee’, and it is going to the pastry chef.
The user will type all of this on one line with no spaces except for in the dish name.
Store this order into a list.
Let the user keep typing in orders. Store all orders in the same list. The user stops entering orders by typing in ‘x’ without quotes.
Once you have all of the orders, access each order in the list and send it to a function called profrich() that takes in the order as a parameter.
Send each order to a function called profrich(order)
You need to create the code for this function. The function definition and the parameter is given to you in the starter code. Do not change the name of this function.
The function separates out the various components of the order: table number, dish name, and which chef it is going to.
You need to send these three components to another function that will return a string.
Send these three components to a function called printout(table, dish, chef)
You need to create the code for this function. The function definition and the parameter is given to you in the starter code. Do not change the name of this function.
The output of this function is a string with the order details that is nicely formatted so the chef can easily read it.
First, add “T“, the table number, and a space to the string.
Next, process the dish name. Add the dish name to the string.
- If the length of the dish name is 10 characters or fewer, add the text “easy” to the string to let the chef know it’s an easy dish to cook.
- If the length of the dish name is more than 10 characters, add the text “RUSH” to the string to let the chef know they’re going to have to cook quickly to get the dish out on time.
Finally, look at the last letter in the order. If it is ‘c’, add ‘cold’ to the string. If it is ‘g’, add ‘grill’ to the string. If it is ‘s’, add ‘saute’ to the string. If it is ‘p’, add ‘pastry’ to the string.
Include spaces in the string like in normal writing.
Using our example from above, the order “3&creme brulee$p” would result in a string:
T3 creme brulee RUSH pastry
Return this string back to profrich().
Back inside profrich()
You need to continue creating the code for this function.
Store the string returned from printout(). Print it for the user.
profrich() does not need to return anything.
Back inside the main part of your program
This kicks the program back down to the main part (outside of the functions) where your code should automatically pull the next order from the list and send it to profrich(). You need to create this functionality.
Once you’ve processed all the orders, your program can end and show a funny message to the wait staff (e.g., your TA).
note by me = I sennt an output of what it should look like
![Here is my input and output. Your TA may choose different dish names and enter tables in a different
order. This shouldn't matter if your program is designed correctly.
HELLO AMAZING MARIA'S KITCHEN WAIT STAFF
Enter orders one at a time or x to quit
Order: 2&steak$g
Order: 1&salad$c
Order:
Order: 3&xiao long bao$s
Order: x
456&chuuuuuuuuuuuuuuurros$p
Here are the orders for each chef:
T2 steak easy grill
T1 salad easy cold
T456 chuuuuuuuuuuuuuuurros RUSH pastry
T3 xiao long bao RUSH saute
Hey TA, what is a skeleton's favorite meal? Spare ribs! :D](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F309a0b45-81e4-45d0-8860-fe87ea651e15%2F6aaf92aa-4a7a-424e-9272-38f8b908524d%2Fr9tdrdm_processed.png&w=3840&q=75)
![main.py x +
23 ▼
24
25 ▼
26
if chef == 'S':
output output + "saute"
if chef == 'p':
output = output + "pastry"
return output
27
28
29 while order != 'X':
30
31
32
33 for order in orders:
34
35
36
37
38
39
40
41
42
43
Line 28: Col 5
orders.append(order)
order = input ('Order: ')
orde = order.split('&')
table orde[0]
ordd = orde[1].split('$¹)
ordered ordd[0]
chefordd [1]
order = [table, ordered, chef]
profrich(order)
> Console x +
HELLO WELCOME TO MARIA'S KITCHEN WAIT STAFF. Enter orders one at a time or x to quit
Order: 1&steak$g
Order: x
Traceback (most recent call last):
File "main.py", line 33, in <module>
orde = order.split('&')
AttributeError: 'list' object has no attribute 'split'
KeyboardInterrupt
⠀
History C](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F309a0b45-81e4-45d0-8860-fe87ea651e15%2F6aaf92aa-4a7a-424e-9272-38f8b908524d%2Fvqbwpk4_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
its still saying list object has no attritube split
![**Title: Error Handling in Python: Common Mistakes and Debugging Techniques**
**Introduction:**
In this example, we explore a common error encountered in Python programming when manipulating strings and lists. This error occurs in a simple program designed for order handling in a restaurant setting.
**Code Snippet:**
```
HELLO! WELCOME TO MARIA'S KITCHEN WAIT STAFF. Enter orders one at a time or x to quit
Order: 6st4ks9
Traceback (most recent call last):
File "main.py", line 37, in <module>
order = order.split('s')
AttributeError: 'list' object has no attribute 'split'
```
**Explanation:**
The program asks wait staff to enter orders one at a time, with an option to quit by entering "x". However, there's an error that prevents further progress in the code:
1. **Input and Error:**
- The input given is "6st4ks9".
- The program encounters an error at `order.split('s')`.
2. **Traceback Analysis:**
- The error message, `AttributeError: 'list' object has no attribute 'split'`, occurs because the program attempts to use the `split()` method, which is only applicable to strings, on a list object.
**Debugging Tips:**
- **Check Variable Types:**
Ensure that the variable `order` is a string before applying string methods like `split()`. You can use `type(order)` to confirm its data type.
- **Code Correction:**
If the intention is to split a string in the list, ensure the proper element is selected. For instance, convert `order` from list to string first, if applicable.
- **Initialize Correctly:**
Double-check the initial assignment of `order` and avoid overwriting it unexpectedly with a list.
By understanding the traceback information and checking the data types involved, similar issues can be efficiently resolved in Python programming.](https://content.bartleby.com/qna-images/question/309a0b45-81e4-45d0-8860-fe87ea651e15/f7a2d9fb-4da3-43eb-ad4f-7f35aede3c63/ec6dpgw_thumbnail.png)
the output is also missing a few things. this is what he output should look like
![**Welcome to Amazing Maria's Kitchen Wait Staff Training**
**Instructions:**
Enter each order one at a time or press 'x' to quit.
**Sample Orders Entered:**
- Order: 2&steak$g
- Order: 1&salad$c
- Order: 456&chuuuuuuuuuuuuuurros$p
- Order: 3&xiao long bao$s
- Order: x
**Chef Assignments:**
- **Chef T2:**
- **Dish:** Steak
- **Preparation:** Easy Grill
- **Chef T1:**
- **Dish:** Salad
- **Preparation:** Easy Cold
- **Chef T456:**
- **Dish:** Churros
- **Preparation:** RUSH Pastry
- **Chef T3:**
- **Dish:** Xiao Long Bao
- **Preparation:** RUSH Saute
**Fun Fact:**
Hey TA, what is a skeleton’s favorite meal? Spare ribs! :D
---
This example demonstrates how to organize and process orders, ensuring the correct preparation method is communicated to each chef.](https://content.bartleby.com/qna-images/question/309a0b45-81e4-45d0-8860-fe87ea651e15/d1b02ce7-8a5c-4c0a-ad0c-a208398ef6d4/4gbrxo_thumbnail.png)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)