How to compare lists
On 09/01/2015 07:08 AM, Jahn wrote:
> How can I save 256 lists, each list has 32 values( hexadecimal numbers)
> How to compare the saved lists with another 256 lists ( that are read online and have the
> same structure as the list one)?
> ( the first list must be saved in the previous step)
Dumb down your problem to something simpler.
saving 2 lists of 2 numbers.
1/ for saving/loading the list, use pickle if *you* will do the saving
*and* the loading (don't load from an untrusted file)
2/ To compare 2 lists, simply use the == operator
In : [[1,2], [1,2]] == [[1,2], [1,3]]
In : [[1,2], [1,2]] == [[1,2], [1,2]]