python比较两个列表是否相等,本代码演示了 == 和 is两种方法的区别
L1 = [1, ('a', 3)] # same value, unique objects L2 = [1, ('a', 3)] print L1 == L2, L1 is L2 # equivalent?, same object?
python比较两个列表是否相等,本代码演示了 == 和 is两种方法的区别
L1 = [1, ('a', 3)] # same value, unique objects L2 = [1, ('a', 3)] print L1 == L2, L1 is L2 # equivalent?, same object?