Question: Write a function in pure python to parse CSV data and return a 2 D array - the output format must match what is expected
Write a function in pure python to parse CSV data and return a D array the output format must match what is expected by the automated test:
def mycsvparsercsvdata, sep:
res
lines csvdata.split
for line in lines:
line line.strip
line line.splitsep
joinline
res.appendline
return res
# input: abce
# expected return: abce
# actual return out: abce
# note the lack of spaces between elements and subarray; and the extra subarray
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
