You are viewing a single comment's thread. Return to all comments →
from itertools import combinations n = int(input()) s = input().split() k = int(input()) probablity = sum('a' in t for t in combinations(s,k)) / len(tuple(combinations(s,k))) print(f'{probablity:.4f}')
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 →