Question: I need a program that sorts fruits according to their prices (lowest to highest). It reads a list of elements that are dictionnaries in a
I need a program that sorts fruits according to their prices (lowest to highest). It reads a list of elements that are dictionnaries in a file named "fruits.txt", each of those elements have two keys: the name of the fruit and his price. However, it must also present the price of the fruit before his name. So if in the file we have: ( 'Name': 'Apple' , 'Price': 50 ) , ('Name': 'Pear', 'Price': 30) then it must show: (Price: 30 , Name: Pear) , (Price: 50 , Name: Apple)
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
