# Category Archives: Python Programs

Given a list, remove all elements which are within K distance with N. Input : test_list = [4, 5, 9, 1, 10, 6, 13 ],… Read More
Given a list, assign a custom lower-bound value to it. Input : test_list = [5, 7, 8, 2, 3, 5, 1], K = 3 Output :… Read More
Given a list of elements, find its negative index in the List. Input : test_list = [5, 7, 8, 2, 3, 5, 1], K =… Read More
Given a list of lists. The task is to filter all rows whose difference in min and max values is greater than K. Examples: Input… Read More
Given a String Matrix, sort by total data, i.e total characters in each row. Input : test_list = [[“Gfg”, “is”, “Best”], [“Geeksforgeeks”, “Best”], [“ILvGFG”]] Output :… Read More
Given a List of elements, get all elements with factors less than K. Examples: Input : test_list = [60, 12, 100, 17, 18, 19]. K… Read More
Given a List, get all elements which are at its index value. Input : test_list = [3, 1, 8, 5, 4, 10, 6, 9] Output :… Read More
Given a list, extract all the elements having same frequency as its value. Examples: Input : test_list = [4, 3, 2, 2, 3, 4, 1,… Read More
Given a list of elements, sort by K digit in each element. Examples: Input : test_list = [4322, 2122, 123, 1344], K = 2 Output :… Read More
Given a Matrix, filter rows with required elements from other list. Input : test_list = [[2, 4, 6], [7, 4, 3, 2], [2, 4, 8],… Read More
Given a List, perform a swap of K prefix and suffix. Examples: Input : test_list = [5, 6, 3, 1, 0, 1, 3, 5, 7,… Read More
Given a String list, perform the task of the concatenation of strings by increasing the size at each string. Examples: Input : test_list = [‘gfg’,… Read More
Given a Tuple List, perform sort on basis of total digits in tuple. Examples: Input : test_list = [(3, 4, 6, 723), (1, 2), (134,… Read More
Given a Nested Dictionary, test if another dictionary is subset. Examples: Input : test_dict = {“gfg”: 12, ‘best’ : {1 : 3, 4 : 3,… Read More
Given a Boolean Matrix, extract row which contains at least one boolean True value. Input : test_list = [[False, False], [True, True, True], [False, True],… Read More