{"id":7610,"date":"2021-01-20T12:15:28","date_gmt":"2021-01-20T06:45:28","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=7610"},"modified":"2026-07-13T12:31:06","modified_gmt":"2026-07-13T07:01:06","slug":"plus-equal-to-in-python","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/","title":{"rendered":"Python += Operator: Add and Assign With Examples"},"content":{"rendered":"<p><strong>Quick answer:<\/strong> The += operator combines the current value with a right-hand value and assigns the result back to the variable. It may perform an in-place update for mutable objects or create a new object for immutable ones, so value equality does not tell the whole story.<\/p>\n<figure class=\"pythonpool-article-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/python-plus-equal-b105.png\" alt=\"Python Pool infographic showing the += operator combining a current value with a new value and assigning the result\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>+= combines an existing value with a right-hand value and assigns the result, but mutable and immutable types can update differently.<\/figcaption><\/figure>\n<p>The Python <code>+=<\/code> operator is augmented assignment. It adds the right-hand value to the left-hand target, then stores the result back into that target.<\/p>\n<p>The official Python documentation covers <a href=\"https:\/\/docs.python.org\/3\/reference\/simple_stmts.html#augmented-assignment-statements\">augmented assignment statements<\/a>, <a href=\"https:\/\/docs.python.org\/3\/reference\/datamodel.html#object.__iadd__\">__iadd__()<\/a>, and <a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes.html#mutable-sequence-types\">mutable sequence types<\/a>.<\/p>\n<p>For numbers, <code>x += y<\/code> is usually equivalent to <code>x = x + y<\/code>. For mutable objects such as lists, <code>+=<\/code> may update the object in place instead of creating a separate object.<\/p>\n<p>That difference matters when another name points to the same list. In-place updates are visible through both names, while rebinding with <code>+<\/code> can leave the older list unchanged.<\/p>\n<p>Use <code>+=<\/code> when it makes the update clearer and when in-place behavior is acceptable for the type involved.<\/p>\n<p>A useful way to read the operator is &#8220;add this and keep the result here.&#8221; The exact mechanics depend on the left-hand object. Some objects support an in-place update, while others return a new object and then store that result under the target name.<\/p>\n<p>When debugging, compare behavior with a second name pointing at the same object. If the second name sees the change, the object was updated in place. If it does not, the target was rebound to a separate object.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Add_To_A_Number\" >Add To A Number<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Add_To_A_String\" >Add To A String<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Extend_A_List_In_Place\" >Extend A List In Place<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Compare_With_For_Lists\" >Compare += With + For Lists<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Use_With_Tuples\" >Use += With Tuples<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Customize_With_iadd\" >Customize += With __iadd__<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Common_Mistakes\" >Common += Mistakes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Read_The_Assignment\" >Read The Assignment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Compare_Mutable_And_Immutable_Values\" >Compare Mutable And Immutable Values<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Use_Strings_And_Lists_Deliberately\" >Use Strings And Lists Deliberately<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Watch_Aliases_And_Tuples\" >Watch Aliases And Tuples<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Do_Not_Confuse_With_Increment\" >Do Not Confuse With Increment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Test_Value_And_Identity\" >Test Value And Identity<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#Frequently_Asked_Questions\" >Frequently Asked Questions<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Add_To_A_Number\"><\/span>Add To A Number<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>With numbers, <code>+=<\/code> updates the target with the numeric sum.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:105%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">count = 10\n\ncount += 5\n\nprint(count)\n<\/code><\/pre>\n<\/div>\n<p>This prints <code>15<\/code>.<\/p>\n<p>Numeric types such as integers and floats are immutable, so Python creates a new numeric object and stores it under the same name.<\/p>\n<p>This form is common for counters, totals, loop progress, and score calculations.<\/p>\n<p>It is also common in aggregation code. For example, a loop can start with <code>total = 0<\/code> and then use <code>total += amount<\/code> for each item being processed.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Add_To_A_String\"><\/span>Add To A String<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>With strings, <code>+=<\/code> appends text and stores the new string.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:105%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">message = \"Hello\"\n\nmessage += \", Python\"\n\nprint(message)\n<\/code><\/pre>\n<\/div>\n<p>This prints <code>Hello, Python<\/code>.<\/p>\n<p>Strings are immutable, so the original string is not edited in place. A new string is created.<\/p>\n<p>For many repeated string additions, collecting pieces in a list and using <code>\"\".join(parts)<\/code> can be more efficient and clearer.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Extend_A_List_In_Place\"><\/span>Extend A List In Place<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>With lists, <code>+=<\/code> extends the existing list object.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:105%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">items = [\"red\", \"green\"]\nalias = items\n\nitems += [\"blue\"]\n\nprint(items)\nprint(alias)\n<\/code><\/pre>\n<\/div>\n<p>Both prints show the added item because <code>items<\/code> and <code>alias<\/code> refer to the same list object.<\/p>\n<p>This is the same practical effect as <code>items.extend([\"blue\"])<\/code>.<\/p>\n<p>Use this form when changing the original list is intended. Make a copy first when another part of the program should keep the old list.<\/p>\n<p><!-- Python Pool visual layout repair 2026-07-13 --><\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/plus-equal-operands-b177.png\" alt=\"Python Pool infographic showing Python += operands, names, values, and in-place versus new objects\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Left and right: Python += operands, names, values, and in-place versus new objects.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Compare_With_For_Lists\"><\/span>Compare += With + For Lists<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <code>+<\/code> operator creates a new list when used with assignment.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:105%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">items = [\"red\", \"green\"]\nalias = items\n\nitems = items + [\"blue\"]\n\nprint(items)\nprint(alias)\n<\/code><\/pre>\n<\/div>\n<p>The first print includes <code>\"blue\"<\/code>, while the second print still shows the old list.<\/p>\n<p>This happens because <code>items = items + [\"blue\"]<\/code> creates a new list and binds the name <code>items<\/code> to it. The old list remains available through <code>alias<\/code>.<\/p>\n<p>This distinction is important in functions, shared state, and tests that compare object identity.<\/p>\n<p>Choose the style based on intent. Use <code>+=<\/code> when the same list should grow. Use <code>items = items + more<\/code> when a fresh list is clearer and older references should keep seeing the previous contents.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Use_With_Tuples\"><\/span>Use += With Tuples<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Tuples are immutable, so <code>+=<\/code> creates a new tuple.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:105%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">point = (10, 20)\nold_id = id(point)\n\npoint += (30,)\n\nprint(point)\nprint(old_id == id(point))\n<\/code><\/pre>\n<\/div>\n<p>This prints the updated tuple and then <code>False<\/code>, showing that the tuple object changed.<\/p>\n<p>The trailing comma in <code>(30,)<\/code> is required for a one-item tuple.<\/p>\n<p>Use tuples for fixed groups of values. If repeated in-place updates are needed, a list is usually a better fit.<\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/plus-equal-mutation-b177.png\" alt=\"Python Pool infographic comparing list += extension with tuple or integer reassignment\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Mutable objects: List += extension with tuple or integer reassignment.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Customize_With_iadd\"><\/span>Customize += With __iadd__<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Custom classes can define <code>__iadd__()<\/code> to control how <code>+=<\/code> behaves.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:105%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">class Score:\n    def __init__(self, points):\n        self.points = points\n\n    def __iadd__(self, extra):\n        self.points += extra\n        return self\n\nscore = Score(10)\nscore += 5\n\nprint(score.points)\n<\/code><\/pre>\n<\/div>\n<p>This class updates its own <code>points<\/code> attribute and returns itself.<\/p>\n<p>If <code>__iadd__()<\/code> is not available, Python can fall back to normal addition behavior when supported. Built-in types already define the behavior most code needs.<\/p>\n<p>When writing a custom class, return <code>self<\/code> from <code>__iadd__()<\/code> if the object is updated in place.<\/p>\n<p>Custom behavior should be unsurprising. If <code>+=<\/code> changes the object, document that fact and keep the operation close to normal addition semantics.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Common_Mistakes\"><\/span>Common += Mistakes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The first common mistake is assuming <code>+=<\/code> always creates a new object. Lists usually update in place, while numbers, strings, and tuples produce new objects.<\/p>\n<p>The second mistake is using <code>+=<\/code> on a shared list without realizing other names will see the change.<\/p>\n<p>The third mistake is forgetting that <code>+=<\/code> still assigns back to the left-hand target. Inside a function, that can affect scope rules when the target name is also used earlier in the function.<\/p>\n<p>In short, use <code>+=<\/code> for clear additive updates, remember that mutable objects may change in place, and use a copy when shared data should not be modified.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Read_The_Assignment\"><\/span>Read The Assignment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>x += y is shorthand for updating x with the result of an addition-like operation, but the exact method dispatch belongs to the object&#8217;s type. Keep the operands compatible and the intended mutation explicit.<\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/plus-equal-types-b177.png\" alt=\"Python Pool infographic mapping numeric, string, list, and custom object += operations\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Type behavior: Numeric, string, list, and custom object += operations.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Compare_Mutable_And_Immutable_Values\"><\/span>Compare Mutable And Immutable Values<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Integers, floats, and strings are immutable, so a new value is assigned. Lists can often extend themselves in place, which means another reference to the same list may observe the change.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Use_Strings_And_Lists_Deliberately\"><\/span>Use Strings And Lists Deliberately<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>String += concatenates text repeatedly but can be inefficient in large loops; collect pieces and join them when appropriate. List += extends with an iterable, not necessarily one single element.<\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/plus-equal-check-b177.png\" alt=\"Python Pool infographic testing aliases, identity, unsupported types, and validation\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Operator checks: Aliases, identity, unsupported types, and validation.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Watch_Aliases_And_Tuples\"><\/span>Watch Aliases And Tuples<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A tuple can contain a mutable object, and += on a nested mutable value can produce surprising behavior when assignment back to the tuple is involved. Test identity and ownership when aliases matter.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Do_Not_Confuse_With_Increment\"><\/span>Do Not Confuse With Increment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Python has no universal ++ operator. += works with supported types and values, while numeric increment is only one common use of the operator.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Test_Value_And_Identity\"><\/span>Test Value And Identity<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Test numbers, strings, lists, tuples, incompatible types, aliases, and custom classes. Assert both the resulting value and whether the original object identity should change.<\/p>\n<p>The <a href=\"https:\/\/docs.python.org\/3\/reference\/simple_stmts.html#augmented-assignment-statements\">official augmented-assignment reference<\/a> explains += behavior. Related Python Pool references include <a href=\"2\">lists<\/a> and <a href=\"https:\/\/www.pythonpool.com\/python-testing-framework\/\">tests<\/a>.<\/p>\n<p>For related assignment behavior, compare <a href=\"2\">mutable lists<\/a>, <a href=\"https:\/\/www.pythonpool.com\/python-testing-framework\/\">identity tests<\/a>, and <a href=\"1\">string operations<\/a> when using +=.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span>Frequently Asked Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3>What does += mean in Python?<\/h3>\n<p>It adds or combines the right-hand value with the left-hand variable and assigns the result back to that variable.<\/p>\n<h3>Is += the same as x = x + y?<\/h3>\n<p>They often produce the same value, but mutable objects can implement in-place updates, so identity and side effects may differ.<\/p>\n<h3>Can I use += with strings and lists?<\/h3>\n<p>Yes. Strings concatenate into a new immutable value, while lists can be extended in place when the operation is supported.<\/p>\n<h3>Why does += raise a TypeError?<\/h3>\n<p>The operands or their types may not support the operation, or Python cannot combine them according to the type&#8217;s rules.<\/p>\n<p><script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"What does += mean in Python?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"It adds or combines the right-hand value with the left-hand variable and assigns the result back to that variable.\"}},{\"@type\":\"Question\",\"name\":\"Is += the same as x = x + y?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"They often produce the same value, but mutable objects can implement in-place updates, so identity and side effects may differ.\"}},{\"@type\":\"Question\",\"name\":\"Can I use += with strings and lists?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes. Strings concatenate into a new immutable value, while lists can be extended in place when the operation is supported.\"}},{\"@type\":\"Question\",\"name\":\"Why does += raise a TypeError?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The operands or their types may not support the operation, or Python cannot combine them according to the type's rules.\"}}]}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how Python&#8217;s += operator updates numbers, strings, lists, and custom objects, including mutation, type behavior, and common mistakes.<\/p>\n","protected":false},"author":1,"featured_media":33926,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[15],"tags":[3345,3346,3344,3348,3347],"class_list":["post-7610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-addition","tag-do-in-python","tag-python-2","tag-plus-equal-to-in-python","tag-what-does-in-python","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v28.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python += Operator: Add and Assign With Examples<\/title>\n<meta name=\"description\" content=\"Learn how Python&#039;s += operator updates numbers, strings, lists, and custom objects, including mutation, type behavior, and common mistakes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python += Operator: Add and Assign With Examples\" \/>\n<meta property=\"og:description\" content=\"Learn how Python&#039;s += operator updates numbers, strings, lists, and custom objects, including mutation, type behavior, and common mistakes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-20T06:45:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-13T07:01:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/python-plus-equal-b105.png\" \/>\n<meta name=\"author\" content=\"Python Pool\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Python Pool\" \/>\n<meta name=\"twitter:description\" content=\"Practical Python tutorials, error fixes, code examples, and project guides.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/python-plus-equal-b105.png\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Python Pool\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/\"},\"author\":{\"name\":\"Python Pool\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/person\\\/f87448ee54c0ffd2889fbf2408c18998\"},\"headline\":\"Python += Operator: Add and Assign With Examples\",\"datePublished\":\"2021-01-20T06:45:28+00:00\",\"dateModified\":\"2026-07-13T07:01:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/\"},\"wordCount\":1131,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/python-plus-equal-operator-guide-pythonpool.png\",\"keywords\":[\"+= Addition\",\"+= do in python\",\"+= python\",\"plus equal to in python\",\"what does += in python\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/\",\"name\":\"Python += Operator: Add and Assign With Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/python-plus-equal-operator-guide-pythonpool.png\",\"datePublished\":\"2021-01-20T06:45:28+00:00\",\"dateModified\":\"2026-07-13T07:01:06+00:00\",\"description\":\"Learn how Python's += operator updates numbers, strings, lists, and custom objects, including mutation, type behavior, and common mistakes.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/python-plus-equal-operator-guide-pythonpool.png\",\"contentUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/python-plus-equal-operator-guide-pythonpool.png\",\"width\":1350,\"height\":650,\"caption\":\"Python plus equal operator guide\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/plus-equal-to-in-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pythonpool.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python += Operator: Add and Assign With Examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#website\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/\",\"name\":\"Python Pool\",\"description\":\"Practical Python tutorials, error fixes, code examples, and project guides.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pythonpool.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/aa.png\",\"contentUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/pythonpool\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/person\\\/f87448ee54c0ffd2889fbf2408c18998\",\"name\":\"Python Pool\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"caption\":\"Python Pool\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python += Operator: Add and Assign With Examples","description":"Learn how Python's += operator updates numbers, strings, lists, and custom objects, including mutation, type behavior, and common mistakes.","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:\/\/www.pythonpool.com\/plus-equal-to-in-python\/","og_locale":"en_US","og_type":"article","og_title":"Python += Operator: Add and Assign With Examples","og_description":"Learn how Python's += operator updates numbers, strings, lists, and custom objects, including mutation, type behavior, and common mistakes.","og_url":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/","og_site_name":"Python Pool","article_published_time":"2021-01-20T06:45:28+00:00","article_modified_time":"2026-07-13T07:01:06+00:00","og_image":[{"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/python-plus-equal-b105.png","type":"","width":"","height":""}],"author":"Python Pool","twitter_card":"summary_large_image","twitter_title":"Python Pool","twitter_description":"Practical Python tutorials, error fixes, code examples, and project guides.","twitter_image":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/python-plus-equal-b105.png","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Python Pool","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/"},"author":{"name":"Python Pool","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998"},"headline":"Python += Operator: Add and Assign With Examples","datePublished":"2021-01-20T06:45:28+00:00","dateModified":"2026-07-13T07:01:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/"},"wordCount":1131,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/python-plus-equal-operator-guide-pythonpool.png","keywords":["+= Addition","+= do in python","+= python","plus equal to in python","what does += in python"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/","url":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/","name":"Python += Operator: Add and Assign With Examples","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/python-plus-equal-operator-guide-pythonpool.png","datePublished":"2021-01-20T06:45:28+00:00","dateModified":"2026-07-13T07:01:06+00:00","description":"Learn how Python's += operator updates numbers, strings, lists, and custom objects, including mutation, type behavior, and common mistakes.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/python-plus-equal-operator-guide-pythonpool.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/python-plus-equal-operator-guide-pythonpool.png","width":1350,"height":650,"caption":"Python plus equal operator guide"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/plus-equal-to-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Python += Operator: Add and Assign With Examples"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Practical Python tutorials, error fixes, code examples, and project guides.","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998","name":"Python Pool","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","caption":"Python Pool"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/7610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=7610"}],"version-history":[{"count":22,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/7610\/revisions"}],"predecessor-version":[{"id":41540,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/7610\/revisions\/41540"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/33926"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=7610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=7610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=7610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}