题解 | #中彩票的的概率#
中彩票的的概率
https://www.nowcoder.com/practice/531e409e1b564cfbbb275c6a8d3a4b45
import math num_list = list(map(int, input().split())) odd = list(map(float, input().split())) niu_list = list(map(int, input().split())) cp_dict = {} for key, value in zip(num_list, odd): cp_dict[key] = value out = [cp_dict[i] for i in niu_list if i in cp_dict.keys()] print("{:.3f}".format(math.prod(out)))