{"id":78,"date":"2018-05-12T09:45:56","date_gmt":"2018-05-12T09:45:56","guid":{"rendered":"http:\/\/www.programminginpython.com\/2023\/03\/30\/python-lists-add-append-modify-remove-slice\/"},"modified":"2023-05-14T14:25:13","modified_gmt":"2023-05-14T14:25:13","slug":"python-lists-add-append-modify-remove-slice","status":"publish","type":"post","link":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/","title":{"rendered":"Python Lists \u2013 Add, Append, Modify, Remove, Slice"},"content":{"rendered":"<p>Hello folks, welcome back to <a href=\"https:\/\/www.programminginpython.com\/\" target=\"_blank\" rel=\"noopener\">programminginpython.com<\/a>. In this post, we will learn about Lists in Python. Here we perform the basic operations on a list like adding items to a list, appending an item at the end of the list, modifying the value of the item in the list, removing an item from the list, removing all the items from the list, and some slicing operations. So basically all the Python List operations are performed.<\/p>\n<blockquote><p><span style=\"color: #0000ff;\">Master the basics of data analysis in Python. Expand your skillset by learning scientific computing with numpy.<\/span><\/p>\n<p><span style=\"color: #0000ff;\">Take the course on Introduction to Python on <span style=\"color: #ffd343;\"><a style=\"color: #ffd343;\" href=\"https:\/\/bit.ly\/join_datacamp\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">DataCamp<\/a><\/span> here <\/span><span style=\"color: #ffd343;\"><a style=\"color: #ffd343;\" href=\"https:\/\/bit.ly\/datacamp-intro-to-python\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https:\/\/bit.ly\/datacamp-intro-to-python<\/a><\/span><\/p><\/blockquote>\n<p class=\"extra_btn_para\"><span class=\"wdg\"> <a href=\"https:\/\/github.com\/avinashn\/programminginpython.com\/blob\/master\/listOperations.py\" target=\"_blank\" rel=\"noopener noreferrer\"> <i class=\"fa fa-github fa-lg\"><\/i> Program on Github<\/a><\/span><\/p>\n<div class=\"yrc-shell-cover yrc-single\" data-yrc-uid=\"69e15bc58f58b\" data-yrc-channel=\"{&quot;meta&quot;:{&quot;user&quot;:&quot;Programming In Python&quot;,&quot;channel&quot;:&quot;UCLBlXUMLYLxopRljNdLXOeQ&quot;,&quot;key&quot;:&quot;yrc_1683138754&quot;,&quot;apikey&quot;:&quot;AIzaSyC3vU6rFyzsO0shrRsAWmjuSiuWYTQhafc&quot;,&quot;cache&quot;:&quot;1440&quot;,&quot;channel_uploads&quot;:&quot;UULBlXUMLYLxopRljNdLXOeQ&quot;,&quot;onlyonce&quot;:&quot;&quot;,&quot;tag&quot;:&quot;&quot;,&quot;per_page&quot;:&quot;24&quot;,&quot;maxv&quot;:&quot;0&quot;,&quot;consent&quot;:{&quot;ask&quot;:&quot;&quot;,&quot;url&quot;:&quot;&quot;},&quot;ads&quot;:&quot;1&quot;,&quot;uid&quot;:&quot;69e15bc58f58b&quot;,&quot;nocookie&quot;:&quot;&quot;,&quot;single&quot;:true},&quot;style&quot;:{&quot;colors&quot;:{&quot;item&quot;:{&quot;background&quot;:&quot;inherit&quot;},&quot;button&quot;:{&quot;background&quot;:&quot;#333&quot;,&quot;color&quot;:&quot;#fff&quot;},&quot;color&quot;:{&quot;text&quot;:&quot;#fff&quot;,&quot;link&quot;:&quot;inherit&quot;,&quot;menu&quot;:&quot;#000&quot;,&quot;meta&quot;:&quot;inherit&quot;}},&quot;theme&quot;:{&quot;videos&quot;:{&quot;style&quot;:&quot;__grid&quot;,&quot;thumb&quot;:[&quot;large&quot;,&quot;open&quot;],&quot;desc&quot;:&quot;&quot;,&quot;carousel&quot;:{&quot;thumbs&quot;:&quot;4&quot;,&quot;thumbs_to_slide&quot;:&quot;2&quot;,&quot;spacing&quot;:&quot;10&quot;},&quot;carousel_nav&quot;:{&quot;modifier&quot;:&quot;__sides&quot;,&quot;position&quot;:&quot;left-none&quot;,&quot;location&quot;:&quot;prepend&quot;,&quot;background&quot;:&quot;#fff&quot;,&quot;color&quot;:&quot;#000&quot;,&quot;font_size&quot;:&quot;2&quot;,&quot;border_radius&quot;:&quot;0&quot;}},&quot;a&quot;:&quot;1&quot;},&quot;fit&quot;:&quot;false&quot;,&quot;playlists&quot;:&quot;true&quot;,&quot;uploads&quot;:&quot;true&quot;,&quot;player_mode&quot;:&quot;1&quot;,&quot;truncate&quot;:&quot;&quot;,&quot;banner&quot;:&quot;true&quot;,&quot;thumb_margin&quot;:&quot;8&quot;,&quot;play_icon&quot;:&quot;hover&quot;,&quot;youtube_play_icon&quot;:&quot;&quot;,&quot;thumb_image_size&quot;:&quot;medium&quot;,&quot;default_tab&quot;:&quot;uploads&quot;,&quot;sticky&quot;:{&quot;enable&quot;:&quot;&quot;,&quot;width&quot;:&quot;400&quot;,&quot;position&quot;:&quot;bottom-right&quot;,&quot;only_above&quot;:&quot;768&quot;,&quot;margin&quot;:&quot;12&quot;},&quot;player&quot;:{&quot;show_desc&quot;:&quot;&quot;,&quot;show_meta&quot;:&quot;&quot;},&quot;menu&quot;:&quot;1&quot;,&quot;rating_style&quot;:&quot;NaN&quot;,&quot;rtl&quot;:false}}\" data-yrc-setup=\"\"><\/div>\r\n\t\t\t<script data-cfasync=\"false\" type=\"text\/javascript\">\r\n\t\t\t\tif( !window.YRC ) var YRC = {Data:{}};\r\n\t\t\t\tYRC.Data[\"69e15bc58f58b\"] = {\"video\":\"ET32jWw6Xr4\"};\r\n\t\t\t\t(function(){\r\n\t\t\t\t\tif(!YRC.loaded){\r\n\t\t\t\t\t    YRC.loaded = true;\r\n\t\t\t\t\t\tfunction YRC_Loader(){\r\n\t\t\t\t\t\t\t\/\/YRC.loaded = true;\r\n\t\t\t\t\t\t\tYRC.is_pro = false;\r\n\t\t\t\t\t\t\tYRC.is_pb = false;\r\n\t\t\t\t\t\t\tYRC.lang = {\"form\":{\"Videos\":\"Videos\",\"Playlists\":\"Playlists\",\"Search\":\"Search\",\"Loading\":\"Loading\",\"more\":\"more\",\"Nothing_found\":\"Nothing found\",\"Prev\":\"Previous\",\"Next\":\"Next\",\"consent_statement\":\"Allow cookies?\",\"consent_button\":\"Allow\",\"consent_privacy_policy\":\"Privacy policy\"},\"fui\":{\"sort_by\":\"Sort by\",\"relevant\":\"Relevant\",\"latest\":\"Latest\",\"liked\":\"Liked\",\"title\":\"Title\",\"views\":\"Views\",\"duration\":\"Duration\",\"any\":\"Any\",\"_short\":\"Short\",\"medium\":\"Medium\",\"_long\":\"Long\",\"uploaded\":\"Uploaded\",\"all_time\":\"All time\",\"live_now\":\"Live Now\",\"today\":\"Today\",\"ago\":\"ago\",\"last\":\"Last\",\"day\":\"day\",\"days\":\"days\",\"week\":\"week\",\"weeks\":\"weeks\",\"month\":\"month\",\"months\":\"months\",\"year\":\"year\",\"years\":\"years\",\"older\":\"Older\",\"show_more\":\"Show More\",\"show_less\":\"Show Less\",\"reply\":\"REPLY\",\"view_replies\":\"View replies\",\"write_comment\":\"Write comment...\",\"billion\":\"B\",\"million\":\"M\",\"thousand\":\"K\",\"max_plain_number\":1000,\"wplocale\":\"en_US\"}};\r\n\t\t\t\t\t\t\tYRC.is_admin = false;\r\n\t\t\t\t\t\t\tvar script = document.createElement(\"script\");\r\n\t\t\t\t\t\t\t\tscript.setAttribute(\"data-cfasync\", \"false\");\r\n\t\t\t\t\t\t\t\tscript.setAttribute(\"type\", \"text\/javascript\");\r\n\t\t\t\t\t\t\t\tscript.src = \"https:\/\/www.programminginpython.com\/wp-content\/plugins\/yourchannel\/js\/yrc.js?1.2.9\";\r\n\t\t\t\t\t\t\t\tscript.id = \"yrc-script\";\r\n\t\t\t\t\t\t\t\tdocument.querySelector(\"head\").appendChild(script);\r\n\t\t\t\t\t\t\tvar style = document.createElement(\"link\");\r\n\t\t\t\t\t\t\t\tstyle.rel = \"stylesheet\";\r\n\t\t\t\t\t\t\t\tstyle.href = \"https:\/\/www.programminginpython.com\/wp-content\/plugins\/yourchannel\/css\/style.css?1.2.9\";\r\n\t\t\t\t\t\t\t\tstyle.type = \"text\/css\";\r\n\t\t\t\t\t\t\t\tdocument.querySelector(\"head\").appendChild(style);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(window.jQuery){YRC_Loader();}else { var yrctimer2324 = window.setInterval(function(){\r\n\t\t\t\t\t\t\tif(window.jQuery){YRC_Loader(); window.clearInterval(yrctimer2324); }\r\n\t\t\t\t\t\t}, 250);}\r\n\t\t\t\t\t} else {if(YRC.EM)YRC.EM.trigger(\"yrc.newchannel\");}\r\n\t\t\t\t}());<\/script>\n<p style=\"text-align: center;\"><strong>You can watch the video on YouTube <a href=\"https:\/\/www.youtube.com\/watch?v=ET32jWw6Xr4\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/strong><\/p>\n<div class=\"visualize_iframe\">\n<h4 class=\"post_h4\">Python Lists- Code Visualization<\/h4>\n<p><iframe src=\"https:\/\/pythontutor.com\/iframe-embed.html#code=lst%20%3D%20%5B'abc',%20'def',%20'ghi',%20'jklm',%20'nopqr',%20'st',%20'uv',%20'wxyz',%20'23',%20's98',%20'123',%20'87'%5D%0A%0A%23%20prints%20the%20length%20of%20the%20list%0Aprint%28'Length%20of%20the%20list%20is%20%3A%20',%20len%28lst%29%29%0A%0A%23%20appends%20an%20item%20to%20the%20list%0Alst.append%28'sdd'%29%0Aprint%28'%5CnThe%20list%20appended%20a%20new%20element%20%22sdd%22%20at%20the%20end%20%5Cn',%20lst%29%0A%0A%23%20changes%20the%20value%20of%20an%20item%20in%20a%20list%0Alst%5B0%5D%20%3D%20'aaa'%0Aprint%28'%5CnThe%20value%20of%20the%20first%20element%20in%20the%20list%20is%20changed%20to%20%22aaa%22%20%5Cn',%20lst%29%0A%0A%23%20Slicing%0A%23%20shows%20only%20items%20starting%20from%200%20upto%203%0Aprint%28'%5CnList%20showing%20only%20items%20starting%20from%200%20upto%203%5Cn',%20lst%5B%3A3%5D%29%0A%0A%23%20shows%20only%20items%20starting%20from%204%20to%20the%20end%0Aprint%28'%5CnList%20showing%20only%20items%20starting%20from%204%20to%20the%20end%5Cn',%20lst%5B4%3A%5D%29%0A%0A%23%20shows%20only%20items%20starting%20from%202%20upto%206%0Aprint%28'%5CnList%20showing%20only%20items%20starting%20from%202%20upto%206%5Cn',%20lst%5B2%3A6%5D%29%0A%0A%23%20reverse%20all%20items%20in%20the%20list%0Aprint%28'%5CnList%20items%20reversed%20%5Cn',%20lst%5B%3A%3A-1%5D%29%0A%0A%23%20removing%20items%20from%20list%0Alst%5B%3A1%5D%20%3D%20%5B%5D%0Aprint%28'%5CnFirst%20element%20is%20removed%20from%20the%20list%20%5Cn',%20lst%29%0A%0A%23%20removing%20whole%20list%0Alst%5B%3A%5D%20%3D%20%5B%5D%0Aprint%28'%5CnComplete%20list%20removed%20%5Cn',%20lst%29&amp;codeDivHeight=400&amp;codeDivWidth=350&amp;cumulative=false&amp;curInstr=14&amp;heapPrimitives=false&amp;origin=opt-frontend.js&amp;py=3&amp;rawInputLstJSON=%5B%5D&amp;textReferences=false\" width=\"800\" height=\"600\" frameborder=\"0\"><\/iframe><\/p>\n<\/div>\n<h4 style=\"color: #dd9933;\">Task :<\/h4>\n<p>To perform add, append, modify, remove, and slice operations on a list.<\/p>\n<h4 style=\"color: #dd9933;\">Approach :<\/h4>\n<ul>\n<li>Define a list <code>lst = []<\/code> with some sample items in it.<\/li>\n<li>Find the length of the list using <code>len()<\/code> function.<\/li>\n<li>Append an item to the list using <code>append()<\/code> function.<\/li>\n<li>Change the value of an item in a list by specifying an index and its value <code>lst[n] = 'some value'<\/code><\/li>\n<li>Perform slice operation, slice operation syntax is <code>lst[begin:end]<\/code><\/li>\n<li>Leaving the begin\u00a0one empty <code>lst[:m]<\/code> gives the list from 0 to m.<\/li>\n<li>Leaving the end\u00a0one empty <code>lst[n:]<\/code> gives the list from n to end.<\/li>\n<li>Giving both begin and end <code>lst[n:m]<\/code> gives the list\u00a0from n to m.<\/li>\n<li>An advanced slice operation with 3 options <code>lst[begin:end:step]<\/code><\/li>\n<li>Leaving both begin and end empty and giving a step of -1, <code>lst[::-1]<\/code> it reverses the whole list.<\/li>\n<li>To remove an element using slice <code>lst[:n] = []<\/code> \u00a0removes all elements from 0 to n, similarly <code>lst[m:]<\/code> removes all elements from m to end and <code>lst[m:n] = []<\/code> removes all elements from m to n.<\/li>\n<li>The whole list can be removed by <code>lst[:] = []<\/code><\/li>\n<\/ul>\n<p class=\"extra_btn_para\"><span class=\"wdg\"> <a href=\"https:\/\/github.com\/avinashn\/programminginpython.com\/blob\/master\/listOperations.py\" target=\"_blank\" rel=\"noopener noreferrer\"> <i class=\"fa fa-github fa-lg\"><\/i> Program on GitHub<\/a><\/span><\/p>\n<blockquote><p>Ad:<br \/>\n<span style=\"font-size: 18pt;\">Learn Python Programming Masterclass \u2013 <a href=\"https:\/\/bit.ly\/python-programming-masterclass\" target=\"_blank\" rel=\"noopener\">Enroll Now<\/a>.<\/span><br \/>\n<span style=\"font-size: 12px;\">Udemy<\/span><\/p><\/blockquote>\n<h4 style=\"color: #dd9933;\">Program :<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">lst = ['abc', 'def', 'ghi', 'jklm', 'nopqr', 'st', 'uv', 'wxyz', '23', 's98', '123', '87']\r\n\r\n# prints the length of the list\r\nprint('Length of the list is : ', len(lst))\r\n\r\n# appends an item to the list\r\nlst.append('sdd')\r\nprint('\\nThe list appended a new element \"sdd\" at the end \\n', lst)\r\n\r\n# changes the value of an item in a list\r\nlst[0] = 'aaa'\r\nprint('\\nThe value of the first element in the list is changed to \"aaa\" \\n', lst)\r\n\r\n# Slicing\r\n# shows only items starting from 0 upto 3\r\nprint('\\nList showing only items starting from 0 upto 3\\n', lst[:3])\r\n\r\n# shows only items starting from 4 to the end\r\nprint('\\nList showing only items starting from 4 to the end\\n', lst[4:])\r\n\r\n# shows only items starting from 2 upto 6\r\nprint('\\nList showing only items starting from 2 upto 6\\n', lst[2:6])\r\n\r\n# reverse all items in the list\r\nprint('\\nList items reversed \\n', lst[::-1])\r\n\r\n# removing items from list\r\nlst[:1] = []\r\nprint('\\nFirst element is removed from the list \\n', lst)\r\n\r\n# removing whole list\r\nlst[:] = []\r\nprint('\\nComplete list removed \\n', lst)<\/pre>\n<h4 style=\"color: #dd9933;\">Output :<\/h4>\n<figure id=\"attachment_501\" aria-describedby=\"caption-attachment-501\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-501 lazyload\" data-src=\"https:\/\/www.programminginpython.com\/wp-content\/uploads\/2023\/03\/list-300x179-1.png\" alt=\"Python Lists \u2013 Add, Append, Modify, Remove, Slice\" width=\"300\" height=\"179\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/179;\" \/><figcaption id=\"caption-attachment-501\" class=\"wp-caption-text\">Python Lists \u2013 Add, Append, Modify, Remove, Slice<\/figcaption><\/figure>\n<p>That&#8217;s it for the post, we have now successfully performed all the Python List operations.<\/p>\n<p class=\"extra_btn_para\"><span class=\"wdg\"> <a href=\"https:\/\/github.com\/avinashn\/programminginpython.com\/blob\/master\/listOperations.py\" target=\"_blank\" rel=\"noopener noreferrer\"> <i class=\"fa fa-github fa-lg\"><\/i> Program on GitHub<\/a><\/span><\/p>\n<blockquote><p>Ad:<br \/>\n<span style=\"font-size: 18pt;\">Learn Python Programming Masterclass \u2013 <a href=\"https:\/\/bit.ly\/python-programming-masterclass\" target=\"_blank\" rel=\"noopener\">Enroll Now<\/a>.<\/span><br \/>\n<span style=\"font-size: 12px;\">Udemy<\/span><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we will learn about Lists in python. Here we perform the basic operations on a list like adding items to a list, appending an item at the end of the list, modify &hellip;<\/p>\n","protected":false},"author":1,"featured_media":229,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,10,11],"tags":[40,41,43,42,39,32,44],"class_list":["post-78","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-basic-programs","category-data-structures","category-lists","tag-list-add","tag-list-append","tag-list-items","tag-list-modify","tag-list-operations","tag-lists","tag-slicing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python Lists \u2013 Add, Append, Modify, Remove, Slice - Programming In Python<\/title>\n<meta name=\"description\" content=\"Python Lists \u2013 Add, Append, Modify, Remove, Slice. Perform python List operations like add, append, modify, remove and slice items in 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.programminginpython.com\/python-lists-add-append-modify-remove-slice\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Lists \u2013 Add, Append, Modify, Remove, Slice - Programming In Python\" \/>\n<meta property=\"og:description\" content=\"Python Lists \u2013 Add, Append, Modify, Remove, Slice. Perform python List operations like add, append, modify, remove and slice items in a list.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/\" \/>\n<meta property=\"og:site_name\" content=\"Programming In Python\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/programminginpython\" \/>\n<meta property=\"article:published_time\" content=\"2018-05-12T09:45:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-14T14:25:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.programminginpython.com\/wp-content\/uploads\/2023\/03\/fb_python_lists_1200_630.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"AVINASH NETHALA\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@python_pip\" \/>\n<meta name=\"twitter:site\" content=\"@python_pip\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"AVINASH NETHALA\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Lists \u2013 Add, Append, Modify, Remove, Slice - Programming In Python","description":"Python Lists \u2013 Add, Append, Modify, Remove, Slice. Perform python List operations like add, append, modify, remove and slice items in 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.programminginpython.com\/python-lists-add-append-modify-remove-slice\/","og_locale":"en_US","og_type":"article","og_title":"Python Lists \u2013 Add, Append, Modify, Remove, Slice - Programming In Python","og_description":"Python Lists \u2013 Add, Append, Modify, Remove, Slice. Perform python List operations like add, append, modify, remove and slice items in a list.","og_url":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/","og_site_name":"Programming In Python","article_publisher":"https:\/\/www.facebook.com\/programminginpython","article_published_time":"2018-05-12T09:45:56+00:00","article_modified_time":"2023-05-14T14:25:13+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.programminginpython.com\/wp-content\/uploads\/2023\/03\/fb_python_lists_1200_630.png","type":"image\/png"}],"author":"AVINASH NETHALA","twitter_card":"summary_large_image","twitter_creator":"@python_pip","twitter_site":"@python_pip","twitter_misc":{"Written by":"AVINASH NETHALA","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/#article","isPartOf":{"@id":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/"},"author":{"name":"AVINASH NETHALA","@id":"https:\/\/www.programminginpython.com\/#\/schema\/person\/9a3c14fe46d422ebf783ee61de1e788c"},"headline":"Python Lists \u2013 Add, Append, Modify, Remove, Slice","datePublished":"2018-05-12T09:45:56+00:00","dateModified":"2023-05-14T14:25:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/"},"wordCount":343,"commentCount":0,"publisher":{"@id":"https:\/\/www.programminginpython.com\/#organization"},"image":{"@id":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/#primaryimage"},"thumbnailUrl":"https:\/\/www.programminginpython.com\/wp-content\/uploads\/2023\/03\/python_lists_1920_4001.png","keywords":["list add","list append","list items","list modify","list operations","lists","slicing"],"articleSection":["Basic Programs","Data Structures","Lists"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/","url":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/","name":"Python Lists \u2013 Add, Append, Modify, Remove, Slice - Programming In Python","isPartOf":{"@id":"https:\/\/www.programminginpython.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/#primaryimage"},"image":{"@id":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/#primaryimage"},"thumbnailUrl":"https:\/\/www.programminginpython.com\/wp-content\/uploads\/2023\/03\/python_lists_1920_4001.png","datePublished":"2018-05-12T09:45:56+00:00","dateModified":"2023-05-14T14:25:13+00:00","description":"Python Lists \u2013 Add, Append, Modify, Remove, Slice. Perform python List operations like add, append, modify, remove and slice items in a list.","breadcrumb":{"@id":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/#primaryimage","url":"https:\/\/www.programminginpython.com\/wp-content\/uploads\/2023\/03\/python_lists_1920_4001.png","contentUrl":"https:\/\/www.programminginpython.com\/wp-content\/uploads\/2023\/03\/python_lists_1920_4001.png","width":1920,"height":400,"caption":"Python Lists \u2013 Add, Append, Modify, Remove, Slice"},{"@type":"BreadcrumbList","@id":"https:\/\/www.programminginpython.com\/python-lists-add-append-modify-remove-slice\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.programminginpython.com\/"},{"@type":"ListItem","position":2,"name":"Python Lists \u2013 Add, Append, Modify, Remove, Slice"}]},{"@type":"WebSite","@id":"https:\/\/www.programminginpython.com\/#website","url":"https:\/\/www.programminginpython.com\/","name":"Programming In Python","description":"All About Python","publisher":{"@id":"https:\/\/www.programminginpython.com\/#organization"},"alternateName":"pip","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.programminginpython.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.programminginpython.com\/#organization","name":"Programming In Python","alternateName":"PIP","url":"https:\/\/www.programminginpython.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.programminginpython.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.programminginpython.com\/wp-content\/uploads\/2023\/04\/pip_logo_500_500.png","contentUrl":"https:\/\/www.programminginpython.com\/wp-content\/uploads\/2023\/04\/pip_logo_500_500.png","width":500,"height":500,"caption":"Programming In Python"},"image":{"@id":"https:\/\/www.programminginpython.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/programminginpython","https:\/\/x.com\/python_pip","https:\/\/www.youtube.com\/programminginpython","https:\/\/github.com\/avinashn\/programminginpython.com"]},{"@type":"Person","@id":"https:\/\/www.programminginpython.com\/#\/schema\/person\/9a3c14fe46d422ebf783ee61de1e788c","name":"AVINASH NETHALA","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.programminginpython.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ed52e7670d7db94820c7430d324103ccdecb16d86611d5b29064aa9ce25a958b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ed52e7670d7db94820c7430d324103ccdecb16d86611d5b29064aa9ce25a958b?s=96&d=mm&r=g","caption":"AVINASH NETHALA"},"sameAs":["https:\/\/www.programminginpython.com\/"],"url":"https:\/\/www.programminginpython.com\/author\/avinash\/"}]}},"jetpack_featured_media_url":"https:\/\/www.programminginpython.com\/wp-content\/uploads\/2023\/03\/python_lists_1920_4001.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":7,"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":810,"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/posts\/78\/revisions\/810"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/media\/229"}],"wp:attachment":[{"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.programminginpython.com\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}