You are viewing a single comment's thread. Return to all comments →
from itertools import combinations if __name__ == '__main__': length,l1,K = int(input()),input().split(),int(input()) list_combos = list(combinations(l1, K)) counter1 = 0 for comb in list_combos: if 'a' in comb: counter1 += 1 print(counter1 / len(list_combos))
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 →