human
Radix Sort | A function to do counting sort of arr [ ] according to the digit represented by exp ..
The output array elements that will have sorted arr.
initialize count array as 0.
Store count of occurrences in count [ ].
Change count [ i ] so that count [ i ] now contains actual position of this digit in output array.
Build the output array.
Copying the output array to arr [ ] , so that arr now contains sorted numbers.
Method to do Radix Sort.
Find the maximum number to know number of digits.
Do counting sort for every digit . Note that instead of passing digit number , exp is passed . exp is 10 ^ i where i is current digit number.
Driver code.
Function Call"
How can the above be solved in Python?

=====
Give me a code to radix Sort and the other steps required?
assistant
#Here is code to radix Sort and the other steps required.
 def countingSort ( arr , exp1 ) :
	n = len ( arr )
	output = [ 0 ] * ( n )
	count = [ 0 ] * ( 10 )
	for i in range ( 0 , n ) :
		index = ( arr [ i ] / exp1 )
		count [ int ( index % 10 ) ] += 1
	for i in range ( 1 , 10 ) :
		count [ i ] += count [ i - 1 ]
	i = n - 1
	while i >= 0 :
		index = ( arr [ i ] / exp1 )
		output [ count [ int ( index % 10 ) ] - 1 ] = arr [ i ]
		count [ int ( index % 10 ) ] -= 1
		i -= 1
	i = 0
	for i in range ( 0 , len ( arr ) ) :
		arr [ i ] = output [ i ]
def radixSort ( arr ) :
	max1 = max ( arr )
	exp = 1
	while max1 / exp > 0 :
		countingSort ( arr , exp )
		exp *= 10
arr = [ 170 , 45 , 75 , 90 , 802 , 24 , 2 , 66 ]
radixSort ( arr )
for i in range ( len ( arr ) ) :
	print ( arr [ i ] )