Skip to content

Category Archives: Python Programs

Given a sum K then extracts distinct positive numbers that reach the sum. Input : K = 17 Output : [1, 2, 3, 4, 7] Explanation :… Read More
Given A Matrix, extract all the rows which have all the elements with particular data type. Input : test_list = [[4, 5, “Hello”], [2, 6,… Read More
Given Matrix, extract all the rows which has elements which have all elements which can be represented as dictionary key, i.e immutable. Input : test_list… Read More
Given a List, perform consecutive division from each quotient obtained in the intermediate step and treating consecutive elements as divisors. Input : test_list = [1000,… Read More
Given a List that contains only string elements, the following program shows methods how every other alphabet can be removed from elements except for a… Read More
Given a List, the following article shows ways to count elements which are either peak(x > y < z) or valley(x < y > z).… Read More
Given a Matrix, the following article shows how rows which has similar digit at the specified index will be extracted and returned as output. Input… Read More
The following article shows how given an integer list, we can produce the sum of all its odd and even digits. Input : test_list =… Read More
Given a dictionary, divide it into an equal dictionary list of size k, by dividing each key’s value. Input : test_dict = {“Gfg” : 9,… Read More
Given a string, generate K length combinations in a one-liner. Input : test_str = ‘gfg’, K = 3 Output : [‘ggg’, ‘ggf’, ‘ggg’, ‘gfg’, ‘gff’, ‘gfg’,… Read More
Given a List and a String, test if the string can be made from list characters. Examples: Input : test_list = [‘g’, ‘g’, ‘e’, ‘k’,… Read More
Given a String, add a phrase in the middle of it. Input : test_str = ‘geekforgeeks is for geeks’, mid_str = “good” Output : geekforgeeks is… Read More
Given a string, replace all the vowels with character K. Input : test_str = “Geeks for Geeks”; K=’#’Output : “G##ks f#r G##ks” Explanation : All the… Read More
Given a Matrix, the following program is used to test if length all rows of a matrix are in increasing order or not. If yes,… Read More
Given a List, Test if all elements in given range is equal to K. Input : test_list = [2, 3, 4, 4, 4, 4, 6,… Read More

Start Your Coding Journey Now!