You are viewing a single comment's thread. Return to all comments →
from itertools import combinations _, lst, _indices = (int(input()), input().split(" "), int(input())) _lst = list(combinations(lst, _indices)) freq = sum([ 1 if 'a' in list(item) else 0 for item in _lst]) print(freq/len(_lst))
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 →