You are viewing a single comment's thread. Return to all comments →
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))
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 →
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))