I am trying to read a file and check to see that every number is present, all unique. I tried checking the equality of the length of the list and the length of the set. I get this error TypeError: unhashable type: 'list' Do i have to convert the list to something else?
Here is code
def readMatrix(filNam):
matrixList = []
numFile = open(filNam, "r")
lines = numFile.readlines()
for line in lines:
line = line.split()
row = []
for i in line:
row.append(int(i))
matrixList.append(row)
return matrixList
def eachNumPresent(matrix):
if len(matrix) == len(set(matrix)):
return True
else:
return False
if foo: return True; else: return False; write justreturn foo.