subject

IN PYTHON PLEASE. 16.5 LAB: Parsing food data
Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate lists, and outputs the available food items in the following format: name (category) -- description

Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character ('\t').

Ex: If the input of the program is:

food. txt
and the contents of food. txt are:

Sandwiches Ham sandwich Classic ham sandwich Available
Sandwiches Chicken salad sandwich Chicken salad sandwich Not available
Sandwiches Cheeseburger Classic cheeseburger Not available
Salads Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available
Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available
Beverages Water 16oz bottled water Available
Beverages Coca-Cola 16oz Coca-Cola Not available
Mexican food Chicken tacos Grilled chicken breast in freshly made tortillas Not available
Mexican food Beef tacos Ground beef in freshly made tortillas Available
Vegetarian Avocado sandwich Sliced avocado with fruity spread Not available
the output of the program is:

Ham sandwich (Sandwiches) -- Classic ham sandwich
Caesar salad (Salads) -- Chunks of romaine heart lettuce dressed with lemon juice
Water (Beverages) -- 16oz bottled water
Beef tacos (Mexican food) -- Ground beef in freshly made tortillas

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:40
Respecting individual differencespre-test active2time remaining48: 47nina is exploring her gender identity and sexual orientationwhich best describes how the role of the media might influence nina during this time in her life? the media would her decide because television shows are always unbiased about gender issues and do notstereotypethe media could make things difficult for her because television sometimes portrays rigid ideas about gender roles.all forms of media will her decide because the media always portrays rigid ideas about gender roles.all forms of media will make things easy for her because the media always portrays open and fair ideas about gender roles.
Answers: 1
question
Computers and Technology, 23.06.2019 10:50
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
Answers: 1
question
Computers and Technology, 25.06.2019 08:30
Which of the following terms is described as β€œthe art and design of using text”? a. typography b. elements of design c. typos d. graphic design
Answers: 1
question
Computers and Technology, 25.06.2019 09:00
Janet has to prepare a presentation on business strategies for work. which guideline should she follow to create an effective presentation? a. use a readable font b. use a multicolored background c. use a small, but stylish font d. include detailed text
Answers: 1
You know the right answer?
IN PYTHON PLEASE. 16.5 LAB: Parsing food data
Given a text file containing the availability...
Questions
question
Mathematics, 27.09.2019 08:50
question
English, 27.09.2019 09:00
question
Mathematics, 27.09.2019 09:00