1 Star 0 Fork 0

全宗/exercise-of-python3-2022

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
wf.v2.py 417 Bytes
一键复制 编辑 原始数据 按行查看 历史
全宗 提交于 2022-08-09 19:43 +08:00 . update what's_for_lunch/wf.v2.py.
"""
v2比v1正常,简洁。
"""
import random
menulist = ["泡面","沙县","快餐","炒菜:","烧味"]
print(random.choice(menulist))
"""
而且次数分布也更平均。
以下为测试代码:
"""
# 统计检验分布
print("统计分布:")
menu = random.choices(menulist,k=1000000)
for i in range(len(menulist)):
print(menulist[i]+"次数:",
menu.count(menulist[i]))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/quan-zong/exercise-of-python3-2022.git
git@gitee.com:quan-zong/exercise-of-python3-2022.git
quan-zong
exercise-of-python3-2022
exercise-of-python3-2022
master

搜索帮助