sample = [1,2,3,3,3,4,5,5]
max(set(sample), key=sample.count)
python获取数组中最多的元素(用max函数)
最新推荐文章于 2022-12-21 17:40:45 发布
sample = [1,2,3,3,3,4,5,5]
max(set(sample), key=sample.count)