Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The file fruits.csv contains names of fruits, and their prices, in the format specified in this example: banana;6.50 apple;4.95 orange;8.0 ...etc... Please write a function
The file fruits.csv contains names of fruits, and their prices, in the format specified in this example:
banana;6.50 apple;4.95 orange;8.0 ...etc...
Please write a function named read_fruits, which reads the file and returns a dictionary based on the contents. In the dictionary, the name of the fruit should be the key, and the value should be its price. Prices should be of type float.
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