You are viewing a single comment's thread. Return to all comments →
from itertools import combinations n= int(input()) letters= input().split() k= int(input()) possibilities = combinations(letters, k) all_= list(possibilities) a_Exists= [] for i in all_: if "a" in i: a_Exists.append(i) print(len(a_Exists)/ len(all_))
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 →