{"id":8237,"date":"2021-06-07T18:08:52","date_gmt":"2021-06-07T12:38:52","guid":{"rendered":"https:\/\/python-programs.com\/?p=8237"},"modified":"2021-11-22T18:38:38","modified_gmt":"2021-11-22T13:08:38","slug":"python-program-to-accept-three-digits-and-print-all-possible-combinations-from-the-digits","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-accept-three-digits-and-print-all-possible-combinations-from-the-digits\/","title":{"rendered":"Python Program to Accept Three Digits and Print all Possible Combinations from the Digits"},"content":{"rendered":"

We will learn how to print all combinations of three different numbers in this python programming lesson. The application will accept three digits from the user \/ we give input as static and print out every possible combination of the three digits.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given three numbers = 1 9 2<\/pre>\n

Output:<\/strong><\/p>\n

1 9 2\r\n1 2 9\r\n9 1 2\r\n9 2 1\r\n2 1 9\r\n2 9 1<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given three numbers = 3 7 5<\/pre>\n

Output:<\/strong><\/p>\n

Enter first digit = 3\r\nEnter second digit = 7\r\nEnter third digit = 5\r\n3 7 5\r\n3 5 7\r\n7 3 5\r\n7 5 3\r\n5 3 7\r\n5 7 3<\/pre>\n

Example3:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given three numbers = 44 389 72<\/pre>\n

Output:<\/strong><\/p>\n

44 389 72\r\n44 72 389\r\n389 44 72\r\n389 72 44\r\n72 44 389\r\n72 389 44<\/pre>\n

Python Program to Print all Possible Combinations of the three Digits<\/h2>\n

There are several methods to print all the possible combinations of the three numbers some of them are:<\/p>\n