lines1 = ['line1', 'line2', 'line3', 'line4']
lines2 = ['line2', 'line1', 'line3', 'line4']
lines3 = ['line1', 'line1', 'line3', 'line4', 'line5']
for lines in [lines1, lines2, lines3]:
    print(lines)
print(hash(frozenset(lines)))
print('')
Инвариантный к порядку хэш в Python