主页
Python
Python statistics.mode() 方法
demo_ref_stat_mode
运行 ❯
×
更改方向
保存代码
更改主题
# Import statistics Library import statistics # Calculate the mode print(statistics.mode([1, 3, 3, 3, 5, 7, 7, 9])) print(statistics.mode([1, 1, -3, 3, 7, -9])) print(statistics.mode(['red', 'green', 'blue', 'red']))
3
1
red