You are viewing a single comment's thread. Return to all comments →
#final code from itertools import combinations N = int(input()) L = input().split() K = int(input()) count = 0 for i in combinations(L, K): if 'a' in i: count += 1 result= count/len(list(combinations(L, K))) print(f"{result:.3f}")
Seems like cookies are disabled on this browser, please enable them to open this website
Iterables and Iterators
You are viewing a single comment's thread. Return to all comments →