Iterables and Iterators

  • + 0 comments

    from itertools import combinations n=int(input()) a=list(input().split()) k=int(input()) b=list(combinations(a,k)) count=sum(1 for x in b if 'a' in x) print(count/len(b))