def file_reader(file): with open(file,'r') as infile: table = [row for row in infile] return table print(file_reader('file.txt'))