class Point: shortest_path = [] data = [] for line in open('example_data', 'r'): data_row = [] for ch in line.strip(): data_row.append(ch) data.append(data_row) for row in data: print(row)