We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Iterables and Iterators
Iterables and Iterators
Sort by
recency
|
936 Discussions
|
Please Login in order to post a comment
from itertools import combinations
A = input() B = list(input().split(" ")) C = input()
D = list(combinations(B, int(C)))
count=0 for i in D: if "a" in i: count = count+1
print(count/len(D))
This problem directing the old version documentation of itertools. It should be updated with the new version. https://docs.python.org/3.8/library/itertools.html