human
Can you provide a code to sort 3 numbers and the other steps required given the following:
Sort 3 numbers | Python3 program to sort an array of size 3.
Insert arr [ 1 ].
Insert arr [ 2 ].
Driver code"
Solution in Python:
assistant
#Here is code to sort 3 numbers and the other steps required.
 def sort3 ( arr ) :
	if ( arr [ 1 ] < arr [ 0 ] ) :
		arr [ 0 ] , arr [ 1 ] = arr [ 1 ] , arr [ 0 ]
	if ( arr [ 2 ] < arr [ 1 ] ) :
		arr [ 1 ] , arr [ 2 ] = arr [ 2 ] , arr [ 1 ]
		if ( arr [ 1 ] < arr [ 0 ] ) :
			arr [ 1 ] , arr [ 0 ] = arr [ 0 ] , arr [ 1 ]
a = [ 10 , 12 , 5 ]
sort3 ( a )
for i in range ( 3 ) :
	print ( a [ i ] , end = " ▁ " )