{"id":18468,"date":"2021-08-26T10:39:29","date_gmt":"2021-08-26T05:09:29","guid":{"rendered":"https:\/\/python-programs.com\/?p=18468"},"modified":"2021-11-22T18:37:16","modified_gmt":"2021-11-22T13:07:16","slug":"python-program-to-print-number-in-ascending-order-which-contains-1-2-and-3-in-their-digits","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-print-number-in-ascending-order-which-contains-1-2-and-3-in-their-digits\/","title":{"rendered":"Python Program to Print Number in Ascending Order which contains 1, 2 and 3 in their Digits"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Check if Array can be Sorted with One Swap<\/a>
\nGiven a list and the task is to print the numbers with the digits 1, 2, and 3 in ascending order, which are separated by commas.<\/p>\n

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

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

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

Given List = [67123, 1234, 985, 126, 1011]<\/pre>\n

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

The numbers with the digits 1, 2, and 3 in ascending order, which is separated by commas=  [1234, 67123]<\/pre>\n

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

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

Given List = [75, 4123, 87123, 5312, 9098]<\/pre>\n

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

The numbers with the digits 1, 2, and 3 in ascending order, which is separated by commas= [4123, 5312, 87123]<\/pre>\n

Program to Print Number in Ascending Order which contains 1, 2, and 3 in their Digits in Python<\/h2>\n

Below are the ways to print the numbers with the digits 1, 2, and 3 in ascending order, which is separated by commas.<\/p>\n