Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started