You are viewing a single comment's thread. Return to all comments →
from itertools import combinations n = int(input()) s = list(input().split(" ")) k = int(input()) count = 0 for tup in combinations(s,k): if any(elem == 'a' for elem in tup): count += 1 print(count / len(list(combinations(s,k))))
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 →