python中collection.Counter and和&的区别

1、collection.Counter输出的是字典,num+value,在数组中数字的种类以及出现的次数

2、and和&的区别

  &, |表示位运算, and,or则依据是否非0来决定输出

  1 & 2  =0

  1 and 2 =2 (两个都是真值,返回最后一个真值)

原文地址:https://www.cnblogs.com/lin-kid/p/11180621.html