Lostsoul Lostsoul - 5 months ago 27
Python Question

Is there a way to see if two lists are the exact same without looping in python?

Say I have:

a = [1, 2, 3]
b = [1, 2, 3]

is there a way to test the lists to see if they are the same, without having to loop through each entry?

Here's what I was thinking..I know to check if two variables are the same I could use:


but it doesn't work because the ID's are different so is there some type of checksum or way that python stores values of the table so I can simply compare two variables?


Doesn't == work?

>>> a = [1, 2, 3]
>>> b = [1, 2, 3]
>>> a == b