{"id":3209,"date":"2022-11-12T20:21:07","date_gmt":"2022-11-12T20:21:07","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=3209"},"modified":"2022-11-12T20:21:09","modified_gmt":"2022-11-12T20:21:09","slug":"python-lists","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/python-lists\/","title":{"rendered":"LIST IN PYTHON | Python Lists"},"content":{"rendered":"<p style=\"text-align: center;\">Python Lists<\/p>\n<p>Now, we are going to have learned about a very interesting, and very useful concept in python, which is a list. Basically, in our python programs, we have been dealing with data, and when we need to store data in our program, we create variables for that. But the thing is that, at times, creating a list can be useful for us. Here is an insight of what are we going to cover here &#8211;<\/p>\n<h2 style=\"text-align: center;\">Python Lists<\/h2>\n<ul>\n<li>Creating a list in Python<\/li>\n<li>Getting the length of the list<\/li>\n<li>Accessing the elements from the list<\/li>\n<li>List slicing<br \/>\n\u25e6 Reversing the list (using list slicing)<\/li>\n<li>Python list methods<br \/>\n\u25e6 sort method<br \/>\n\u25e6 append method<br \/>\n\u25e6 insert method<br \/>\n\u25e6 clear method<br \/>\n\u25e6 copy method<br \/>\n\u25e6 pop method<br \/>\n\u25e6 count method<br \/>\n\u25e6 reverse method<br \/>\n\u25e6 index method<br \/>\n\u25e6 remove method<br \/>\n\u25e6 extend method<\/li>\n<li>Iterating through the list<\/li>\n<li>List comprehension<\/li>\n<\/ul>\n<p>The list basically is used to store multiple data, which can also be of different datatypes. We are going to explore much about lists here, and we will also consider many different examples so that we can get much clarity about the concept of lists in python.<\/p>\n<p>If we were to define the list, we can simply understand the list as a sequence of elements, which is mutable(changeable), ordered, and also allows duplicate values.<\/p>\n<p>We are going to explore much about the lists here. We will go from scratch, learning how we can create the list in python, to a bunch of different methods, with which, we can do some different things, with the list, like appending some element, sorting the list, removing some elements, and much more.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python Lists Now, we are going to have learned about a very interesting, and very useful concept in python, which is a list. Basically, in our python programs, we have been dealing with data, and when we need to store data in our program, we create variables for that. But the thing is that, at [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[26,27],"class_list":{"0":"post-3209","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-python-tutorial","7":"tag-python","8":"tag-python-tutorial"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/comments?post=3209"}],"version-history":[{"count":2,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3209\/revisions"}],"predecessor-version":[{"id":4056,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3209\/revisions\/4056"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=3209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=3209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=3209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}