Question: Create a Python solution that accepts an input identifying the name of a CSV file, for example, input 1 . csv . Each file
Create a Python solution that accepts an input identifying the name of a CSV file, for example, "inputcsv Each file contains two rows of commaseparated values. Import the builtin module csv and use its open function and reader method to create a dictionary of key:value pairs for each row of commaseparated 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'
Sample InputOutput:
If the input is
inputcsv
then the expected output is:
a: b: c:
bananas: 'steak': 'cookies':
Alternatively, if the input is:
inputcsv
then the expected output is:
d: e: f:
celery: 'milk': 'bread':
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
