Permutation and combination 4 letter

L=[]

c=0

for i in range(4):

    L.append(input('Enter the characters-'))    

for i in L:

    for j in L:

        for k in L:

            for m in L:

                if i!=j and i!=k and i!=m and j!=k and j!=m and k!=m :

                    print(i,j,k,m)

                    c=c+1

print(c)                    

Comments

  1. well, create a code that just not only takes 4 letters but take n letters
    The n is an input from user

    ReplyDelete

Post a Comment