题解 | #中彩票的的概率#

中彩票的的概率

https://www.nowcoder.com/practice/531e409e1b564cfbbb275c6a8d3a4b45

num = list(map(int,input().split()))
rate = list(map(float,input().split()))
dic = dict(zip(num,rate))
a,b,c = map(int,input().split())
print('%.3f'%(dic[a]*dic[b]*dic[c]))

利用zip()函数来对num和rate两个列表进行压缩,形成一个字典

#字典的函数操作#
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务