python如何找到列表中出现最频繁的数

找到列表中出现最频繁的数

test= [1,2,3,4,2,2,3,1,4,4,4] print(max(set(test),key=test.count)) #-> 4

python有哪些常用库

python常用的库:1.requesuts;2.scrapy;3.pillow;4.twisted;5.numpy;6.matplotlib;7.pygama;8.ipyhton等。

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享