Every time I try to change data to integers, I get this error
Error invalid literal for int() with base 10: '0,0,1 \n'
data = open("adj_matrix.txt", "r")
list_of_lists = []
for line in data.readlines():
stripped_line = line.strip()
line_list = stripped_line.split()
list_of_lists.append(line_list)
data.close()
print(list_of_lists)
total = sum([int(num) for num in list_of_lists])
print(total)
Text file data:
0,0,1
0,0,1
1,1,0
1,0,0