human
Count of rectangles possible from N and M straight lines parallel to X and Y axis respectively | Function to calculate number of rectangles.
Total number of ways to select two lines parallel to X axis.
Total number of ways to select two lines parallel to Y axis.
Total number of rectangles.
Driver code"
How can the above be solved in Python?

=====
Can you provide a code to count of rectangles possible from N and M straight lines parallel to X and Y axis respectively and the other steps required?
assistant
#Here is code to count of rectangles possible from N and M straight lines parallel to X and Y axis respectively and the other steps required.
 def count_rectangles ( N , M ) :
	p_x = ( N * ( N - 1 ) ) // 2
	p_y = ( M * ( M - 1 ) ) // 2
	return p_x * p_y
N = 3
M = 6
print ( count_rectangles ( N , M ) )