Question: In-class Exercise #3 # Write a program (in repl.it) called breakfast.py that opens groceries.txt, reads its contents, follow the steps below, then write the output

 In-class Exercise #3 # Write a program (in repl.it) called breakfast.pythat opens groceries.txt, reads its contents, follow the steps below, then write

In-class Exercise #3 # Write a program (in repl.it) called breakfast.py that opens groceries.txt, reads its contents, follow the steps below, then write the output to another file # download groceries.txt from "D2L/Assignments/chapter 8/Breakfast Asg" drop box #upload groceries.txt to repl.it # open the file groceries.txt f1 = #read the file into a string # Find what supermarket has the best price for breakfast #you have to add all breakfast items from each supermarket separately # Write the result to a file called bkfast output.txt "This is the output of my breakfast program;" "The best price is from {market} and costs (total)" # print the same to the console # close both files groceries.txt Bread, Kroger,5.58 Bread, Publix, 6.00 Milk, Kroger, 3.25 Milk, Publix, 3.50 Eggs, Kroger, 4.50 Eggs, Publix, 4.25 Sausage, Kroger, 6.50 Sausage, Publix, 7.50 Ham, Kroger, 9.50 Ham, Publix, 9.50 Butter, Kroger, 5.00 Butter, Publix, 4.99 Juice, Kroger, 3.50 Juice, Publix, 3.75

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!