Program to Print all Possible Combinations from the Digits | Python Tutorial | Yes I Can Do

Опубликовано: 22 Май 2026
на канале: Yes I Can Do
7,631
61

#AcceptDigits #Printpossiblecombination #printdigits #Yes_I_Can_Do
----------------------------------------------------------------------------------------------------------------------------------------
Python Program to accept three distinct digits and prints all possible combinations from the digits. The program output is also shown below.

Program Explanation
1. User must enter the first, second and third number.
2. All the elements are appending into a list for the ease of comparison.
3. The for loops range from 0-2 which are basically the indexes of the three elements in the list.
4. If none of the indexes are equal to each other, the element associated with the particular element in the list is printed.

Runtime Test Cases

Case 1:
Enter first number:1
Enter second number:2
Enter third number:3
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1

----------------------------------------------------------------------------------------------------------------------------------------
#pythonlearning #pythoncode #python3 #coder #learntocode #Tutorial #pythonprogramming #printallcombinations