{"id":15064,"date":"2023-03-28T12:36:10","date_gmt":"2023-03-28T12:36:10","guid":{"rendered":"https:\/\/www.prepbytes.com\/blog\/?p=15064"},"modified":"2023-12-28T12:46:49","modified_gmt":"2023-12-28T12:46:49","slug":"python-list-operations","status":"publish","type":"post","link":"https:\/\/prepbytes.com\/blog\/python-list-operations\/","title":{"rendered":"Python List Operations"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg\" alt=\"\" \/><\/p>\n<p>Python, known for its simplicity and versatility, offers a plethora of built-in functionalities that streamline programming tasks. Among these features, the Python list\u2014a fundamental data structure\u2014proves to be a versatile container that can hold elements of various data types. Python lists come equipped with a wide array of operations that empower developers to manipulate, iterate through, and modify list elements effortlessly.<br \/>\nIn this article, we&#8217;ll delve into the world of Python list operations. We&#8217;ll explore the diverse range of methods and functions available for performing operations such as appending, slicing, sorting, and more on lists. Understanding these operations is crucial for any Python developer, as they form the backbone of efficient list manipulation and data handling in Python programming.<\/p>\n<h2>What is Python List?<\/h2>\n<p>A list is a collection of ordered and mutable elements enclosed in square brackets []. It can contain any type of object, including numbers, strings, other lists, tuples, and dictionaries.  In Python, Lists are one of the most commonly used data structures.<\/p>\n<p><strong>Example for python list:<\/strong><\/p>\n<pre><code>list = [\"Student\", \"Teacher\", \"Parent\"]\nprint(list)<\/code><\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre><code>['Student', 'Teacher', 'Parent']<\/code><\/pre>\n<p><strong>Explanation for python list<\/strong><br \/>\nBy using square brackets [] we print our list as output.<\/p>\n<h2>Python List Operations Types<\/h2>\n<p>There are many different types of operations that you can perform on Python lists, including:<\/p>\n<h3>1. Access Elements of a List<\/h3>\n<p>A Python lists Operations entries can be accessed using the indexes [0], [1], etc. An element in a list with an index of n has an index of n-1 since the index begins at 0. Negative indexing refers to beginning at the end. The numbers -1 and -2 denote the last and second-to-last items, respectively. By defining the beginning and ending points of the range, you can specify a range of indexes. A new list containing the items you requested will be the return value when you specify a range.<\/p>\n<p><strong>Example for Access element of a list<\/strong><\/p>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_15075 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_15075 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_15075 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_15075 .wpsm_nav-tabs > li.active > a, #tab_container_15075 .wpsm_nav-tabs > li.active > a:hover, #tab_container_15075 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_15075 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_15075 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_15075 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_15075 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_15075 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_15075 .wpsm_nav-tabs > li > a:hover , #tab_container_15075 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_15075 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_15075 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_15075 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_15075 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_15075 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_15075 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_15075 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_15075 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_15075 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_15075 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_15075 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_15075\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_15075\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_15075_1\" aria-controls=\"tabs_desc_15075_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Python<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_15075\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_15075_1\">\r\n\t\t\t\t\t\t\t\t<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">list=[\"Student\", \"Teacher\", \"Parent\", 1, 5, 6, 8]\r\nprint(list[0])\r\nprint(list[-1])  \r\nprint(list[2:5])<\/pre>\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_15075 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_15075 a\"),jQuery(\"#tab-content_15075\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Output<\/strong><\/p>\n<pre><code>Student\nParent\n['Parent', 1, 5]<\/code><\/pre>\n<p><strong>Explanation for Access element of a list<\/strong><br \/>\nUsing index[0] we accessed the first element of the list. Using index[-1] we accessed the last element in the list. Using list[begin: end] we accessed the second, third, and fourth elements in list<\/p>\n<h3>2. Add Elements to a List<\/h3>\n<p>The append and insert functions in Python allow for the addition (or appending) of elements to lists. We can add elements to a list at any location by using the insert function. This function requires two arguments: The element&#8217;s desired insertion index and the addition of the element. Use the insert() method to add a list item at a specific index. Use the extend() method to add elements from another list to the one that is now displayed. Any iterable object may be added using the extend() method; lists are not required to be appended (tuples, sets, dictionaries, etc.).<\/p>\n<p><strong>Example of adding elements to a list<\/strong><\/p>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_15076 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_15076 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_15076 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_15076 .wpsm_nav-tabs > li.active > a, #tab_container_15076 .wpsm_nav-tabs > li.active > a:hover, #tab_container_15076 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_15076 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_15076 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_15076 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_15076 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_15076 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_15076 .wpsm_nav-tabs > li > a:hover , #tab_container_15076 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_15076 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_15076 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_15076 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_15076 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_15076 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_15076 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_15076 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_15076 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_15076 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_15076 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_15076 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_15076\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_15076\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_15076_1\" aria-controls=\"tabs_desc_15076_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Python<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_15076\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_15076_1\">\r\n\t\t\t\t\t\t\t\t<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">list = [\"Student\", \"Teacher\", \"Parent\"]\r\nlist.append(\"Friend\")\r\nprint(list) list.insert(1, \"Friend\")\r\nprint(list) \r\nadd = [1,2,3]\r\nlist.extend(add)\r\nprint(list) \r\ntuple = (\"Friend\", 2, 3)\r\nlist.extend(tuple)\r\nprint(list) \r\n\r\n<\/pre>\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_15076 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_15076 a\"),jQuery(\"#tab-content_15076\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Output<\/strong><\/p>\n<pre><code>['Student', 'Teacher', 'Parent', 'Friend']\n['Student', 'Teacher', 'Parent', 1, 2, 3]\n['Student', 'Teacher', 'parent', 'Friend', 2, 3]<\/code><\/pre>\n<p><strong>Explanation of adding elements to a list<\/strong><br \/>\nAdding elements to the end of a list is done with the append function. At the specified index, the insert() function inserts an item. By using the keyword \u2018extend\u2019 the list is extended with add list and prints the output. By using the keyword \u2018extend\u2019 we extended the list with a tuple.<\/p>\n<h3>3. Lists Sorting<\/h3>\n<p>The list&#8217;s elements can be sorted either ascendingly or descendingly. <\/p>\n<p><strong>Example for Lists Sorting<\/strong><\/p>\n<pre><code>list = [\"Student\", \"Teacher\", \"Parent\", \"Friend\"]\nlist.sort()\nprint(list)<\/code><\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre><code>['Friend', 'Parent', 'Student', 'Teacher']<\/code><\/pre>\n<p><strong>Explanation for Lists sorting<\/strong><br \/>\nList objects include a function called sort() that, sorts the list alphabetically in ascending order<\/p>\n<h3>4. Update Elements of a List<\/h3>\n<p>Lists can be modified, therefore by utilizing the element&#8217;s index, we can update the list&#8217;s elements.<\/p>\n<p><strong>Example for Update elements of a list<\/strong><\/p>\n<pre><code>list = [1, 'Apple', 'Subject', 75, True]\nlist[2] = 'Carrot'\nprint(list) <\/code><\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre><code>[1, 'Apple', 'Carrot', 75, True]<\/code><\/pre>\n<p><strong>Explanation for update elements of a list<\/strong><br \/>\nThe element is updated in the list by using the index of an element in the list.<\/p>\n<h3>5. Remove Elements from a List<\/h3>\n<p>Using the remove function, we can easily delete a list element.<\/p>\n<p><strong>Example for Remove elements from a list<\/strong><\/p>\n<pre><code>list = ['School', 'College', 'Music', 'Games']\nlist.remove('Music')\nprint(list) <\/code><\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre><code>['School', 'College', 'Games']<\/code><\/pre>\n<p><strong>Explanation for Remove elements from a list<\/strong><br \/>\nBy using the \u2018remove\u2019 keyword we removed the element in the list.<\/p>\n<h3>6. List Elements should be Inserted<\/h3>\n<p>The pop function removes or pops out the last element from a list and outputs the remaining elements.<\/p>\n<p><strong>Example for  List elements should be inserted<\/strong><\/p>\n<pre><code>list = [1, 2, 3, 4]\nlist.pop()\nprint(list) <\/code><\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre><code>[1, 2, 3]<\/code><\/pre>\n<p><strong>Explanation for  List elements should be inserted<\/strong><br \/>\nBy using \u2018pop\u2019 keyword the last element is removed and prints the list.<\/p>\n<h3>7. Length\/Number of Elements in a List<\/h3>\n<p>The length function can be used to determine the total number of elements in a list.<\/p>\n<p><strong>Example for length of elements in a list<\/strong><\/p>\n<pre><code>list = [1, 2, 5, 8, 9]\nprint(len(list)) <\/code><\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre><code>5<\/code><\/pre>\n<p><strong>Explanation for length of elements in a list<\/strong><br \/>\nBy using the keyword \u2018len\u2019 it prints the length of the list.<\/p>\n<h3>8. Maximum Element within a List<\/h3>\n<p>Using the very simple max function, we can quickly find the maximum of the numbers in a list.The Max function only works on homogeneous lists, that is, lists with elements of the same data type.<\/p>\n<p><strong>Example for  Maximum element within a list<\/strong><\/p>\n<pre><code>list = [1, 2, 5, 6]\nmax(list)<\/code><\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre><code>6<\/code><\/pre>\n<p><strong>Explanation for Maximum element within a list<\/strong><br \/>\nBy using the keyword \u2018max\u2019 it prints the maximum element within a list.<\/p>\n<h3>9. Concatenate Lists<\/h3>\n<p>Using the &#8216;+&#8217; operator, we can easily concatenate two lists. (Concatenation is equivalent to appending two lists).<\/p>\n<p><strong>Example for  Concatenate lists<\/strong><\/p>\n<pre><code>l1 = [1, 2, 3, 4]\nl2 = [5, 6, 7]\nprint(l1 + l2) <\/code><\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre><code>[1, 2, 3, 4, 5, 6, 7]<\/code><\/pre>\n<p><strong>Explanation for Concatenate lists<\/strong><br \/>\nThe elements in list1 and list2 are printed by using \u2018+\u2019 operator.<\/p>\n<h3>10. Iterating through a List<\/h3>\n<p>Iterating through the elements of a list as well, is a very useful operation that is frequently used during data analysis.<\/p>\n<p><strong>Example for  Iterating through a list<\/strong><\/p>\n<pre><code>list = [1, 2, 3, 4]\nfor element in list:\n    print(element)<\/code><\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre><code>1\n2\n3\n4<\/code><\/pre>\n<p><strong>Explanation for  Iterating through a list<\/strong><br \/>\nElements in the list printed in sequence by using iteration.<\/p>\n<p><strong>Conclusion<\/strong><br \/>\nPython list operations form an integral part of the language&#8217;s robust functionality, enabling developers to efficiently handle and manipulate lists of varying sizes and content. Understanding these operations\u2014ranging from adding and removing elements to sorting and slicing\u2014empowers programmers to write more concise, readable, and effective code, thereby enhancing their proficiency in Python programming. Mastering list operations equips developers with the tools necessary to manipulate data effectively, facilitating the creation of sophisticated applications and algorithms in Python.<\/p>\n<h2>Frequently Asked Questions(FAQ) on Python List Operations:<\/h2>\n<p>Here are some FAQs related to Python List Operations.<\/p>\n<p><strong>1. How do you append elements to a Python list?<\/strong><br \/>\nTo add elements to the end of a list, the append() method is used. For instance, my_list.append(new_element) adds new_element to the end of my_list.<\/p>\n<p><strong>2. What is list slicing in Python, and how is it performed?<\/strong><br \/>\nList slicing is the process of extracting a specific portion of a list. It is done using the syntax my_list[start:end:step], where start is the starting index, end is the ending index (exclusive), and step is the interval.<\/p>\n<p><strong>3. How can one merge or concatenate two lists in Python?<\/strong><br \/>\nLists can be merged or concatenated using the + operator or the extend() method. For example, list1 + list2 or list1.extend(list2) will concatenate list2 to list1.<\/p>\n<p><strong>4. What are list comprehension and how are they used for list operations?<\/strong><br \/>\nList comprehensions offer a concise way to create lists in Python. They allow you to generate lists using a single line of code by iterating through an iterable. For instance, [x for x in range(10)] generates a list containing numbers from 0 to 9.<\/p>\n<p><strong>5. How do you sort a Python list?<\/strong><br \/>\nThe sort() method sorts a list in place. For example, my_list.sort() will sort my_list in ascending order. Additionally, the sorted() function returns a new sorted list without modifying the original list.<\/p>\n<p><strong>6. What are some methods to remove elements from a list in Python?<\/strong><br \/>\nPython provides several methods to remove elements from a list, including remove(), pop(), and del. remove() removes the first occurrence of a specified value, pop() removes an element at a specified index, and del removes elements based on their index or slices.<\/p>\n<p><strong>7. How do you check if an element exists in a Python list?<\/strong><br \/>\nTo check if an element exists in a list, you can use the in keyword. For example, element in my_list will return True if element exists in my_list.<\/p>\n<p><strong>8. Can lists in Python store different types of data?<\/strong><br \/>\nYes, Python lists can store elements of different data types. They can contain integers, strings, floats, lists, tuples, dictionaries, or even complex objects, providing immense flexibility in data storage.<\/p>\n<p><strong>9. Are Python lists mutable or immutable?<\/strong><br \/>\nPython lists are mutable, meaning that the elements of a list can be changed or modified after the list is created. This mutability allows for operations like appending, removing, and modifying elements within the list.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python, known for its simplicity and versatility, offers a plethora of built-in functionalities that streamline programming tasks. Among these features, the Python list\u2014a fundamental data structure\u2014proves to be a versatile container that can hold elements of various data types. Python lists come equipped with a wide array of operations that empower developers to manipulate, iterate [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[154],"tags":[],"class_list":["post-15064","post","type-post","status-publish","format-standard","hentry","category-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python List Operations<\/title>\n<meta name=\"description\" content=\"Understand list numerous operations such as adding, multiplying, slicing, membership, and comparison with the help of examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prepbytes.com\/blog\/python-list-operations\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python List Operations\" \/>\n<meta property=\"og:description\" content=\"Understand list numerous operations such as adding, multiplying, slicing, membership, and comparison with the help of examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prepbytes.com\/blog\/python-list-operations\/\" \/>\n<meta property=\"og:site_name\" content=\"PrepBytes Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prepbytes0211\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-28T12:36:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-28T12:46:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg\" \/>\n<meta name=\"author\" content=\"Prepbytes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prepbytes\" \/>\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:\/\/prepbytes.com\/blog\/python-list-operations\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/python-list-operations\/\"},\"author\":{\"name\":\"Prepbytes\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\"},\"headline\":\"Python List Operations\",\"datePublished\":\"2023-03-28T12:36:10+00:00\",\"dateModified\":\"2023-12-28T12:46:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/python-list-operations\/\"},\"wordCount\":1416,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/python-list-operations\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/prepbytes.com\/blog\/python-list-operations\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prepbytes.com\/blog\/python-list-operations\/\",\"url\":\"https:\/\/prepbytes.com\/blog\/python-list-operations\/\",\"name\":\"Python List Operations\",\"isPartOf\":{\"@id\":\"http:\/\/43.205.93.38\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/python-list-operations\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/python-list-operations\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg\",\"datePublished\":\"2023-03-28T12:36:10+00:00\",\"dateModified\":\"2023-12-28T12:46:49+00:00\",\"description\":\"Understand list numerous operations such as adding, multiplying, slicing, membership, and comparison with the help of examples.\",\"breadcrumb\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/python-list-operations\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prepbytes.com\/blog\/python-list-operations\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prepbytes.com\/blog\/python-list-operations\/#primaryimage\",\"url\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg\",\"contentUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prepbytes.com\/blog\/python-list-operations\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/43.205.93.38\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/prepbytes.com\/blog\/category\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python List Operations\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/43.205.93.38\/#website\",\"url\":\"http:\/\/43.205.93.38\/\",\"name\":\"PrepBytes Blog\",\"description\":\"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING\",\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/43.205.93.38\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/43.205.93.38\/#organization\",\"name\":\"Prepbytes\",\"url\":\"http:\/\/43.205.93.38\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"contentUrl\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"width\":160,\"height\":160,\"caption\":\"Prepbytes\"},\"image\":{\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/prepbytes0211\/\",\"https:\/\/www.instagram.com\/prepbytes\/\",\"https:\/\/www.linkedin.com\/company\/prepbytes\/\",\"https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\",\"name\":\"Prepbytes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"caption\":\"Prepbytes\"},\"url\":\"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python List Operations","description":"Understand list numerous operations such as adding, multiplying, slicing, membership, and comparison with the help of examples.","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:\/\/prepbytes.com\/blog\/python-list-operations\/","og_locale":"en_US","og_type":"article","og_title":"Python List Operations","og_description":"Understand list numerous operations such as adding, multiplying, slicing, membership, and comparison with the help of examples.","og_url":"https:\/\/prepbytes.com\/blog\/python-list-operations\/","og_site_name":"PrepBytes Blog","article_publisher":"https:\/\/www.facebook.com\/prepbytes0211\/","article_published_time":"2023-03-28T12:36:10+00:00","article_modified_time":"2023-12-28T12:46:49+00:00","og_image":[{"url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg","type":"","width":"","height":""}],"author":"Prepbytes","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prepbytes","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prepbytes.com\/blog\/python-list-operations\/#article","isPartOf":{"@id":"https:\/\/prepbytes.com\/blog\/python-list-operations\/"},"author":{"name":"Prepbytes","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e"},"headline":"Python List Operations","datePublished":"2023-03-28T12:36:10+00:00","dateModified":"2023-12-28T12:46:49+00:00","mainEntityOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/python-list-operations\/"},"wordCount":1416,"commentCount":0,"publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/python-list-operations\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prepbytes.com\/blog\/python-list-operations\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prepbytes.com\/blog\/python-list-operations\/","url":"https:\/\/prepbytes.com\/blog\/python-list-operations\/","name":"Python List Operations","isPartOf":{"@id":"http:\/\/43.205.93.38\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/python-list-operations\/#primaryimage"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/python-list-operations\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg","datePublished":"2023-03-28T12:36:10+00:00","dateModified":"2023-12-28T12:46:49+00:00","description":"Understand list numerous operations such as adding, multiplying, slicing, membership, and comparison with the help of examples.","breadcrumb":{"@id":"https:\/\/prepbytes.com\/blog\/python-list-operations\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prepbytes.com\/blog\/python-list-operations\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prepbytes.com\/blog\/python-list-operations\/#primaryimage","url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg","contentUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1680004196750-Python%20list%20Operations.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/prepbytes.com\/blog\/python-list-operations\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/43.205.93.38\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/prepbytes.com\/blog\/category\/python\/"},{"@type":"ListItem","position":3,"name":"Python List Operations"}]},{"@type":"WebSite","@id":"http:\/\/43.205.93.38\/#website","url":"http:\/\/43.205.93.38\/","name":"PrepBytes Blog","description":"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING","publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/43.205.93.38\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/43.205.93.38\/#organization","name":"Prepbytes","url":"http:\/\/43.205.93.38\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/","url":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","contentUrl":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","width":160,"height":160,"caption":"Prepbytes"},"image":{"@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/prepbytes0211\/","https:\/\/www.instagram.com\/prepbytes\/","https:\/\/www.linkedin.com\/company\/prepbytes\/","https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA"]},{"@type":"Person","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e","name":"Prepbytes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","caption":"Prepbytes"},"url":"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/"}]}},"_links":{"self":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/15064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/comments?post=15064"}],"version-history":[{"count":4,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/15064\/revisions"}],"predecessor-version":[{"id":18606,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/15064\/revisions\/18606"}],"wp:attachment":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/media?parent=15064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/categories?post=15064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/tags?post=15064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}