[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-697977-105":59,"doc-detail-697977-en":130,"doc-similar-697977":162},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","unit-iii-2-lists-tuples-dictionaries-41-lists-list-operations-and-methods","UNIT-III-2 - Lists, Tuples, Dictionaries - 4.1 Lists - List Operations and Methods","","UNIT III section 4.1 explains lists as ordered sequences of elements, including mixed data types, nested lists, and the empty list []. It covers core list operations such as creation, indexing, slicing, concatenation, repetition, updating by index, membership testing, and equality/inequality comparison. It further introduces list slicing syntax with start/stop/step semantics and provides common list methods (append, insert, extend, index, sort, reverse, pop, remove, count, copy, clear, and del) with example outputs for practical use.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/unit-iii-2-lists-tuples-dictionaries-41-lists-list-operations-and-methods/697977/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/unit-iii-2-lists-tuples-dictionaries-41-lists-list-operations-and-methods/697977.png","ImageObject",300,407,{"name":92,"@type":93},"Asher","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-21","2026-11-12",true,{"@type":102,"interactionType":103,"userInteractionCount":19},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is a list, and how do you represent an empty list?","Question",{"text":112,"@type":113},"A list is an ordered sequence of items, stored using square brackets. An empty list is represented as [].","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How do indexing and negative indexing work in lists?",{"text":117,"@type":113},"Indexing accesses an item by its position, starting from 0. Negative indexing accesses from the end, so -1 refers to the last element.",{"name":119,"@type":110,"acceptedAnswer":120},"What are the common list methods and what do they do?",{"text":121,"@type":113},"List methods manipulate list data, such as append (add at end), insert (add at a specified index), extend (add elements from another list), sort and reverse (reorder), and pop/remove/clear/del for deletion and retrieval.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},697977,1794446558,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":19,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":144,"preview_page_count":19,"preview_urls":145},687197207639,"https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd","|  |\n| --- |\n| |\n| UNIT III\u003Cbr>LISTS, TUPLES, DICTIONARIES\u003Cbr>4.1 LISTS\u003Cbr>List is an ordered sequence of items. Values in the list are called elements / items. It can be written as a list of comma-separated items (values) between square brackets [ ] . Items in the lists can be of different data types.\u003Cbr>Example:\u003Cbr>ps = [10, 20, 30, 40] qs = [“spam”,“bungee”,“swallow”]\u003Cbr>The first example is a list of four integers. The second is a list of three strings. The elements of a list don t have to be the same type. The following list contains a string, a float, an integer, and another list: zs = [“hello”, 2.0, 5, [10, 20]]\u003Cbr>A list within another list is said to be nested. Finally, a list with no elements is called an empty list, and is denoted [] .\u003Cbr>A list of Integers : [1951,1952,1953,1958,1957]\u003Cbr>A list of Strings : [„orange , blue , yellow ]\u003Cbr>An empty list : [] |\n\n4.1.1 List Operations:  \n\n| Operations | Examples | Description |\n| --- | --- | --- |\n| create a list | >>> a=[2,3,4,5,6,7,8,9, 10]\u003Cbr>>>> print(a)\u003Cbr>[2, 3, 4, 5, 6, 7, 8, 9, 10] | in this way we can create alistat compile time |\n| Indexing | >>> print(a[0]) 2 >>> print(a[8]) 10 >>> print(a[-1]) 10 | Accessing the item in the position 0\u003Cbr>Accessing the item in the position 8\u003Cbr>Accessing a last elementusing negative indexing. |\n| Slicing | >>> print(a[0:3])[2, 3, 4]\u003Cbr>>>> print(a[0:])\u003Cbr>[2, 3, 4, 5, 6, 7, 8, 9, 10] | Printing a part of the list. |\n| Concatenation | >>>b=[20,30]\u003Cbr>>>> print(a+b)\u003Cbr>[2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30] | Adding and printing theitems of two lists.q |\n| Repetition | >>> print(b*3)\u003Cbr>[20, 30, 20, 30, 20, 30] | Create a multiple copies ofthe same list. |\n| Updating | >>> print(a[2])\u003Cbr>4>>> a[2]=100 >>> print(a)\u003Cbr>[2, 3, 100, 5, 6, 7, 8, 9, 10] | Updating the list using index value. |\n| Membership | >>> a=[2,3,4,5,6,7,8,9, 10]\u003Cbr>>>> 5 in a True >>> 100 in a False\u003Cbr>>>> 2 not in a False | Returns True if element ispresent in list. Otherwisereturns false. |\n| Comparison | >>> a=[2,3,4,5,6,7,8,9, 10]>>>b=[2,3,4]\u003Cbr>>>> a==b False >>> a!=b True | Returns True if all elementsin both elements are same.Otherwise returns false |\n\n\n| 4.1.2 List Slicing\u003Cbr>The slice operation uses the square brackets. This is termed indexing, or slicing. An index or slice returns a portion of a larger value. In a string this can be used to produce a substring. Index values start at zero, and extend upwards to the number of characters in the string minus one. When a single argument is given it is one character out of the string. When two integers are written, separated by a colon, it is termed aslice. The second value is an ending position. A portion of the string starting at the given position up to but not including the ending position is produced.\u003Cbr>Syntax:\u003Cbr>Listname[start:stop]\u003Cbr>Listname[start:stop:steps]\u003Cbr>Example : |\n| --- |\n| Slices Example Description a[0:3] >>> a=[9,8,7,6,5,4]\u003Cbr>>>> a[0:3][9, 8, 7] Printing a part of a list from 0 to 2. a[:4] >>> a[:4]\u003Cbr>[9, 8, 7, 6] Default start value is 0. soprints from 0 to 3 a[1:] >>> a[1:][8, 7, 6, 5, 4] default stop value will ben-1 . so prints from 1 to 5 a[:] >>> a[:]\u003Cbr>[9, 8, 7, 6, 5, 4] Prints the entire list. a[2:2] >>> a[2:2][] print an empty slice a[0:6:2] >>> a[0:6 :2][9, 7, 5] Slicing list values with stepsize 2. a[::-1] >>> a[::-1]\u003Cbr>[4, 5, 6, 7, 8, 9]\u003Cbr>Returns reverse of given listvalues |\n|  |\n\n4.1.3 List Methods  \nMethods used in lists are used to manipulate the data quickly. These methods work only on lists. They do not work on the other sequence types that are not mutable, that is, the values they contain cannot be changed, added, or deleted.  \nSyntax:  \nList_name.method_name( element/index/list)  \n\n| syntax | example | description |\n| --- | --- | --- |\n| a.append(element) | >>> a=[1,2,3,4,5]>>> a.append(6)\u003Cbr>>>> print(a)[1, 2, 3, 4, 5, 6] | Add an element to the end of the list |\n| a.insert(index,element) | >>> a.insert(0,0)\u003Cbr>>>> print(a)[0, 1, 2, 3, 4, 5, 6] | Insert an i","cbCaipTBHuRYs6cl","https://ap.wps.com/l/cbCaipTBHuRYs6cl","pdf",418558,29,"English","# 4.1 Lists\n## 4.1.1 List Operations\n## 4.1.2 List Slicing\n## 4.1.3 List Methods","[{\"question\":\"What is a list, and how do you represent an empty list?\",\"answer\":\"A list is an ordered sequence of items, stored using square brackets. An empty list is represented as [].\"},{\"question\":\"How do indexing and negative indexing work in lists?\",\"answer\":\"Indexing accesses an item by its position, starting from 0. Negative indexing accesses from the end, so -1 refers to the last element.\"},{\"question\":\"What are the common list methods and what do they do?\",\"answer\":\"List methods manipulate list data, such as append (add at end), insert (add at a specified index), extend (add elements from another list), sort and reverse (reorder), and pop/remove/clear/del for deletion and retrieval.\"}]","UNIT-III-2 - Lists, Tuples, Dictionaries - 4.1 Lists - List Operations and Methods | PDF",73,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/60d032fd9ee0741dd809f734240eac29.webp",983,1334,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/6e106ac317ceeebe970dd6730c056f8a.webp",982,1332,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/e3ed4e4c53ac7decddf86fde97cbb0db.webp",981,1331,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/e9d2bdcbffc11c0c686df553929c7694.webp",980,1330,{"list":163,"token":66},[164,170,176,182,188,194,200,206,212,218],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":81,"category_name":30,"create_tm":169},685777,"Lists and Tuples - Learn to create and use 1D lists, tuples and 2D lists","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203949/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110799&Signature=S3KNL1%2FTygwgONHBJw8VxVvK2JI%3D","lists-and-tuples-learn-to-create-and-use-1d-lists-tuples-and-2d-lists",1794018226,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":29,"category_name":30,"create_tm":175},685634,"Python Collections - Arrays - List and Function","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999084045/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110799&Signature=PhXKZnYobV9khEy6a9K%2B43ZozTo%3D","python-collections-arrays-list-and-function",1794016101,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":24,"category_name":30,"create_tm":181},670916,"cheat_sheet-python-final-medium - List Comprehension & Indexing","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988704036/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110799&Signature=4XkiIWNWu5CbpbdHoz69qy%2BJf80%3D","cheat_sheet-python-final-medium-list-comprehension-indexing",1793572695,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":24,"category_name":30,"create_tm":187},671624,"Python Cheat Sheet - Complex Data Types","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988737384/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110799&Signature=jNXri7sgClfvyn1Nbw%2FNTOAdKRY%3D","python-cheat-sheet-complex-data-types",1793577649,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":34,"category_name":30,"create_tm":193},685771,"Compound Data - Lists, Tuples, Dictionaries - Unit IV - Learning Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203726/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110799&Signature=0CAVKZ8RTXOOrSmAtWcvqtbDOtk%3D","compound-data-lists-tuples-dictionaries-unit-iv-learning-notes",1794018217,{"doc_id":195,"doc_title":196,"file_type":137,"home_preview_img_url":197,"slug":198,"view_count":24,"category_name":30,"create_tm":199},685631,"Introduction to List - List Operations - Traversing a List - List Methods and Built-in Functions","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999084036/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110799&Signature=qJIpy%2FnSdtLWYeHYQGjq85KAGSs%3D","introduction-to-list-list-operations-traversing-a-list-list-methods-and-built-in-functions",1794016095,{"doc_id":201,"doc_title":202,"file_type":137,"home_preview_img_url":203,"slug":204,"view_count":24,"category_name":30,"create_tm":205},685635,"Lists, Tuples and Dictionaries - Lecture 10","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000169926/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110799&Signature=Inw%2FkkJ%2FDl4cA7dBG%2FwQnIj1XLQ%3D","lists-tuples-and-dictionaries-lecture-10",1794016103,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":19,"category_name":30,"create_tm":211},685627,"List in Python - A Beginner Guide -","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000169755/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110799&Signature=8Zl8cXC7HcDbLofk%2BQj2aq%2F1fAc%3D","list-in-python-a-beginner-guide",1794016087,{"doc_id":213,"doc_title":214,"file_type":137,"home_preview_img_url":215,"slug":216,"view_count":24,"category_name":30,"create_tm":217},685778,"1-Tuples","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203953/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110799&Signature=movnRaLSe8xQPg0O4CRSXGRguPk%3D","1-tuples",1794018230,{"doc_id":219,"doc_title":220,"file_type":137,"home_preview_img_url":221,"slug":222,"view_count":34,"category_name":30,"create_tm":223},697976,"6.0001 Lecture 5 - Tuples, Lists, Aliasing, Mutability, Cloning","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146768/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110799&Signature=WspJgNR6jgaGHvvkG1omBDoRY0c%3D","60001-lecture-5-tuples-lists-aliasing-mutability-cloning",1794446554]