You are viewing a single comment's thread. Return to all comments →
import itertools size = int(input()) string=list(input().split()) num=int(input()) no_o=0 case=list(itertools.permutations(string,num)) for j in case: if 'a' in j: no_o+=1 no_e=len(case) prob=no_o/no_e print(prob)
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 →