Accept Three Digits and Print all Possible Combinations from the Digits in python

Share on facebook
Share on twitter
Share on pinterest

In this Basic Python Program, we will have a look at How to “print all the possible combination from the digits” with the help of Python Programming Language.

Python Program To Print All Possible Combinations from the Digits

a=int(input("Enter first number:"))

b=int(input("Enter second number:"))

c=int(input("Enter third number:"))

d=[]

d.append(a)

d.append(b)

d.append(c)

for i in range(0,3):

    for j in range(0,3):

        for k in range(0,3):

            if(i!=j&j!=k&k!=i):

                print(d[i],d[j],d[k])

In the above Python Program we printed all the possible combinations from the digits.

Subscribe to our Newsletter

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Share this post with your friends

Share on facebook
Share on google
Share on twitter
Share on linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *