human
Sort prime numbers of an array in descending order | Python3 implementation of the approach.
false here indicates that it is not prime.
If prime [ p ] is not changed , then it is a prime.
Update all multiples of p , set them to non - prime.
Function that sorts all the prime numbers from the array in descending.
This vector will contain prime numbers to sort.
If the element is prime.
update the array elements.
Driver code.
print the results ."
Solution in Python:

What is a code to sort prime numbers of an array in descending order and the other steps required?
assistant
#Here is code to sort prime numbers of an array in descending order and the other steps required.
 def SieveOfEratosthenes ( n ) :
	prime [ 1 ] = False
	p = 2
	while p * p <= n :
		if prime [ p ] :
			for i in range ( p * 2 , n + 1 , p ) :
				prime [ i ] = False
		p += 1
def sortPrimes ( arr , n ) :
	SieveOfEratosthenes ( 100005 )
	v = [ ]
	for i in range ( 0 , n ) :
		if prime [ arr [ i ] ] :
			v . append ( arr [ i ] )
	v . sort ( reverse = True )
	j = 0
	for i in range ( 0 , n ) :
		if prime [ arr [ i ] ] :
			arr [ i ] = v [ j ]
			j += 1
	return arr
if __name__ == " _ _ main _ _ " :
	arr = [ 4 , 3 , 2 , 6 , 100 , 17 ]
	n = len ( arr )
	prime = [ True ] * 100006
	arr = sortPrimes ( arr , n )
	for i in range ( 0 , n ) :
		print ( arr [ i ] , end = " ▁ " )