小编Ano*_*ypy的帖子

字典中的百分比?

dict1 = {'Milky': ['yes', 'no', 'no', 'yes', 'no'],
         'Chocolate': ['yes', 'no', 'yes', 'yes', 'no']  }  

for j in dict1:
Run Code Online (Sandbox Code Playgroud)

巧克力和乳白色是条件(在实验中)和/ 'yes'或'no'它们是每个试验的反应.

我想计算'yes'乳状态(2 / 5 * 100)和巧克力状态的百分比,但我不知道该怎么做.

python dictionary python-2.7

4
推荐指数
1
解决办法
154
查看次数

标签 统计

dictionary ×1

python ×1

python-2.7 ×1