Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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