# Write a Python Program to Reverse Every Kth row in a Matrix # Python3 code to demonstrate working of# Reverse Kth rows in Matrix# Using reversed() + loop  # initializing listtest_list = [[5, 3, 2], [8, 6, 3], [3, 5, 2],              [3, 6], [3, 7, 4], [2, 9]]  # printing original listprint("The original list is : " + str(test_list))  # initializing KK = 3  res = []for idx, ele in enumerate(test_list):      # checking for K multiple    if (idx + 1) % K == 0:          # reversing using reversed        res.append(list(reversed(ele)))    else:        res.append(ele)  # printing resultprint("After reversing every Kth row: " + str(res))