首页 > 文章列表 > python如何找到列表中出现最频繁的数

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

Python
210 2023-05-10

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

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等。