René's URL Explorer Experiment


Title: Dictionaries in Python – Real Python

Open Graph Title: Dictionaries in Python – Real Python

Description: In this tutorial, you'll learn how to work with Python dictionaries to help you process data more efficiently. You'll learn how to create dictionaries, access their keys and values, update dictionaries, and more.

Open Graph Description: In this tutorial, you'll learn how to work with Python dictionaries to help you process data more efficiently. You'll learn how to create dictionaries, access their keys and values, update dictionaries, and more.

Mail addresses
?subject=Python article for you&body=Dictionaries in Python on Real Python https://realpython.com/python-dicts/

Opengraph URL: https://realpython.com/python-dicts/

X: @realpython

direct link

Domain: realpython.com


Hey, it has json ld scripts:
{
  "@context": "http://schema.org",
  "@type": "Article",
  "headline": "Dictionaries in Python",
  "image": {
    "@type": "ImageObject",
    "url": "https://files.realpython.com/media/Dictionaries-in-Python_Watermarked.3656a2293c00.jpg",
    "width": 1920,
    "height": 1080
  },
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://realpython.com/python-dicts/",
    "lastReviewed": "2024-12-16",
    "author": {
      "@type": "Person",
      "name": "Leodanis Pozo Ramos",
      "image": "https://realpython.com/cdn-cgi/image/width=862,height=862,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/Perfil_final1.9f896bc212f6.jpg",
      "url": "https://realpython.com/team/lpozoramos/",
      "affiliation": {
        "@type": "Organization",
        "@id": "https://realpython.com/#organization",
        "name": "Real Python",
        "url": "https://realpython.com",
        "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
      }
    },
    "reviewedBy": [
      {
        "@type": "Person",
        "name": "Aldren Santos",
        "image": "https://realpython.com/cdn-cgi/image/width=500,height=500,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/Aldren_Santos_Real_Python.6b0861d8b841.png",
        "url": "https://realpython.com/team/asantos/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Brenda Weleschuk",
        "image": "https://realpython.com/cdn-cgi/image/width=320,height=320,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/IMG_3324_1.50b309355fc1.jpg",
        "url": "https://realpython.com/team/bweleschuk/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Bartosz Zaczy\u0144ski",
        "image": "https://realpython.com/cdn-cgi/image/width=1694,height=1694,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/coders_lab_2109368.259b1599fbee.jpg",
        "url": "https://realpython.com/team/bzaczynski/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Geir Arne Hjelle",
        "image": "https://realpython.com/cdn-cgi/image/width=800,height=800,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/gahjelle.470149ee709e.jpg",
        "url": "https://realpython.com/team/gahjelle/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "Joanna Jablonski",
        "image": "https://realpython.com/cdn-cgi/image/width=800,height=800,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/jjablonksi-avatar.e37c4f83308e.jpg",
        "url": "https://realpython.com/team/jjablonski/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      },
      {
        "@type": "Person",
        "name": "John Sturtz",
        "image": "https://realpython.com/cdn-cgi/image/width=1920,height=1920,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/real-python-logo-square.28474fda9228_1.146e987bf77c.png",
        "url": "https://realpython.com/team/jsturtz/",
        "affiliation": {
          "@type": "Organization",
          "@id": "https://realpython.com/#organization",
          "name": "Real Python",
          "url": "https://realpython.com",
          "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
        }
      }
    ]
  },
  "datePublished": "2024-12-16T14:00:00+00:00",
  "dateModified": "2024-12-16T14:09:16.198482+00:00",
  "publisher": {
    "@type": "Organization",
    "@id": "https://realpython.com/#organization",
    "name": "Real Python",
    "url": "https://realpython.com",
    "logo": {
      "@type": "ImageObject",
      "url": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png",
      "width": 512,
      "height": 512
    },
    "description": "Real Python is a leading provider of online Python education and one of the largest language-specific online communities for software developers. It publishes high-quality learning resources, such as tutorials, books, and courses to an audience of millions of developers, data scientists, and machine learning engineers each month.",
    "slogan": "Become a Python Expert",
    "email": "info@realpython.com",
    "sameAs": [
      "https://github.com/realpython",
      "https://www.youtube.com/realpython",
      "https://twitter.com/realpython",
      "https://x.com/realpython",
      "https://www.linkedin.com/company/realpython-com/",
      "https://www.facebook.com/learnrealpython",
      "https://www.instagram.com/realpython",
      "https://www.tiktok.com/@realpython.com"
    ]
  },
  "author": {
    "@type": "Person",
    "name": "Leodanis Pozo Ramos",
    "image": "https://realpython.com/cdn-cgi/image/width=862,height=862,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/Perfil_final1.9f896bc212f6.jpg",
    "url": "https://realpython.com/team/lpozoramos/",
    "affiliation": {
      "@type": "Organization",
      "@id": "https://realpython.com/#organization",
      "name": "Real Python",
      "url": "https://realpython.com",
      "logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
    }
  },
  "description": "In this tutorial, you'll learn how to work with Python dictionaries to help you process data more efficiently. You'll learn how to create dictionaries, access their keys and values, update dictionaries, and more.",
  "hasPart": {
    "@type": "FAQPage",
    "mainEntity": [
      {
        "@type": "Question",
        "name": "What is a dictionary in Python?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "

A dictionary in Python is a built-in data type that represents a collection of key-value pairs. It allows efficient retrieval, addition, and modification of data based on unique keys. Dictionaries are mutable, dynamic, efficient, and ordered data structures implemented as hash tables.

" } }, { "@type": "Question", "name": "How do you create a dictionary in Python?", "acceptedAnswer": { "@type": "Answer", "text": "

You can create a dictionary in Python using dictionary literals, which are a series of key-value pairs enclosed in curly braces ({}). Alternatively, you can use the dict() constructor, which can take keyword arguments, another mapping, or an iterable of key-value pairs.

" } }, { "@type": "Question", "name": "How can you access and modify values in a dictionary?", "acceptedAnswer": { "@type": "Answer", "text": "

You can access values in a dictionary by using their corresponding keys in square brackets ([]). To modify a value, assign a new value to an existing key. If the key doesn’t exist, this operation will add a new key-value pair to the dictionary.

" } }, { "@type": "Question", "name": "What are some common methods for working with dictionaries?", "acceptedAnswer": { "@type": "Answer", "text": "

Some common methods for working with Python dictionaries include .get() for retrieving values with a default, .setdefault() for setting default values, .update() for merging dictionaries, .pop() for removing keys, and .items(), .keys(), and .values() for accessing dictionary elements.

" } }, { "@type": "Question", "name": "How do you iterate over a dictionary in Python?", "acceptedAnswer": { "@type": "Answer", "text": "

You can iterate over a dictionary in Python using loops. To iterate over keys, you can loop directly over the dictionary or use the .keys() method. For values, use the .values() method. To iterate over both keys and values, use the .items() method, which yields key-value pairs as tuples.

" } } ] } }

authorReal Python
twitter:cardsummary_large_image
twitter:imagehttps://files.realpython.com/media/Dictionaries-in-Python_Watermarked.3656a2293c00.jpg
og:imagehttps://files.realpython.com/media/Dictionaries-in-Python_Watermarked.3656a2293c00.jpg
twitter:creator@realpython
og:typearticle

Links:

https://realpython.com/
Start Herehttps://realpython.com/start-here/
Learn Python https://realpython.com/python-dicts
Python Tutorials →In-depth articles and video courseshttps://realpython.com/search?kind=article&kind=course&order=newest
Learning Paths →Guided study plans for accelerated learninghttps://realpython.com/learning-paths/
Quizzes & Exercises →Check your learning progresshttps://realpython.com/quizzes/
Browse Topics →Focus on a specific area or skill levelhttps://realpython.com/tutorials/all/
Community Chat →Learn with other Pythonistashttps://realpython.com/community/
Office Hours →Live Q&A calls with Python expertshttps://realpython.com/office-hours/
Podcast →Hear what’s new in the world of Pythonhttps://realpython.com/podcasts/rpp/
Books →Round out your knowledge and learn offlinehttps://realpython.com/products/books/
Reference →Concise definitions for common Python termshttps://realpython.com/ref/
Code Mentor →BetaPersonalized code assistance & learning toolshttps://realpython.com/mentor/
Unlock All Content →https://realpython.com/account/join/
More https://realpython.com/python-dicts
Learner Storieshttps://realpython.com/learner-stories/
Python Newsletterhttps://realpython.com/newsletter/
Python Job Boardhttps://www.pythonjobshq.com
Meet the Teamhttps://realpython.com/team/
Become a Tutorial Writerhttps://realpython.com/write-for-us/
Become a Video Instructorhttps://realpython.com/become-an-instructor/
Searchhttps://realpython.com/search
https://realpython.com/search
Joinhttps://realpython.com/account/join/
Sign‑Inhttps://realpython.com/account/login/?next=%2Fpython-dicts%2F
Browse Topicshttps://realpython.com/tutorials/all/
Guided Learning Pathshttps://realpython.com/learning-paths/
Basicshttps://realpython.com/search?level=basics
Intermediatehttps://realpython.com/search?level=intermediate
Advancedhttps://realpython.com/search?level=advanced
aihttps://realpython.com/tutorials/ai/
algorithmshttps://realpython.com/tutorials/algorithms/
apihttps://realpython.com/tutorials/api/
best-practiceshttps://realpython.com/tutorials/best-practices/
careerhttps://realpython.com/tutorials/career/
communityhttps://realpython.com/tutorials/community/
databaseshttps://realpython.com/tutorials/databases/
data-sciencehttps://realpython.com/tutorials/data-science/
data-structureshttps://realpython.com/tutorials/data-structures/
data-vizhttps://realpython.com/tutorials/data-viz/
devopshttps://realpython.com/tutorials/devops/
djangohttps://realpython.com/tutorials/django/
dockerhttps://realpython.com/tutorials/docker/
editorshttps://realpython.com/tutorials/editors/
flaskhttps://realpython.com/tutorials/flask/
front-endhttps://realpython.com/tutorials/front-end/
gamedevhttps://realpython.com/tutorials/gamedev/
guihttps://realpython.com/tutorials/gui/
machine-learninghttps://realpython.com/tutorials/machine-learning/
newshttps://realpython.com/tutorials/news/
numpyhttps://realpython.com/tutorials/numpy/
projectshttps://realpython.com/tutorials/projects/
pythonhttps://realpython.com/tutorials/python/
stdlibhttps://realpython.com/tutorials/stdlib/
testinghttps://realpython.com/tutorials/testing/
toolshttps://realpython.com/tutorials/tools/
web-devhttps://realpython.com/tutorials/web-dev/
web-scrapinghttps://realpython.com/tutorials/web-scraping/
Table of Contentshttps://realpython.com/python-dicts#toc
Getting Started With Python Dictionarieshttps://realpython.com/python-dicts#getting-started-with-python-dictionaries
Creating Dictionaries in Pythonhttps://realpython.com/python-dicts#creating-dictionaries-in-python
Dictionary Literalshttps://realpython.com/python-dicts#dictionary-literals
The dict() Constructorhttps://realpython.com/python-dicts#the-dict-constructor
Using the .fromkeys() Class Methodhttps://realpython.com/python-dicts#using-the-fromkeys-class-method
Accessing Dictionary Valueshttps://realpython.com/python-dicts#accessing-dictionary-values
Populating Dictionaries Incrementallyhttps://realpython.com/python-dicts#populating-dictionaries-incrementally
Assigning Keys Manuallyhttps://realpython.com/python-dicts#assigning-keys-manually
Adding Keys in a for Loophttps://realpython.com/python-dicts#adding-keys-in-a-for-loop
Building Dictionaries With Comprehensionshttps://realpython.com/python-dicts#building-dictionaries-with-comprehensions
Exploring the dict Class Methodshttps://realpython.com/python-dicts#exploring-the-dict-class-methods
Retrieving Data From Dictionarieshttps://realpython.com/python-dicts#retrieving-data-from-dictionaries
Adding Key-Value Pairs and Updating Dictionarieshttps://realpython.com/python-dicts#adding-key-value-pairs-and-updating-dictionaries
Removing Data From Dictionarieshttps://realpython.com/python-dicts#removing-data-from-dictionaries
Using Operators With Dictionarieshttps://realpython.com/python-dicts#using-operators-with-dictionaries
Membership: in and not inhttps://realpython.com/python-dicts#membership-in-and-not-in
Equality and Inequality: == and !=https://realpython.com/python-dicts#equality-and-inequality-and
Union and Augmented Union: | and |=https://realpython.com/python-dicts#union-and-augmented-union-and
Use Built-in Functions With Dictionarieshttps://realpython.com/python-dicts#use-built-in-functions-with-dictionaries
Checking for Truthy Data in Dictionaries: all() and any()https://realpython.com/python-dicts#checking-for-truthy-data-in-dictionaries-all-and-any
Determining the Number of Dictionary Items: len()https://realpython.com/python-dicts#determining-the-number-of-dictionary-items-len
Finding Minimum and Maximum Values: min() and max()https://realpython.com/python-dicts#finding-minimum-and-maximum-values-min-and-max
Sorting Dictionaries by Keys, Values, and Items: sorted()https://realpython.com/python-dicts#sorting-dictionaries-by-keys-values-and-items-sorted
Summing Dictionary Values: sum()https://realpython.com/python-dicts#summing-dictionary-values-sum
Iterating Over Dictionarieshttps://realpython.com/python-dicts#iterating-over-dictionaries
Traversing Dictionaries by Keyshttps://realpython.com/python-dicts#traversing-dictionaries-by-keys
Iterating Over Dictionary Valueshttps://realpython.com/python-dicts#iterating-over-dictionary-values
Looping Through Dictionary Itemshttps://realpython.com/python-dicts#looping-through-dictionary-items
Exploring Existing Dictionary-Like Classeshttps://realpython.com/python-dicts#exploring-existing-dictionary-like-classes
Creating Custom Dictionary-Like Classeshttps://realpython.com/python-dicts#creating-custom-dictionary-like-classes
Conclusionhttps://realpython.com/python-dicts#conclusion
Frequently Asked Questionshttps://realpython.com/python-dicts#frequently-asked-questions
https://realpython.com/feedback/survey/article/python-dicts/liked/?from=article-sidebar
https://realpython.com/feedback/survey/article/python-dicts/disliked/?from=article-sidebar
Using Dictionaries in Python 25m · 5 lessons https://realpython.com/courses/dictionaries-python/
Leodanis Pozo Ramoshttps://realpython.com/python-dicts#author
https://realpython.com/python-dicts#reader-comments
basicshttps://realpython.com/tutorials/basics/
pythonhttps://realpython.com/tutorials/python/
Getting Started With Python Dictionarieshttps://realpython.com/python-dicts#getting-started-with-python-dictionaries
Creating Dictionaries in Pythonhttps://realpython.com/python-dicts#creating-dictionaries-in-python
Dictionary Literalshttps://realpython.com/python-dicts#dictionary-literals
The dict() Constructorhttps://realpython.com/python-dicts#the-dict-constructor
Using the .fromkeys() Class Methodhttps://realpython.com/python-dicts#using-the-fromkeys-class-method
Accessing Dictionary Valueshttps://realpython.com/python-dicts#accessing-dictionary-values
Populating Dictionaries Incrementallyhttps://realpython.com/python-dicts#populating-dictionaries-incrementally
Assigning Keys Manuallyhttps://realpython.com/python-dicts#assigning-keys-manually
Adding Keys in a for Loophttps://realpython.com/python-dicts#adding-keys-in-a-for-loop
Building Dictionaries With Comprehensionshttps://realpython.com/python-dicts#building-dictionaries-with-comprehensions
Exploring the dict Class Methodshttps://realpython.com/python-dicts#exploring-the-dict-class-methods
Retrieving Data From Dictionarieshttps://realpython.com/python-dicts#retrieving-data-from-dictionaries
Adding Key-Value Pairs and Updating Dictionarieshttps://realpython.com/python-dicts#adding-key-value-pairs-and-updating-dictionaries
Removing Data From Dictionarieshttps://realpython.com/python-dicts#removing-data-from-dictionaries
Using Operators With Dictionarieshttps://realpython.com/python-dicts#using-operators-with-dictionaries
Membership: in and not inhttps://realpython.com/python-dicts#membership-in-and-not-in
Equality and Inequality: == and !=https://realpython.com/python-dicts#equality-and-inequality-and
Union and Augmented Union: | and |=https://realpython.com/python-dicts#union-and-augmented-union-and
Use Built-in Functions With Dictionarieshttps://realpython.com/python-dicts#use-built-in-functions-with-dictionaries
Checking for Truthy Data in Dictionaries: all() and any()https://realpython.com/python-dicts#checking-for-truthy-data-in-dictionaries-all-and-any
Determining the Number of Dictionary Items: len()https://realpython.com/python-dicts#determining-the-number-of-dictionary-items-len
Finding Minimum and Maximum Values: min() and max()https://realpython.com/python-dicts#finding-minimum-and-maximum-values-min-and-max
Sorting Dictionaries by Keys, Values, and Items: sorted()https://realpython.com/python-dicts#sorting-dictionaries-by-keys-values-and-items-sorted
Summing Dictionary Values: sum()https://realpython.com/python-dicts#summing-dictionary-values-sum
Iterating Over Dictionarieshttps://realpython.com/python-dicts#iterating-over-dictionaries
Traversing Dictionaries by Keyshttps://realpython.com/python-dicts#traversing-dictionaries-by-keys
Iterating Over Dictionary Valueshttps://realpython.com/python-dicts#iterating-over-dictionary-values
Looping Through Dictionary Itemshttps://realpython.com/python-dicts#looping-through-dictionary-items
Exploring Existing Dictionary-Like Classeshttps://realpython.com/python-dicts#exploring-existing-dictionary-like-classes
Creating Custom Dictionary-Like Classeshttps://realpython.com/python-dicts#creating-custom-dictionary-like-classes
Conclusionhttps://realpython.com/python-dicts#conclusion
Frequently Asked Questionshttps://realpython.com/python-dicts#frequently-asked-questions
Remove adshttps://realpython.com/account/join/
Using Dictionaries in Pythonhttps://realpython.com/courses/dictionaries-python/
variableshttps://realpython.com/python-variables/
loopshttps://realpython.com/python-for-loop/
built-in functionshttps://realpython.com/python-built-in-functions/
basic Python data typeshttps://realpython.com/python-data-types/
Click here to download the free sample codehttps://realpython.com/bonus/python-dicts-code/
https://realpython.com/quizzes/dictionaries-in-python/
Dictionaries in Pythonhttps://realpython.com/quizzes/dictionaries-in-python/
https://realpython.com/python-dicts#getting-started-with-python-dictionaries
built-in functionshttps://realpython.com/python-built-in-functions/
classeshttps://realpython.com/python-classes/
.__dict__https://realpython.com/python-dict-attribute/
object-orientedhttps://realpython.com/python3-object-oriented-programming/
CSVhttps://realpython.com/python-csv/
JSONhttps://realpython.com/python-json/
in placehttps://en.wikipedia.org/wiki/In-place_algorithm
hash tableshttps://realpython.com/python-hash-table/
Python 3.7https://realpython.com/python37-new-features/
orderhttps://realpython.com/python37-new-features/#the-order-of-dictionaries-is-guaranteed
.setdefault()https://realpython.com/python-dicts#setting-one-key-setdefaultkey-defaultnone
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-dicts#creating-dictionaries-in-python
constructorhttps://realpython.com/python-class-constructor/
iterableshttps://realpython.com/python-iterators-iterables/
https://realpython.com/python-dicts#dictionary-literals
hashablehttps://docs.python.org/3/glossary.html#term-hashable
hash functionhttps://realpython.com/python-hash-table/#understand-the-hash-function
setshttps://realpython.com/python-sets/
mutablehttps://realpython.com/python-mutable-vs-immutable-types/#mutable-built-in-data-types-in-python
sequenceshttps://realpython.com/python-sequences/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-dicts#the-dict-constructor
identifiershttps://docs.python.org/3/reference/lexical_analysis.html#identifiers
zip()https://realpython.com/python-zip-function/
https://realpython.com/python-dicts#using-the-fromkeys-class-method
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-dicts#accessing-dictionary-values
KeyErrorhttps://realpython.com/python-built-in-exceptions/#keyerror
https://realpython.com/python-dicts#populating-dictionaries-incrementally
https://realpython.com/python-dicts#assigning-keys-manually
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-dicts#adding-keys-in-a-for-loop
rangehttps://realpython.com/python-range/
https://realpython.com/python-dicts#building-dictionaries-with-comprehensions
Python Dictionary Comprehensions: How and When to Use Themhttps://realpython.com/python-dictionary-comprehension/
https://realpython.com/python-dicts#exploring-the-dict-class-methods
https://realpython.com/python-dicts#retrieving-data-from-dictionaries
https://realpython.com/python-dicts#getting-individual-keys-getkey-defaultnone
.get()https://docs.python.org/3/library/stdtypes.html#dict.get
https://realpython.com/python-dicts#retrieving-all-the-values-values
dictionary viewhttps://docs.python.org/3/library/stdtypes.html#dict-views
https://realpython.com/python-dicts#accessing-all-the-keys-keys
https://realpython.com/python-dicts#getting-all-the-items-or-key-value-pairs-items
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-dicts#adding-key-value-pairs-and-updating-dictionaries
https://realpython.com/python-dicts#setting-one-key-setdefaultkey-defaultnone
https://realpython.com/python-dicts#updating-a-dictionary-updateother
https://realpython.com/python-dicts#removing-data-from-dictionaries
https://realpython.com/python-dicts#removing-keys-popkey-default
delhttps://realpython.com/python-del-statement/
https://realpython.com/python-dicts#deleting-items-popitem
LIFOhttps://realpython.com/queue-in-python/#stack-last-in-first-out-lifo
Python dictionaries were unorderedhttps://realpython.com/iterate-through-dictionary-python/
https://realpython.com/python-dicts#clearing-dictionaries-clear
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-dicts#using-operators-with-dictionaries
https://realpython.com/python-dicts#membership-in-and-not-in
Python’s “in” and “not in” Operators: Check for Membershiphttps://realpython.com/python-in-operator/
https://realpython.com/python-dicts#equality-and-inequality-and
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-dicts#union-and-augmented-union-and
mappinghttps://docs.python.org/3/glossary.html#term-mapping
iterablehttps://docs.python.org/3/glossary.html#term-iterable
https://realpython.com/python-dicts#use-built-in-functions-with-dictionaries
https://realpython.com/python-dicts#checking-for-truthy-data-in-dictionaries-all-and-any
Python’s all(): Check Your Iterables for Truthinesshttps://realpython.com/python-all/
How to Use any() in Pythonhttps://realpython.com/any-python/
https://realpython.com/python-dicts#determining-the-number-of-dictionary-items-len
len()https://realpython.com/len-python-function/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-dicts#finding-minimum-and-maximum-values-min-and-max
min() and max()https://realpython.com/python-min-and-max/
https://realpython.com/python-dicts#sorting-dictionaries-by-keys-values-and-items-sorted
sorted()https://realpython.com/python-built-in-functions/#reversing-and-sorting-iterables-reversed-and-sorted
lambdahttps://realpython.com/python-lambda/
Sorting a Python Dictionary: Values, Keys, and Morehttps://realpython.com/sort-python-dictionary/
https://realpython.com/python-dicts#summing-dictionary-values-sum
Python’s sum(): The Pythonic Way to Sum Valueshttps://realpython.com/python-sum-function/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-dicts#iterating-over-dictionaries
How to Iterate Through a Dictionary in Pythonhttps://realpython.com/iterate-through-dictionary-python/
https://realpython.com/python-dicts#traversing-dictionaries-by-keys
https://realpython.com/python-dicts#iterating-over-dictionary-values
https://realpython.com/python-dicts#looping-through-dictionary-items
https://realpython.com/python-dicts#exploring-existing-dictionary-like-classes
OrderedDicthttps://realpython.com/python-ordereddict/
Counterhttps://realpython.com/python-counter/
defaultdicthttps://realpython.com/python-defaultdict/
collectionshttps://realpython.com/python-collections-module/
decide which dictionaryhttps://realpython.com/python-ordereddict/#selecting-the-right-dictionary-for-the-job
for loophttps://realpython.com/python-for-loop/
Remove adshttps://realpython.com/account/join/
https://realpython.com/python-dicts#creating-custom-dictionary-like-classes
Custom Python Dictionaries: Inheriting From dict vs UserDicthttps://realpython.com/inherit-python-dict/
https://realpython.com/python-dicts#conclusion
Click here to download the free sample codehttps://realpython.com/bonus/python-dicts-code/
https://realpython.com/python-dicts#frequently-asked-questions
https://realpython.com/quizzes/dictionaries-in-python/
Dictionaries in Pythonhttps://realpython.com/quizzes/dictionaries-in-python/
https://realpython.com/feedback/survey/article/python-dicts/liked/?from=article-footer
https://realpython.com/feedback/survey/article/python-dicts/disliked/?from=article-footer
Using Dictionaries in Pythonhttps://realpython.com/courses/dictionaries-python/
https://realpython.com/team/lpozoramos/
» More about Leodanishttps://realpython.com/team/lpozoramos/
https://realpython.com/team/asantos/
Aldrenhttps://realpython.com/team/asantos/
https://realpython.com/team/bweleschuk/
Brendahttps://realpython.com/team/bweleschuk/
https://realpython.com/team/bzaczynski/
Bartoszhttps://realpython.com/team/bzaczynski/
https://realpython.com/team/gahjelle/
Geir Arnehttps://realpython.com/team/gahjelle/
https://realpython.com/team/jjablonski/
Joannahttps://realpython.com/team/jjablonski/
https://realpython.com/team/jsturtz/
Johnhttps://realpython.com/team/jsturtz/
Level Up Your Python Skills »https://realpython.com/account/join/?utm_source=rp_article_footer&utm_content=python-dicts
Level Up Your Python Skills »https://realpython.com/account/join/?utm_source=rp_article_footer&utm_content=python-dicts
https://realpython.com/feedback/survey/article/python-dicts/liked/?from=article-comments
https://realpython.com/feedback/survey/article/python-dicts/disliked/?from=article-comments
LinkedInhttps://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Frealpython.com%2Fpython-dicts%2F
Twitterhttps://twitter.com/intent/tweet/?text=Interesting%20Python%20article%20on%20%40realpython%3A%20Dictionaries%20in%20Python&url=https%3A%2F%2Frealpython.com%2Fpython-dicts%2F
Blueskyhttps://bsky.app/intent/compose?text=Interesting%20Python%20article%20on%20%40realpython.com%3A%20Dictionaries%20in%20Python%20https%3A%2F%2Frealpython.com%2Fpython-dicts%2F
Facebookhttps://facebook.com/sharer/sharer.php?u=https%3A%2F%2Frealpython.com%2Fpython-dicts%2F
Get tips for asking good questionshttps://realpython.com/python-beginner-tips/#tip-9-ask-good-questions
get answers to common questions in our support portalhttps://support.realpython.com
Real Python Community Chathttps://realpython.com/community/
“Office Hours” Live Q&A Sessionhttps://realpython.com/office-hours/
basicshttps://realpython.com/tutorials/basics/
pythonhttps://realpython.com/tutorials/python/
Using Dictionaries in Pythonhttps://realpython.com/courses/dictionaries-python/?utm_source=realpython&utm_medium=web&utm_campaign=related-course&utm_content=python-dicts
Linked Lists in Python: An Introductionhttps://realpython.com/linked-lists-python/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-dicts
Sets in Pythonhttps://realpython.com/python-sets/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-dicts
How to Use Python Lambda Functionshttps://realpython.com/python-lambda/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-dicts
How to Iterate Through a Dictionary in Pythonhttps://realpython.com/iterate-through-dictionary-python/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-dicts
Defining Your Own Python Functionhttps://realpython.com/defining-your-own-python-function/?utm_source=realpython&utm_medium=web&utm_campaign=related-post&utm_content=python-dicts
https://realpython.com/account/signup/?intent=continue_reading&utm_source=rp&utm_medium=web&utm_campaign=rwn&utm_content=v1&next=%2Fpython-dicts%2F
Continue »https://realpython.com/account/signup/?intent=continue_reading&utm_source=rp&utm_medium=web&utm_campaign=rwn&utm_content=v1&next=%2Fpython-dicts%2F
Sign-Inhttps://realpython.com/account/login/?next=/python-dicts/
Start Herehttps://realpython.com/start-here/
Learning Resourceshttps://realpython.com/search
Code Mentorhttps://realpython.com/mentor/
Python Referencehttps://realpython.com/ref/
Python Cheat Sheethttps://realpython.com/cheatsheets/python/
Support Centerhttps://support.realpython.com/
Learning Pathshttps://realpython.com/learning-paths/
Quizzes & Exerciseshttps://realpython.com/quizzes/
Browse Topicshttps://realpython.com/tutorials/all/
Live Courseshttps://realpython.com/live/
Bookshttps://realpython.com/books/
Podcasthttps://realpython.com/podcasts/rpp/
Newsletterhttps://realpython.com/newsletter/
Community Chathttps://realpython.com/community/
Office Hourshttps://realpython.com/office-hours/
Learner Storieshttps://realpython.com/learner-stories/
Plans & Pricinghttps://realpython.com/account/join/
Team Planshttps://realpython.com/account/join-team/
For Businesshttps://realpython.com/account/join-team/inquiry/
For Schoolshttps://realpython.com/account/join-team/education-inquiry/
Reviewshttps://realpython.com/learner-stories/
About Ushttps://realpython.com/about/
Teamhttps://realpython.com/team/
Mission & Valueshttps://realpython.com/mission/
Editorial Guidelineshttps://realpython.com/editorial-guidelines/
Sponsorshipshttps://realpython.com/sponsorships/
Careershttps://realpython.workable.com
Press Kithttps://realpython.com/media-kit/
Merchhttps://realpython.com/merch
https://www.youtube.com/realpython
https://x.com/realpython
https://www.linkedin.com/company/realpython-com
https://www.facebook.com/LearnRealPython
https://github.com/realpython/
Privacy Policyhttps://realpython.com/privacy-policy/
Terms of Usehttps://realpython.com/terms/
Securityhttps://realpython.com/security/
Contacthttps://realpython.com/contact/
https://realpython.com/

Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover

Robots: max-image-preview:large


URLs of crawlers that visited me.