human
Program to calculate Profit Or Loss | Function to calculate Profit ..
Function to calculate Loss ..
Driver code"
How can the above be solved in Python?
assistant
#Here is code to program to calculate Profit Or Loss and the other steps required.
 def Profit ( costPrice , sellingPrice ) :
	profit = ( sellingPrice - costPrice )
	return profit
def Loss ( costPrice , sellingPrice ) :
	Loss = ( costPrice - sellingPrice )
	return Loss
if __name__ == " _ _ main _ _ " :
	costPrice , sellingPrice = 1500 , 2000
	if sellingPrice == costPrice :
		print ( " No ▁ profit ▁ nor ▁ Loss " )
	elif sellingPrice > costPrice :
		print ( Profit ( costPrice , sellingPrice ) , " Profit " )
	else :
		print ( Loss ( costPrice , sellingPrice ) , " Loss " )