# Write a Python program to Pair elements with Rear element in Matrix Row # Python3 code to demonstrate # Pair elements with Rear element in Matrix Row# using list comprehension  # Initializing listtest_list = [[4, 5, 6], [2, 4, 5], [6, 7, 5]]  # printing original listprint("The original list is : " + str(test_list))  # Pair elements with Rear element in Matrix Row# using list comprehensionres = []for sub in test_list:    res.append([[ele, sub[-1]] for ele in sub[:-1]])      # printing result print ("The list after pairing is : " + str(res))