I am given a .txt file of data:

```
1,2,3,0,0
1,0,4,5,0
1,1,1,1,1
3,4,5,6,0
1,0,1,0,3
3,3,4,0,0

```

My objective is to calculate the min,max,avg,range,median of the **columns** of given data and write it to an output .txt file.

My logic in approaching this question is as follows

Step 1) Read the data

```
infile = open("Data.txt", "r")
tempLine = infile.readline()
while tempLine:
   print(tempLine.split(','))
   tempLine = infile.readline()

```

Obviously it's not perfect but the idea is that the data can be read by this...

Step 2) Store the data into corresponding list variables? row1, row2,... row6 

Step 3) Combine above lists all into one, giving a final list like this...

```
flist =[[1,2,3,0,0],[1,0,4,5,0],[1,1,1,1,1],[3,4,5,6,0],[1,0,1,0,3],[3,3,4,0,0]]

```

Step 4) Using nested for loop, access elements individually and store them into list variables 

`col1, col2, col3, ... , col5`

Step 5) Calculate min, max etc and write to output file

My question is, with my rather beginner knowledge of computer science and python, is this logic inefficient, and could there possibly be an easier, and better logic towards solving this problem? 

My main problem is probably steps 2 through 5. The rest I know how to do for sure.

Any advice would be helpful!