Question: Python 3.6 Write a program, makeD(ifile) , which takes a file as input and outputs a list consisting of lists pairing values in row n

Python 3.6 Write a program, makeD(ifile), which takes a file as input and outputs a list consisting of lists pairing values in row n with its corresponding column value in row n+1. The program uses a try/except to check for file not found. If the file is not found, you will return a [-1] (-1 in a list). You are required to check for an empty file as well in which case you will return a [-2] (-2 in a list). 

Python 3.6 Write a program, makeD(ifile), which takes a file as input

MixedAlpha.txt

a z b y 1 26 2 25 c x d w 3 24 4 23 e v f u 5 22 6 21 g t h s 7 20 8 19 i r j q 9 18 10 17 k p l o 11 16 12 15 m n 13 14

makeD nosuchfile.txt") make [-1] make D ("empty txt") 2] make D ("small Mixed. txt 100 'a' 199 'b' 10 c' 22 'd'], ['99', 'fg'], ['88', 'hi' 77 jk 66 lm' make D ("mixed Alpha .txt") r 'a' I' 26 'z'], ['2', 'b'], ['3', c' 24 'x' J, ['4', 'd'], ['5', 22 v' 20 8 h' i' C' 18 'r' 10 j I' 11 'k' I' 16 'p' '12 'l' 13 'm

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!