When provided with two points, (x1, y1) and (x2, y2), for each line, we can begin by calculating the slope using the formula slope = (y2 - y1) / (x2 - x1). Here’s the process: def calculate_slope ( x1 , y1 , x2 , y2 ) : if x2 - x1 == 0 : # to prevent division by zero error return float ( 'inf' ) else : return ( y2 - y1 ) / ( x2 - x1 ) def are_lines_parallel ( line1 , line2 ) : slope1 = calculate_slope ( * line1 ) slope2 = calculate_slope ( * line2 ) if slope1 == slope2 : return True else : return False In this example, we calculate the slopes of both lines and then compare them. This function handles the scenario where the denominator could be zero, which occurs for vertical lines. In such cases, it returns infinity, as the slope of a vertical line is considered undefined (or infinite for this specific context). The primary function, 'are_lines_parallel', invokes the 'calculate_slope' function to find the slope of each line, subsequently comparing the slopes. If the slopes are the same, the lines are parallel, resulting in a return value of True; otherwise, it returns False.