Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

ISBN: 321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

=+employee to take on the international assignment?

Answered: 1 week ago

Question

=+differences in home- and host-country costs of living?

Answered: 1 week ago