Program - Python code to Get Kth Column of Matrix


Topic: Program - Python code to Get Kth Column of Matrix

Solution

def kth_column(test_list=[[4, 5, 6], [8, 1, 10], [7, 12, 5]],k=2):
    print("The original list is : " + str(test_list))
    K =k
    res = list(zip(*test_list)[K])
    print("The Kth column of matrix is : " + str(res))



List all Python Programs