Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a solution that accepts an input identifying the name of a CSV file, for example, input1.csv. Each file contains two rows of comma-separated values.

Create a solution that accepts an input identifying the name of a CSV file, for example, "input1.csv". Each file contains two rows of comma-separated values. Import the built-in module csv and use its open() function and reader() method to create a dictionary of key:value pairs for each row of comma-separated values in the specified file. Output the file contents as two dictionaries.

The solution output should be in the format

{'key': 'value', 'key': 'value', 'key': 'value'} {'key': 'value', 'key': 'value', 'key': 'value'}

Alternatively, if the input is

input2.csv 

then the expected output is

{'d': '400', 'e': '500', 'f': '600'} {'celery': '2.81', 'milk': '4.34', 'bread': '5.63'}

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_2

Step: 3

blur-text-image_3

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

Climate And Environmental Database Systems

Authors: Michael Lautenschlager ,Manfred Reinke

1st Edition

1461368332, 978-1461368335

More Books

Students also viewed these Databases questions

Question

Describe new developments in the design of pay structures. page 475

Answered: 1 week ago