human
Program to find the profit or loss when CP of N items is equal to SP of M items | Function to calculate Profit or loss.
Driver Code"
Solution in Python:

What is a code to program to find the profit or loss when CP of N items is equal to SP of M items and the other steps required?
assistant
#Here is code to program to find the profit or loss when CP of N items is equal to SP of M items and the other steps required.
 def profitLoss ( N , M ) :
	if ( N == M ) :
		print ( " No ▁ Profit ▁ nor ▁ Loss " )
	else :
		result = 0.0
		result = float ( abs ( N - M ) ) / M
		if ( N - M < 0 ) :
			print ( " Loss ▁ = ▁ - " , ' { 0 : . 6 } ' . format ( result * 100 ) , " % " )
		else :
			print ( " Profit ▁ = ▁ " , ' { 0 : . 6 } ' . format ( result * 100 ) , " % " )
if __name__ == ' _ _ main _ _ ' :
	N = 8
	M = 9
	profitLoss ( N , M )