{"id":70348,"date":"2022-07-19T08:39:22","date_gmt":"2022-07-19T08:39:22","guid":{"rendered":"https:\/\/itsourcecode.com\/?p=70348"},"modified":"2023-10-25T09:14:19","modified_gmt":"2023-10-25T09:14:19","slug":"is-dictionary-mutable-in-python","status":"publish","type":"post","link":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/","title":{"rendered":"Is Dictionary Mutable in Python?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>What is a Python dictionary?<\/strong><\/h2>\n\n\n\n<p><strong>Dictionaries are mutable data structures in Python <\/strong>that are similar to <a href=\"https:\/\/itsourcecode.com\/python-tutorial\/lists-in-python-with-examples\/\" target=\"_blank\" rel=\"noreferrer noopener\">lists<\/a>, <a href=\"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/\" target=\"_blank\" rel=\"noreferrer noopener\">sets<\/a>, and <a href=\"https:\/\/itsourcecode.com\/python-tutorial\/tuples-in-python-operators-and-functions-with-examples\/\" target=\"_blank\" rel=\"noreferrer noopener\">tuples <\/a>but are indexed by keys instead of numbers. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>They can be thought of as associative arrays, consisting of keys with associated values.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"tw-highlight-padding\">A Dictionary in Python is a list of <strong>key-value pairs<\/strong> that are separated by commas and put inside <strong>curly brackets<\/strong> <code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">{}<\/mark><\/code>. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"tw-highlight-padding\">When the key is known, it is easiest to get the value from a dictionary.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What are Keys?<\/strong><\/h2>\n\n\n\n<p><strong>Keys are immutable data types<\/strong> that can be either <a href=\"https:\/\/itsourcecode.com\/python-tutorial\/python-strings\/\" target=\"_blank\" rel=\"noreferrer noopener\">strings <\/a>or <a href=\"https:\/\/itsourcecode.com\/python-tutorial\/python-numbers-type-conversion-and-data-types-with-examples\/\" target=\"_blank\" rel=\"noreferrer noopener\">numbers<\/a>. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>They are unique within a Dictionary and cannot be duplicated. If used more than once, subsequent entries will overwrite the previous value.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Is the dictionary Mutable or Immutable in Python?<\/strong><\/h2>\n\n\n\n<p>The <strong>dictionary is mutable<\/strong> it simply means entries can be added, removed, or changed at any time. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Note, though, that we can&#8217;t have two entries with the same key because each entry is accessed by its key.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>You must comprehend that Python stores all of its data as objects. The mutability of an object is determined by its type. Other objects, such as integers, floats, strings, and tuples, cannot be modified.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Difference Between Lists and Dictionaries<\/strong><\/h2>\n\n\n\n<p>There are two types of data structures in Python &#8211; lists, and dictionaries. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Lists are index-based<\/strong>, like arrays in C++, and created using square brackets, while <strong>dictionaries are key-value-based<\/strong> and created using curly brackets.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A list can store a series of objects in a certain order so that you can index them into the list or go through it in a loop. Also, a List is a mutable type, which means that lists can be changed after they have been created.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Python&#8217;s dictionary<\/strong> is an implementation of a hash table and a key-value store. It is not in any particular order, and it requires that the keys be a hash table. <\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>In Python, you can create a dictionary by putting a list of items inside <strong>curly braces<\/strong> and putting a comma (<code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">,<\/mark><\/code>) between each one. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>The dictionary holds pairs of values, where one is the Key and the other is the value of that. Values in a dictionary can be any type of data and can be duplicated, but keys can&#8217;t be duplicated and must be immutable.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Note: Dictionary <strong>keys are case-sensitive<\/strong>, which means that two keys with the same name but different capitalizations will be treated differently.&nbsp;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>The values can be integers, floats, strings, lists, etc.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Syntax<\/strong><\/h3>\n\n\n\n<p>As a reminder, here is the syntax of the Dictionary.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dict_1 = {\n  \"key1\":\"value1\",\n  \"key2\":\"value2\"\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-of-creating-a-dictionary\"><strong>Example of Creating a Dictionary<\/strong><\/h3>\n\n\n\n<p>Below is an example of creating a dictionary with different key types.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-example-1\"><strong>Example 1:<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># with Integer Keys\nDict = {1: 'IT', 2: 'Source', 3: 'Code'}\nprint(\"Using Integer Keys to Make a Dictionary:\")\nprint(Dict)\n\n# with Mixed Keys\nDict = {'Hello': 'World', 2: &#91;1, 2, 3, 4, 5]}\nprint(\"\\nUsing Mixed Keys to Make a Dictionary:\")\nprint(Dict)<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-output\"><strong>Output:<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Using Integer Keys to Make a Dictionary:\n{1: 'IT', 2: 'Source', 3: 'Code'}\n\nUsing Mixed Keys to Make a Dictionary:\n{'Hello': 'World', 2: &#91;1, 2, 3, 4, 5]}<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>If you specify a key more than once when creating a dictionary, only the last value will be used.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-example-2\"><strong>Example 2:<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Dict = {1: 'IT', 2: 'Source', 3: 'Code'}\n\nDict&#91;1] = \"Information Technology\"\nprint(Dict)<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-output-0\"><strong>Output:<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>{1: 'Information Technology', 2: 'Source', 3: 'Code'}<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to access dictionary values in Python<\/strong><\/h2>\n\n\n\n<p>The index cannot be used to access dictionary values.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Dict = {\n    \"Name\": \"Prince\",\n    \"Number\": 23,\n    \"Language\": &#91;\"PHP\", \"Python\", \"Java\"]\n}\n\nprint(Dict&#91;1])<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>If you try to do this, you&#8217;ll get an error message like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Traceback (most recent call last):\n  File \"\/home\/test.py\", line 7, in &lt;module&gt;\n    print(Dict&#91;1])\nKeyError: 1<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-summary\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>This tutorial has discussed <strong>Python dictionaries<\/strong>, including what they are, what keys are, and whether or not they can change. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>We also talked about how to make a dictionary and how to access its values.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>If you missed our previous lessons, check out our list of <a href=\"https:\/\/itsourcecode.com\/python-tutorial\/python-tutorial-for-absolute-beginners\/\">Python tutorials for absolute beginners<\/a> anytime. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>You can also check our Best <a href=\"https:\/\/itsourcecode.com\/fyp\/best-machine-learning-projects-with-source-code-for-2022\/\">Machine Learning Projects with Source Code<\/a> if you&#8217;re interested in machine learning.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>The next post will be about <strong>Python&#8217;s built-in functions<\/strong>. You&#8217;ll learn about their syntax and parameters, and see some examples.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns tw-mb-0 tw-stretched-blocks tw-justify-center tw-gutter-no tw-cols-stack-sm tw-cols-card tw-cols-card-border tw-stretched-link is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-buttons tw-mb-0 tw-mt-0 is-content-justification-left is-nowrap is-layout-flex wp-container-core-buttons-is-layout-558b13e7 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-base-3-background-color has-background wp-element-button\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/\" style=\"border-radius:0px\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\">\u2770\u2770<\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\"><strong>Previous<\/strong><\/mark><\/a><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-left tw-mt-0 tw-mb-0 tw-link-hover-underline\" style=\"font-style:normal;font-weight:100\">Python Sets<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column tw-mt-0 tw-mb-0 is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-buttons tw-mb-0 tw-mt-0 is-content-justification-right is-nowrap is-layout-flex wp-container-core-buttons-is-layout-5054138e wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-base-3-background-color has-background wp-element-button\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/python-built-in-functions-with-examples\/\" style=\"border-radius:0px\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\"><strong>Next <\/strong>\u2771\u2771<\/mark><\/a><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-right tw-mt-0 tw-mb-0 tw-link-hover-underline\" style=\"font-style:normal;font-weight:100\">Python Built-in Functions<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>What is a Python dictionary? Dictionaries are mutable data structures in Python that are similar to lists, sets, and tuples but are indexed by keys instead of numbers. They can &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Is Dictionary Mutable in Python?\" class=\"read-more button\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/#more-70348\" aria-label=\"Read more about Is Dictionary Mutable in Python?\">Read more<\/a><\/p>\n","protected":false},"author":1373,"featured_media":68342,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61036],"tags":[93728,93729,93727,93725,93726],"class_list":["post-70348","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-tutorial","tag-are-dictionaries-mutable-in-python","tag-dictionaries-in-python","tag-dictionary-is-mutable-or-immutable-in-python","tag-is-dictionary-mutable-in-python","tag-python-dictionary-is-mutable-or-immutable","resize-featured-image"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Is Dictionary Mutable in Python?<\/title>\n<meta name=\"description\" content=\"Is dictionary mutable in Python? Python dictionaries are mutable data structures like lists, sets, and tuples but are indexed by keys.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Is Dictionary Mutable in Python?\" \/>\n<meta property=\"og:description\" content=\"Is dictionary mutable in Python? Python dictionaries are mutable data structures like lists, sets, and tuples but are indexed by keys.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Itsourcecode.com\" \/>\n<meta property=\"article:author\" content=\"www.facebook.com\/unguardable7\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-19T08:39:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-25T09:14:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Dictionary.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1460\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prince Ly Cesar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/www.twitter.com\/unguardable0729\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prince Ly Cesar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/\"},\"author\":{\"name\":\"Prince Ly Cesar\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/8d6ff1c108160ddbd60ff17cbb9f626b\"},\"headline\":\"Is Dictionary Mutable in Python?\",\"datePublished\":\"2022-07-19T08:39:22+00:00\",\"dateModified\":\"2023-10-25T09:14:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/\"},\"wordCount\":595,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\"},\"image\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/PYTHON-TUTORIAL-Dictionary.png\",\"keywords\":[\"are dictionaries mutable in python\",\"dictionaries in python\",\"dictionary is mutable or immutable in python\",\"is dictionary mutable in python\",\"python dictionary is mutable or immutable\"],\"articleSection\":[\"Python Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/\",\"name\":\"Is Dictionary Mutable in Python?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/PYTHON-TUTORIAL-Dictionary.png\",\"datePublished\":\"2022-07-19T08:39:22+00:00\",\"dateModified\":\"2023-10-25T09:14:19+00:00\",\"description\":\"Is dictionary mutable in Python? Python dictionaries are mutable data structures like lists, sets, and tuples but are indexed by keys.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/PYTHON-TUTORIAL-Dictionary.png\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/PYTHON-TUTORIAL-Dictionary.png\",\"width\":1460,\"height\":900,\"caption\":\"Is Dictionary Mutable in Python?\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/is-dictionary-mutable-in-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/itsourcecode.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Is Dictionary Mutable in Python?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#website\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/\",\"name\":\"Itsourcecode.com\",\"description\":\"Partner In Your Coding Journey!\",\"publisher\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/itsourcecode.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\",\"name\":\"itsourcecode\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"width\":409,\"height\":409,\"caption\":\"itsourcecode\"},\"logo\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\"},\"description\":\"Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!\",\"sameAs\":[\"https:\\\/\\\/itsourcecode.com\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/8d6ff1c108160ddbd60ff17cbb9f626b\",\"name\":\"Prince Ly Cesar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"caption\":\"Prince Ly Cesar\"},\"description\":\"Hi there! I'm Prince Ly Cesar a Student in Carlos Hilado Memorial State College - Binalbagan Campus and a Graphic Designer, Programmer &amp; Writer in IT SourceCode\",\"sameAs\":[\"https:\\\/\\\/activadorkeys.com\\\/\",\"www.facebook.com\\\/unguardable7\",\"http:\\\/\\\/www.instagram.com\\\/prnclycsr\\\/\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/www.twitter.com\\\/unguardable0729\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCF0BIqB5tpnCmwvYQCHucmw?view_as=subscriber\"],\"gender\":\"male\",\"knowsAbout\":[\"Graphic Designing\"],\"knowsLanguage\":[\"English\",\"Tagalog\"],\"jobTitle\":\"Graphic Designer\",\"worksFor\":\"IT SourceCode\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/author\\\/unguardable\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Is Dictionary Mutable in Python?","description":"Is dictionary mutable in Python? Python dictionaries are mutable data structures like lists, sets, and tuples but are indexed by keys.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/","og_locale":"en_US","og_type":"article","og_title":"Is Dictionary Mutable in Python?","og_description":"Is dictionary mutable in Python? Python dictionaries are mutable data structures like lists, sets, and tuples but are indexed by keys.","og_url":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/","og_site_name":"Itsourcecode.com","article_author":"www.facebook.com\/unguardable7","article_published_time":"2022-07-19T08:39:22+00:00","article_modified_time":"2023-10-25T09:14:19+00:00","og_image":[{"width":1460,"height":900,"url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Dictionary.png","type":"image\/png"}],"author":"Prince Ly Cesar","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/www.twitter.com\/unguardable0729","twitter_misc":{"Written by":"Prince Ly Cesar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/#article","isPartOf":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/"},"author":{"name":"Prince Ly Cesar","@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/8d6ff1c108160ddbd60ff17cbb9f626b"},"headline":"Is Dictionary Mutable in Python?","datePublished":"2022-07-19T08:39:22+00:00","dateModified":"2023-10-25T09:14:19+00:00","mainEntityOfPage":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/"},"wordCount":595,"commentCount":0,"publisher":{"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc"},"image":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Dictionary.png","keywords":["are dictionaries mutable in python","dictionaries in python","dictionary is mutable or immutable in python","is dictionary mutable in python","python dictionary is mutable or immutable"],"articleSection":["Python Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/","url":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/","name":"Is Dictionary Mutable in Python?","isPartOf":{"@id":"https:\/\/itsourcecode.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/#primaryimage"},"image":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Dictionary.png","datePublished":"2022-07-19T08:39:22+00:00","dateModified":"2023-10-25T09:14:19+00:00","description":"Is dictionary mutable in Python? Python dictionaries are mutable data structures like lists, sets, and tuples but are indexed by keys.","breadcrumb":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/#primaryimage","url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Dictionary.png","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Dictionary.png","width":1460,"height":900,"caption":"Is Dictionary Mutable in Python?"},{"@type":"BreadcrumbList","@id":"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/itsourcecode.com\/"},{"@type":"ListItem","position":2,"name":"Is Dictionary Mutable in Python?"}]},{"@type":"WebSite","@id":"https:\/\/itsourcecode.com\/#website","url":"https:\/\/itsourcecode.com\/","name":"Itsourcecode.com","description":"Partner In Your Coding Journey!","publisher":{"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itsourcecode.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc","name":"itsourcecode","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","width":409,"height":409,"caption":"itsourcecode"},"logo":{"@id":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg"},"description":"Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!","sameAs":["https:\/\/itsourcecode.com\/"]},{"@type":"Person","@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/8d6ff1c108160ddbd60ff17cbb9f626b","name":"Prince Ly Cesar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","url":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","caption":"Prince Ly Cesar"},"description":"Hi there! I'm Prince Ly Cesar a Student in Carlos Hilado Memorial State College - Binalbagan Campus and a Graphic Designer, Programmer &amp; Writer in IT SourceCode","sameAs":["https:\/\/activadorkeys.com\/","www.facebook.com\/unguardable7","http:\/\/www.instagram.com\/prnclycsr\/","https:\/\/x.com\/http:\/\/www.twitter.com\/unguardable0729","https:\/\/www.youtube.com\/channel\/UCF0BIqB5tpnCmwvYQCHucmw?view_as=subscriber"],"gender":"male","knowsAbout":["Graphic Designing"],"knowsLanguage":["English","Tagalog"],"jobTitle":"Graphic Designer","worksFor":"IT SourceCode","url":"https:\/\/itsourcecode.com\/author\/unguardable\/"}]}},"_links":{"self":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/70348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/users\/1373"}],"replies":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/comments?post=70348"}],"version-history":[{"count":17,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/70348\/revisions"}],"predecessor-version":[{"id":119325,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/70348\/revisions\/119325"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/media\/68342"}],"wp:attachment":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/media?parent=70348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/categories?post=70348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/tags?post=70348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}