{"id":3085,"date":"2020-03-09T16:29:10","date_gmt":"2020-03-09T10:59:10","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=3085"},"modified":"2021-06-14T14:58:30","modified_gmt":"2021-06-14T09:28:30","slug":"python-del","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/python-del\/","title":{"rendered":"Python del Keyword [With Examples]"},"content":{"rendered":"\n<p>Everything in&nbsp;Python&nbsp;is an object, and almost everything has attributes and methods. So the main objective of Python del is to delete the objects in the python programming language. Here object can be <strong>variables, lists, or parts of a list etc.<\/strong><\/p>\n\n\n\n<p>Each&nbsp;<em><code>object<\/code>&nbsp;<\/em>is any kind of Python object. Usually, these are variables, but they can be functions, modules, classes.<\/p>\n\n\n\n<p>The&nbsp;<strong>del<\/strong>&nbsp;statement works by&nbsp;<em>unbinding<\/em>&nbsp;the name, removing it from the set of names known to the <a href=\"http:\/\/www.pythonpool.com\/is-python-compiled-interpreted-or-both\/\" >Python interpreter<\/a>. If this variable was the last remaining reference to an object, the object will be removed from memory. If, on the other hand, other variables still refer to this object, the object won&#8217;t be deleted.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 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\/python-del\/#How_to_delete_or_remove_the_element_in_Python\" >How to delete or remove the element in Python<\/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\/python-del\/#What_is_Python_del\" >What is Python del?<\/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\/python-del\/#Syntax_of_Python_del\" >Syntax of Python del<\/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\/python-del\/#Return_Value_of_Python_del\" >Return Value of Python del<\/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\/python-del\/#Point_to_Be_Noted\" >Point to Be Noted<\/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\/python-del\/#Python_del_Statement_Examples\" >Python del Statement Examples<\/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\/python-del\/#Example_1_Deleting_a_variable\" >Example 1: Deleting a variable<\/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\/python-del\/#Example_2_Deleting_the_First_Item_in_a_List\" >Example 2: Deleting the First Item in a List<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Explanation\" >Explanation:<\/a><\/li><\/ul><\/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\/python-del\/#Example_3_Deleting_the_Last_Item_in_a_List\" >Example 3: Deleting the Last Item in a List<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Explanation-2\" >Explanation:<\/a><\/li><\/ul><\/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\/python-del\/#Example_4_Delete_an_User-Defined_Object\" >Example 4: Delete an User-Defined Object<\/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\/python-del\/#Example_5_Deleting_all_the_Elements_in_a_Range\" >Example 5: Deleting all the Elements in a Range<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Explanation-3\" >Explanation:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Example_6_Python_Program_to_Remove_a_Key_From_a_Dictionary\" >Example 6: Python Program to Remove a Key From a Dictionary<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Python_del_Additional_Tips_Point_to_be_Noted_and_Examples\" >Python del: Additional Tips, Point to be Noted and Examples<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Difference_Between_remove_Python_del_and_pop_in_Python\" >Difference Between remove, Python del and pop in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Example_of_remove_Python_del_and_pop\" >Example of remove, Python del and pop<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Running_Time\" >Running Time<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Which_is_the_best_way_to_delete_the_element_in_List\" >Which is the best way to delete the element in List?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Difference_Between_Python_del_vs_Assigning_to_None\" >Difference Between Python del vs Assigning to None<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.pythonpool.com\/python-del\/#When_should_and_shouldnt_I_use_the_del_keyword_in_Python\" >When should and shouldn&#8217;t I use the del keyword in Python?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Must_Read\" >Must Read:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.pythonpool.com\/python-del\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_delete_or_remove_the_element_in_Python\"><\/span> <strong>How to delete or remove the element <\/strong>in Python <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are 3 different ways of removing or deleting elements in Python.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>remove<\/li><li>del<\/li><li>pop<\/li><\/ol>\n\n\n\n<p>But in this tutorial, we will learn about the working of Python del.<\/p>\n\n\n\n<h2 class=\"has-text-color wp-block-heading\" style=\"color:#ff0000\"><span class=\"ez-toc-section\" id=\"What_is_Python_del\"><\/span>What is Python del?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The Python del is generally used to remove the variable&nbsp;from the local or global namespace. This is used to recover memory from data that is no longer needed.<\/p>\n\n\n\n<h2 class=\"has-text-color wp-block-heading\" style=\"color:#008000\"><span class=\"ez-toc-section\" id=\"Syntax_of_Python_del\"><\/span>Syntax of Python del<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>del obj_name<\/code><\/pre>\n\n\n\n<p>Here, <strong>del<\/strong>&nbsp;is a Python keyword. And,&nbsp;obj_name&nbsp;can be variables, user-defined objects, lists, items&nbsp;within lists, dictionaries etc.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Return_Value_of_Python_del\"><\/span>Return Value of Python del<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Python del statement doesn&#8217;t return anything.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Point_to_Be_Noted\"><\/span>Point to Be Noted<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The&nbsp;<strong>del<\/strong>&nbsp;statement can be used to remove an item from a list by referring to its index, rather than its value.<\/p>\n\n\n\n<p>Now let&#8217;s jump directly into examples and check out the working of <strong>Python del statement<\/strong>.<\/p>\n\n\n\n<h2 class=\"has-text-color wp-block-heading\" style=\"color:#7b6ceb\"><span class=\"ez-toc-section\" id=\"Python_del_Statement_Examples\"><\/span>Python del Statement Examples<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let&#8217;s see some examples of del statement and try to delete some objects.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_1_Deleting_a_variable\"><\/span>Example 1: Deleting a variable<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>var = \"Python Pool\"\n\ndel var\n\nprint(var)<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  File \"c:\/Users\/Karan\/Desktop\/test.py\", line 5, in &lt;module>\n    print(var)\nNameError: name 'var' is not defined<\/code><\/pre>\n\n\n\n<p>Here the output of the above example is &#8216;var&#8217; is not defined. In this example, we get an error because the Python del operator deletes the variable. And now there is no variable named <em>var <\/em>stored in the memory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_2_Deleting_the_First_Item_in_a_List\"><\/span>Example 2: Deleting the First Item in a List<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>list = [\"Learn\", \"Python\", \"Pool\"]\n\ndel list[0]\n\nprint(list)<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>['Python', 'Pool']<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Explanation\"><\/span>Explanation:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In the above example, first, we have created our list named list. The above list contains three elements ( learn, python, pool ). After that, we deleted the first element of the list by using the operator <strong>del list[0]<\/strong>. Then we printed the list after deleting the first element of the list. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_3_Deleting_the_Last_Item_in_a_List\"><\/span>Example 3: Deleting the Last Item in a List<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>list = [\"Learn\", \"Python\", \"Pool\"]\n\ndel list[-1]\n\nprint(list)<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>['Learn', 'Python']<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Explanation-2\"><\/span>Explanation:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In the above example, first, we have created our list named list. The above list contains three elements ( learn, python, pool ). After that, we deleted the last element of the list by using the operator <strong>del list[-1]<\/strong>. Then we printed the list after deleting the last element of the list. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_4_Delete_an_User-Defined_Object\"><\/span>Example 4: Delete an User-Defined Object<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Python Program to Delete a class&#8217;s object using Python del.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Python Program to Delete a class's object\n\n# defining a class\nclass student:\n    name = \"Karan\"\n    age = 22\n\n# declaring object to the student class\nstd = student()\n\n# printing values\nprint(\"Name: \", std.name)\nprint(\"Age: \", std.age)\n\n# deleting the object \ndel std\n\n# printing values - will generate NameError\nprint(\"Name: \", std.name)\nprint(\"Age: \", std.age)<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Name:  Karan\nAge:  22\nTraceback (most recent call last):\n  File \"c:\/Users\/Karan\/Desktop\/test.py\", line 19, in &lt;module>\n    print(\"Name: \", std.name)\nNameError: name 'std' is not defined<\/code><\/pre>\n\n\n\n<p>In the above example, we deleted the object std using del std. For the first time, we get our desired output. This is because we haven&#8217;t used the <strong>del<\/strong> keyword. But after using the <strong>del std<\/strong> in our object. We got the name error as the object is deleted from the memory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_5_Deleting_all_the_Elements_in_a_Range\"><\/span>Example 5: <strong>Deleting all the Elements in a Range<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># initializing list  \nlis = &#91;16, 1, 34, 15, 904, 'Python', 'Pool'] \n  \n# using del to delete elements from pos. 2 to 5 \n# deletes 34, 15, 904\ndel lis&#91;2 : 5] \nprint(lis)<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[16, 1, 'Python', 'Pool']<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Explanation-3\"><\/span>Explanation:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>So, in this example, we have initialized a list with 7 elements in it. Then we deleted the elements in position 2 to 5. With the help of slicing and Python del keyword.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_6_Python_Program_to_Remove_a_Key_From_a_Dictionary\"><\/span>Example 6: Python Program to Remove a Key From a Dictionary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Dict = {'w':101,'x':102,'y':103,'z':104}\nprint(Dict)\nif 'x' in Dict: \n    del Dict&#91;'x']\nprint(Dict)<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{'w': 101, 'x': 102, 'y': 103, 'z': 104}\n{'w': 101, 'y': 103, 'z': 104}<\/code><\/pre>\n\n\n\n<p>In the above example, we removed a key: value pair from a dictionary. We have 4 pair int the dictionary initially. After deleting the dictionary key <strong>x <\/strong>we only have 3 elements in the dictionary.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Python_del_Additional_Tips_Point_to_be_Noted_and_Examples\"><\/span>Python del: Additional Tips, Point to be Noted and Examples<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can&#8217;t delete items of tuples and strings. It&#8217;s because tuples and strings are immutables; objects that can&#8217;t be changed after its creation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nmy_tuple = (1, 2, 3)\n\n# Error: 'tuple' object doesn't support item deletion\ndel my_tuple[1]<\/code><\/pre>\n\n\n\n<p>However, you can delete an entire tuple or string.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>my_tuple = (1, 2, 3)\n\n# deleting tuple\ndel my_tuple<\/code><\/pre>\n\n\n\n<h2 class=\"has-text-color wp-block-heading\" style=\"color:#c9b21b\"><span class=\"ez-toc-section\" id=\"Difference_Between_remove_Python_del_and_pop_in_Python\"><\/span>Difference Between remove, Python del and pop in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><code>remove()<\/code>&nbsp;delete the matching element\/object whereas&nbsp;<code>del<\/code>&nbsp;and&nbsp;<code>pop<\/code>&nbsp;removes the element at a specific index.<\/li><li>&nbsp;<code>del<\/code>&nbsp;and&nbsp;<code>pop<\/code>&nbsp;deals with the index. The only difference between&nbsp;the two is that-&nbsp;<code>pop<\/code>&nbsp;return deleted the value from the list and <strong>del&nbsp;does not return anything.<\/strong><\/li><li><strong>Pop&nbsp;is the <\/strong>only way that returns the object.<\/li><li>Remove&nbsp;is the only one that searches the object (not index).<\/li><\/ul>\n\n\n\n<p><strong>In Summary:<\/strong> Use <strong>del <\/strong>to remove an element by index, <strong>pop<\/strong>\u00a0to remove it by index if you need the returned value, and <strong>remove<\/strong>\u00a0to delete an element by value.<\/p>\n\n\n\n<h2 class=\"has-pale-cyan-blue-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_of_remove_Python_del_and_pop\"><\/span>Example of remove, Python del and pop<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># (1) Remove an item with index\nA = &#91;1, 2, 4, 3, 4]\nA.remove(4)\n# This will print &#91;1, 2, 3, 4]\nprint(\"Example 1 : A = {}\".format(A))\n \n# (2) Delete an item with index\nA = &#91;1, 2, 4, 3, 4]\ndel A&#91;2]\n# This will print &#91;1, 2, 3, 4]\nprint(\"Example 2 : A = {}\".format(A))\n \n# (3) Delete all items\nA = &#91;1, 2, 4, 3, 4]\ndel A&#91;:]\n# This will print &#91;]\nprint(\"Example 3 : A = {}\".format(A))\n \n# (4) Delete a slice 2, 4\nA = &#91;1, 2, 4, 3, 4]\ndel A&#91;1:3]\n# This will print &#91;1, 3, 4]\nprint(\"Example 4 : A = {}\".format(A))\n \n# (5) pop: remove and get the last item\nA = &#91;1, 2, 4, 3, 4]\nx = A.pop()\n# This will print &#91;1, 2, 4, 3]\nprint(\"Example 5 : A = {}\".format(A))\n# This will print 4\nprint(\"Example 5 : x = {}\".format(x))\n \n# (6) pop with index: remove and get the second item\nA = &#91;1, 2, 4, 3, 4]\nx = A.pop(1)\n# This will print &#91;1, 4, 3, 4]\nprint(\"Example 6 : A = {}\".format(A))\n# This will print 2\nprint(\"Example 6 : x = {}\".format(x))<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Example 1 : A = &#91;1, 2, 3, 4]\nExample 2 : A = &#91;1, 2, 3, 4]\nExample 3 : A = &#91;]\nExample 4 : A = &#91;1, 3, 4]\nExample 5 : A = &#91;1, 2, 4, 3]\nExample 5 : x = 4\nExample 6 : A = &#91;1, 4, 3, 4]\nExample 6 : x = 2<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Running_Time\"><\/span>Running Time<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Computational complexity (i.e. running time or Big-O) is as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>del O(n)<\/li><li>pop O(1)<\/li><li>remove O(n)<\/li><\/ul>\n\n\n\n<p>Note that these running times are the worst-case scenarios. For example, deleting an element at the beginning of the list takes constant time.<\/p>\n\n\n\n<h2 class=\"has-pale-pink-color has-text-color wp-block-heading\" id=\"best-way\"><span class=\"ez-toc-section\" id=\"Which_is_the_best_way_to_delete_the_element_in_List\"><\/span>Which is the best way to delete the element in List?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>If you want to delete a specific object in the list, use\u00a0<code>remove<\/code>\u00a0method.<\/li><li>If you want to delete\u00a0the object at a specific location (index) in the list, you can either use\u00a0<code>del<\/code>\u00a0or\u00a0<code>pop<\/code>.<\/li><li>Use the\u00a0<code>pop<\/code>, if you want to delete and get the object at the specific location.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Difference_Between_Python_del_vs_Assigning_to_None\"><\/span> Difference Between Python del vs Assigning to None<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The difference is that&nbsp;<strong>x = None<\/strong>&nbsp;will free whatever it referenced but keep the name around even though it\u2019s just referencing None (which is a type, NoneType).<\/p>\n\n\n\n<p>On the other hand,\u00a0del x\u00a0will completely remove both the name and what it referenced. If you thereafter try to use x a NameError will be thrown (or AttributeError in case of an object property).<\/p>\n\n\n\n<p>So in practice, by assigning None to a name you can still use it in expressions while using del the name is completely removed. In the first case, a few <a href=\"https:\/\/en.wikipedia.org\/wiki\/Byte\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"bytes (opens in a new tab)\">bytes<\/a> are needed to keep the name in memory, while the later completely clears all memory usage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"When_should_and_shouldnt_I_use_the_del_keyword_in_Python\"><\/span><strong>When should and shouldn&#8217;t I use the del keyword in Python?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\n\nUse the &#8216;del&#8217; statement when you want to remove an item from a list and you know you will never need to reference that item again.<\/p>\n\n\n\n<p>If you want to hang on to the removed list item for whatever reason, use the &#8216;pop&#8217; method instead.<\/p>\n\n\n\n<h2 class=\"has-vivid-red-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"Must_Read\"><\/span>Must Read:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"http:\/\/www.pythonpool.com\/python-lowercase\/\">How to Convert String to Lowercase in<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/square-root-in-python\/\">How to Calculate Square Root<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/python-user-input\/\">User Input | Input () Function | Keyboard Input<\/a><\/li><li><a href=\"http:\/\/www.pythonpool.com\/python-book\/\">Best Book to Learn Python in 2020<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>Python del is a useful keyword.<\/strong>\u00a0Its syntax may be confusing at first. But once we use del more like an operator, not a method call, it is easy to remember. <\/p>\n\n\n\n<p>Deletion is recursively defined very similar to the way assignment is defined. Rather than spelling it out in full details, here are some hints. Deleting a target list recursively deletes each target, from left to right.<\/p>\n\n\n\n<p>Try to run the programs on your side and let me know if you have any queries.<\/p>\n\n\n\n<p><strong><em>Happy Coding!<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Everything in&nbsp;Python&nbsp;is an object, and almost everything has attributes and methods. So the main objective of Python del is to delete the objects in the &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Python del Keyword [With Examples]\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/python-del\/#more-3085\" aria-label=\"More on Python del Keyword [With Examples]\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":3109,"comment_status":"open","ping_status":"open","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":[867,855,880,870,883,869,876,884,871,854,878,861,882,862,858,881,865,886,875,877,857,872,887,863,856,888,879,864,874,873,859,868,866,860,885,889],"class_list":["post-3085","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-del-command-python","tag-del-dictionary-python","tag-del-element-from-list-python","tag-del-element-in-list-python","tag-del-function-python-3","tag-del-in-python","tag-del-key-from-dict-python","tag-del-keyword-python","tag-del-list-element-python","tag-del-list-python","tag-del-operator-python","tag-del-python","tag-del-python-3","tag-del-python-list","tag-del-statement-python","tag-del-variable-python","tag-del-vs-remove-python","tag-list-del-python","tag-pop-vs-del-python","tag-python-3-del","tag-python-del","tag-python-del-dictionary","tag-python-del-from-list","tag-python-del-keyword","tag-python-del-list","tag-python-del-statement","tag-python-del-time-complexity","tag-python-del-vs-pop","tag-python-dict-del","tag-python-dictionary-del","tag-python-list-del","tag-python-pop-vs-del","tag-python-remove-vs-del","tag-using-del-in-python","tag-what-does-del-do-in-python","tag-what-is-del-in-python","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python del Keyword [With Examples] - Python Pool<\/title>\n<meta name=\"description\" content=\"The main objective of Python del is to delete the objects in the python programming. Here object can be variables, lists, or parts of a list.\" \/>\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\/python-del\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python del Keyword [With Examples]\" \/>\n<meta property=\"og:description\" content=\"Everything in&nbsp;Python&nbsp;is an object, and almost everything has attributes and methods. So the main objective of Python del is to delete the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/python-del\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-09T10:59:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-14T09:28:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/03\/Capture-3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1019\" \/>\n\t<meta property=\"og:image:height\" content=\"615\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Python Pool\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\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=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/python-del\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-del\/\"},\"author\":{\"name\":\"Python Pool\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998\"},\"headline\":\"Python del Keyword [With Examples]\",\"datePublished\":\"2020-03-09T10:59:10+00:00\",\"dateModified\":\"2021-06-14T09:28:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-del\/\"},\"wordCount\":1171,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-del\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/03\/Capture-3.jpg\",\"keywords\":[\"del command python\",\"del dictionary python\",\"del element from list python\",\"del element in list python\",\"del function python 3\",\"del in python\",\"del key from dict python\",\"del keyword python\",\"del list element python\",\"del list python\",\"del operator python\",\"del python\",\"del python 3\",\"del python list\",\"del statement python\",\"del variable python\",\"del vs remove python\",\"list del python\",\"pop vs del python\",\"python 3 del\",\"python del\",\"python del dictionary\",\"python del from list\",\"python del keyword\",\"python del list\",\"python del statement\",\"python del time complexity\",\"python del vs pop\",\"python dict del\",\"python dictionary del\",\"python list del\",\"python pop vs del\",\"python remove vs del\",\"using del in python\",\"what does del do in python\",\"what is del in python\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/python-del\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/python-del\/\",\"url\":\"https:\/\/www.pythonpool.com\/python-del\/\",\"name\":\"Python del Keyword [With Examples] - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-del\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-del\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/03\/Capture-3.jpg\",\"datePublished\":\"2020-03-09T10:59:10+00:00\",\"dateModified\":\"2021-06-14T09:28:30+00:00\",\"description\":\"The main objective of Python del is to delete the objects in the python programming. Here object can be variables, lists, or parts of a list.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-del\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/python-del\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/python-del\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/03\/Capture-3.jpg\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/03\/Capture-3.jpg\",\"width\":1019,\"height\":615,\"caption\":\"Python del\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/python-del\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python del Keyword [With Examples]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"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\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/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:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"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 del Keyword [With Examples] - Python Pool","description":"The main objective of Python del is to delete the objects in the python programming. Here object can be variables, lists, or parts of a list.","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\/python-del\/","og_locale":"en_US","og_type":"article","og_title":"Python del Keyword [With Examples]","og_description":"Everything in&nbsp;Python&nbsp;is an object, and almost everything has attributes and methods. So the main objective of Python del is to delete the","og_url":"https:\/\/www.pythonpool.com\/python-del\/","og_site_name":"Python Pool","article_published_time":"2020-03-09T10:59:10+00:00","article_modified_time":"2021-06-14T09:28:30+00:00","og_image":[{"width":1019,"height":615,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/03\/Capture-3.jpg","type":"image\/jpeg"}],"author":"Python Pool","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Python Pool","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/python-del\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/python-del\/"},"author":{"name":"Python Pool","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998"},"headline":"Python del Keyword [With Examples]","datePublished":"2020-03-09T10:59:10+00:00","dateModified":"2021-06-14T09:28:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-del\/"},"wordCount":1171,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-del\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/03\/Capture-3.jpg","keywords":["del command python","del dictionary python","del element from list python","del element in list python","del function python 3","del in python","del key from dict python","del keyword python","del list element python","del list python","del operator python","del python","del python 3","del python list","del statement python","del variable python","del vs remove python","list del python","pop vs del python","python 3 del","python del","python del dictionary","python del from list","python del keyword","python del list","python del statement","python del time complexity","python del vs pop","python dict del","python dictionary del","python list del","python pop vs del","python remove vs del","using del in python","what does del do in python","what is del in python"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/python-del\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/python-del\/","url":"https:\/\/www.pythonpool.com\/python-del\/","name":"Python del Keyword [With Examples] - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-del\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-del\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/03\/Capture-3.jpg","datePublished":"2020-03-09T10:59:10+00:00","dateModified":"2021-06-14T09:28:30+00:00","description":"The main objective of Python del is to delete the objects in the python programming. Here object can be variables, lists, or parts of a list.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/python-del\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/python-del\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/python-del\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/03\/Capture-3.jpg","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/03\/Capture-3.jpg","width":1019,"height":615,"caption":"Python del"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/python-del\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Python del Keyword [With Examples]"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","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":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/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:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","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\/3085","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=3085"}],"version-history":[{"count":23,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3085\/revisions"}],"predecessor-version":[{"id":13452,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/3085\/revisions\/13452"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/3109"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=3085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=3085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=3085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}