Home / Expert Answers / Computer Science / python-please-please-ensure-spacing-white-space-and-character-delimiters-are-correct-in-the-output-pa958

(Solved): Python please! Please ensure spacing, white space and character delimiters are correct in the output ...



Python please! Please ensure spacing, white space and character delimiters are correct in the output. There is an example output below showing the spacing and character delimiters. Thank you!

 

Instructions:
Create a Python solution to the following task. Ensure that the solution produces output in exactly the same fo

Instructions: Create a Python solution to the following task. Ensure that the solution produces output in exactly the same format shown in the sample(s) below, including capitalization and whitespace. Task: 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 csvand use its open0 function and reader0 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 \[ \begin{array}{l} \text { \{'key': 'value', 'key': 'value', 'key': 'value' } \\ \text { f'key': 'value', 'key': 'value', 'key': 'value'\} } \end{array} \] Sample Input/Output: If the input is input1.cov then the expected output is \[ \begin{array}{l} \text { \{'a': '100', 'b': '200', 'c': '300'\} } \\ \text { f'bananas': '1.85', 'steak': '19.99', 'cookies': '4.52' } \end{array} \] Alternatively, if the input is input2.cov then the expected output is \[ \begin{array}{l} \{' d ': 400 \text { ', 'e': } 500 \text { ', 'f': } 6600 \text { ' }\} \\ \text { \{'celery': '2.81', 'milk': '4.34', 'bread': '5.63' }\} \\ \end{array} \] Input to program input'.csi Redo \( r y \quad \) Main.py Load default template... 1 ?import csv module and call open(), reader() 2 usolution accepts input identifying name of CSV file (i.e., "input1.csv") 3 Usolution outputs each row of CSV file contents as a dictionary of elements


We have an Answer from Expert

View Expert Answer

Expert Answer


code: import csv #import csv file n = input("Ent

We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe