Question: 42. A file named item_cost, dat is stored on a computer's hard drive. In a text editor the file displays the first few lines of

 42. A file named item_cost, dat is stored on a computer's

42. A file named item_cost, dat is stored on a computer's hard drive. In a text editor the file displays the first few lines of the file below. The rest of the file is not shown. Write a Python program that reads the contents of this file, determines the most expensive item and prints the information about that item and its cost to the screen using the format shown below. Write your code using standard file I/O commands; do not use any csv reader available in some Python package. Do not use any built-in sorting functions. You may assume that all costs are unique (no two items cost the same). Contents of item_cost, dat: Item, Cost (\$) Item1, 3.75 Item2, 3.50 Item3, 2.75 Item 4,4.50 ... Example output: The most expensive item is Item57 and costs \$5.26

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!