Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Python Tutorial
  • Interview Questions
  • Python Quiz
  • Python Glossary
  • Python Projects
  • Practice Python
  • Data Science With Python
  • Python Web Dev
  • DSA with Python
  • Python OOPs
Open In App
Next Article:
Python Dictionary Exercise
Next article icon

Python Dictionary Exercise

Last Updated : 01 Oct, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

Basic Dictionary Programs

  • Python | Sort Python Dictionaries by Key or Value
  • Handling missing keys in Python dictionaries
  • Python dictionary with keys having multiple inputs
  • Python program to find the sum of all items in a dictionary
  • Python program to find the size of a Dictionary
  • Ways to sort list of dictionaries by values in Python – Using itemgetter
  • Ways to sort list of dictionaries by values in Python – Using lambda function
  • Python | Merging two Dictionaries
  • Program to create grade calculator in Python
  • Python - Insertion at the beginning in OrderedDict
  • Python | Check order of character in string using OrderedDict( )
  • Python | Find common elements in three sorted arrays by dictionary intersection
  • Dictionary and counter in Python to find winner of election
  • Python – Key with maximum unique values
  • Find all duplicate characters in string
  • Python – Group Similar items to Dictionary Values List
  • K’th Non-repeating Character in Python using List Comprehension and OrderedDict
  • Python - Replace String by Kth Dictionary value
  • Python | Ways to remove a key from dictionary
  • Python – Replace words from Dictionary
  • Python - Remove Dictionary Key Words
  • Python | Remove all duplicates words from a given sentence
  • Python – Remove duplicate values across Dictionary Values
  • Python Dictionary to find mirror characters in a string
  • Counting the frequencies in a list using dictionary in Python
  • Python – Dictionary Values Mean
  • Python counter and dictionary intersection example (Make a string using deletion and rearrangement)
  • Python dictionary, set and counter to check if frequencies can become same
  • Scraping And Finding Ordered Words In A Dictionary using Python
  • Possible Words using given characters in Python
  • Python - Maximum record value key in dictionary
  • Python – Extract values of Particular Key in Nested Values

Conversion of dictionary

  • Python - Convert Key-Value list Dictionary to List of Lists
  • Python - Convert List to List of dictionaries
  • Python - Convert Lists of List to Dictionary
  • Python - Convert List of Dictionaries to List of Lists
  • Python - Convert key-values list to flat dictionary
  • Python | Convert a list of Tuples into Dictionary
  • Python – Convert Nested dictionary to Mapped Tuple
  • Python Program to convert string to dictionary
  • Python – Convert dictionary to K sized dictionaries
  • Python – Convert Matrix to dictionary

Advance Dictionary Programs

  • Python – Create Nested Dictionary using given List
  • Python – Swapping Hierarchy in Nested Dictionaries
  • Python – Inversion in nested dictionary
  • Python – Reverse Dictionary Keys Order
  • Python – Extract Key’s Value, if Key Present in List and Dictionary
  • Python – Remove keys with Values Greater than K ( Including mixed values )
  • Python – Remove keys with substring values
  • Python – Dictionary with maximum count of pairs
  • Python - Append Dictionary Keys and Values ( In order ) in dictionary
  • Python - Extract Unique values dictionary values
  • Python - Keys associated with Values in Dictionary
  • Python - Filter dictionary values in heterogeneous dictionary
  • Print anagrams together in Python using List and Dictionary
  • Check if binary representations of two numbers are anagram
  • Python Counter to find the size of largest subset of anagram word
  • Count of groups having largest size while grouping according to sum of its digits
  • Python - Sort Dictionary key and values List
  • Python – Sort Dictionary by Values Summation
  • Python – Sort dictionaries list by Key’s Value list index
  • Python – Sort Nested keys by Value
  • Python – Scoring Matrix using Dictionary
  • Python – Factors Frequency Dictionary
  • Count distinct substrings of a string using Rabin Karp algorithm
  • Python program to build an undirected graph and finding shortest path using Dictionaries
  • LRU Cache in Python using OrderedDict

Next Article
Python Dictionary Exercise

A

abhishek1
Improve
Article Tags :
  • Python
  • Python dictionary-programs
Practice Tags :
  • python

Similar Reads

    How to Add Values to Dictionary in Python
    The task of adding values to a dictionary in Python involves inserting new key-value pairs or modifying existing ones. A dictionary stores data in key-value pairs, where each key must be unique. Adding values allows us to expand or update the dictionary's contents, enabling dynamic manipulation of d
    3 min read
    Add new keys to a dictionary in Python
    In this article, we will explore various methods to add new keys to a dictionary in Python. Let's explore them with examples:Using Assignment Operator (=)The simplest way to add a new key is by using assignment operator (=).Pythond = {"a": 1, "b": 2} d["c"] = 3 print(d)Output{'a': 1, 'b': 2, 'c': 3}
    2 min read
    Add Item after Given Key in Dictionary - Python
    The task of adding an item after a specific key in a Pythondictionary involves modifying the order of the dictionary's key-value pairs. Since Python dictionaries maintain the insertion order, we can achieve this by carefully placing the new key-value pair after the target key. For example, consider
    4 min read
    Python - Ways to remove a key from dictionary
    We are given a dictionary and our task is to remove a specific key from it. For example, if we have the dictionary d = {"a": 1, "b": 2, "c": 3}, then after removing the key "b", the output will be {'a': 1, 'c': 3}.Using pop()pop() method removes a specific key from the dictionary and returns its cor
    3 min read
    Removing Dictionary from List of Dictionaries - Python
    We are given a list of dictionaries, and our task is to remove specific dictionaries based on a condition. For instance given the list: a = [{'x': 10, 'y': 20}, {'x': 30, 'y': 40}, {'x': 50, 'y': 60}], we might want to remove the dictionary where 'x' equals 30 then the output will be [{'x': 10, 'y':
    3 min read
    Python - Remove item from dictionary when key is unknown
    We are given a dictionary we need to remove the item or the value of key which is unknown. For example, we are given a dictionary a = {'a': 10, 'b': 20, 'c': 30} we need to remove the key 'b' so that the output dictionary becomes like {'a': 10, 'c': 30} . To do this we can use various method and app
    4 min read
    Python - Test if all Values are Same in Dictionary
    Given a dictionary, test if all its values are the same. Input : test_dict = {"Gfg" : 8, "is" : 8, "Best" : 8} Output : True Explanation : All element values are same, 8. Input : test_dict = {"Gfg" : 8, "is" : 8, "Best" : 9} Output : False Explanation : All element values not same. Method #1: Using
    7 min read
    Python | Test if element is dictionary value
    Sometimes, while working with a Python dictionary, we have a specific use case in which we just need to find if a particular value is present in the dictionary as it's any key's value. This can have use cases in any field of programming one can think of. Let's discuss certain ways in which this prob
    4 min read
    Why is iterating over a dictionary slow in Python?
    In this article, we are going to discuss why is iterating over a dict so slow in Python? Before coming to any conclusion lets have a look at the performance difference between NumPy arrays and dictionaries in python: Python # import modules import numpy as np import sys # compute numpy performance d
    3 min read
    Iterate over a dictionary in Python
    In this article, we will cover How to Iterate Through a Dictionary in Python. To Loop through values in a dictionary you can use built-in methods like values(), items() or even directly iterate over the dictionary to access values with keys.How to Loop Through a Dictionary in PythonThere are multipl
    6 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences