How to find the combinations (probability) for a,b,c,d,e
Question: How to find the combinations (probability) for a,b,c,d,e using
python/algorithm ?

Given that the length of string is 5 that is minimum 1 & maximum 5. All the
characters can be once .

Example :

    
    
    a
    b
    c
    d
    e
    ab
    ac
    abcde
    acde 
    etc..
    


Answer: 
    import itertools
    
    mystring = 'abcde'
    for i in range(1,len(mystring)+1):
        for combo in itertools.combinations(mystring, i):
            print(''.join(combo))
    

Output:

    
    
    a
    b
    c
    d
    e
    ab
    ac
    ad
    ae
    bc
    bd
    be
    cd
    ce
    de
    abc
    abd
    abe
    acd
    ace
    ade
    bcd
    bce
    bde
    cde
    abcd
    abce
    abde
    acde
    bcde
    abcde
    

