human
Write me a code to print number in ascending order which contains 1 , 2 and 3 in their digits given the following:
Print number in ascending order which contains 1 , 2 and 3 in their digits . | convert all numbers to strings.
check if each number in the list has 1 , 2 and 3.
sort all the numbers.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to print number in ascending order which contains 1 , 2 and 3 in their digits .
 def printNumbers ( numbers ) :
	numbers = map ( str , numbers )
	result = [ ]
	for num in numbers :
		if ( '1' in num and '2' in num and '3' in num ) :
			result . append ( num )
	if not result :
		result = [ ' - 1' ]
	return sorted ( result ) ;
numbers = [ 123 , 1232 , 456 , 234 , 32145 ]
result = printNumbers ( numbers )
print ' , ▁ ' . join ( num for num in result )