Skip to content

Category Archives: Python Programs

Given a snake case string, convert to camel case. Input : test_str = ‘geeksforgeeks_is_best_for_geeks’ Output : geeksforgeeksIsBestForGeeks Explanation : String converted to Camel Case. Attention geek! Strengthen your… Read More
Given a String, repeat characters consecutively by number mapped in dictionary. Input : test_str = ‘Geeks4Geeks’, test_dict = {“G” : 3, “e” : 1, “4”… Read More
Given a String, reverse its alternate characters string. Input : test_str = ‘geeks4rgeeks’ Output : keekr4sgeegs Explanation : only g, e, s, r, e, k are reversed,… Read More
Given a String, each character mapped with a weight( number), compute the total weight of the string. Input : test_str = ‘GeeksforGeeks’, {“G” : 1,… Read More
Given a dictionary with a values list, where the key represents frequency, compute the total occurrence of each value in values lists. Input : test_dict… Read More
Given a delimiter (denoted as delim in code) separated string, order the splits in form of dictionary. Examples : Attention geek! Strengthen your foundations with the… Read More
Given a Matrix, convert it to a list of dictionaries by mapping similar index values. Input : test_list = [[“Gfg”, [1, 2, 3]], [“best”, [9,… Read More
Given a dictionary, extract the largest N dictionaries keys in descending order. Input : test_dict = {6 : 2, 8: 9, 3: 9, 10: 8},… Read More
Given a string and set of characters, convert all the characters occurred from character set in string to uppercase() Input : test_str = ‘gfg is… Read More
Given a dictionary, change the value if it is equal to K.  Input : test_dict = {“Gfg”: 4, “is”: 8, “best”: 10, “for”: 8, “geeks”:… Read More
Given a dictionary with values as a list. Group all the keys together with similar values. Input : test_dict = {“Gfg”: [5, 6], “is”: [8,… Read More
Given a list of words, extract all the indices where those words occur in the string. Input : test_str = ‘geeksforgeeks is best for geeks… Read More
Given a character mesh, containing missing characters, match the string which matches the mesh. Example: Attention geek! Strengthen your foundations with the Python Programming Foundation Course… Read More
Given a string, extract all the alphanumerics before 1st occurrence of non-alphanumeric. Input : test_str = ‘geek$s4g!!!eeks’ Output : geek Explanation : Stopped at $ occurrence. Attention geek!… Read More
Given a list of strings. The task is to split the string by the given list of strings.  Input : test_str = ‘geekforgeeksbestforgeeks’, sub_list =… Read More

Start Your Coding Journey Now!