[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-685771-105":59,"doc-detail-685771-en":130,"doc-similar-685771":158},{"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","compound-data-lists-tuples-dictionaries-unit-iv-learning-notes","Compound Data - Lists, Tuples, Dictionaries - Unit IV - Learning Notes","","Unit IV focuses on compound data in Python, covering lists, tuples, and dictionaries. It explains list structure as an ordered sequence, including common elements such as nesting and empty lists. The material details list indexing, slicing syntax and examples (start, stop, step, and defaults), plus key list operations like concatenation, repetition, updating, membership tests, and comparison. It also introduces core list methods for creating, modifying, querying, and removing items, and includes illustrative sorting and search-related examples such as merge and quick sort.",{"@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/compound-data-lists-tuples-dictionaries-unit-iv-learning-notes/685771/",{"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/compound-data-lists-tuples-dictionaries-unit-iv-learning-notes/685771.png","ImageObject",300,407,{"name":92,"@type":93},"Jacob","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-23","2026-11-07",true,{"@type":102,"interactionType":103,"userInteractionCount":34},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is a list in Python and how is it written?","Question",{"text":112,"@type":113},"A list is an ordered sequence of items. It is written as comma-separated values inside square brackets, for example: ['Cheddar', 'Edam', 'Gouda'].","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How do list indexing and slicing work?",{"text":117,"@type":113},"Indexing accesses elements by position, including negative indexing for the last element. Slicing uses the form listname[start:stop] and listname[start:stop:steps], with defaults such as start=0 and stop=n-1, and [:] returning the entire list.",{"name":119,"@type":110,"acceptedAnswer":120},"Which common list operations and methods are covered in the unit?",{"text":121,"@type":113},"The unit covers indexing, slicing, concatenation (+), repetition (*), updating via index assignment, membership tests (in / not in), and comparison (== / !=). It also introduces methods like append, insert, extend, index, reverse, pop, remove, count, and copy.","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},685771,1794018217,{"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":34,"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":81,"preview_urls":145},962084931830,"https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd","| UNIT IV\u003Cbr>COMPOUND DATA: LISTS, TUPLES, DICTIONARIES |  |  |  |\n| --- | --- | --- | --- |\n| Lists, list operations, list slices, list methods, list loop, mutability, aliasing, cloning lists, list parameters; Tuples, tuple assignment, tuple as return value; Dictionaries: operations and methods; advanced list processing - list comprehension, Illustrative programs: selection sort, insertion sort, merge sort, quick sort. |  |  |  |\n| \u003Cbr>Lists |  |  |  |\n| 􀂙\u003Cbr>List is an ordered sequence of items. Values in the list are called elements / items.\u003Cbr>􀂙\u003Cbr>It can be written as a list of comma-separated items (values) between square brackets[] .\u003Cbr>Items in the lists can be of different data types.\u003Cbr>Eg: a=[10, 20, 30, 40]; b=[10, 20, “abc”, 4.5]\u003Cbr>The following list contains a string, a float, an integer, and (lo!) another list:['spam', 2.0, 5,[10, 20]]\u003Cbr>A list within another list is nested. A list that contains no elements is called an empty list; you can create one with empty brackets, [] .\u003Cbr>As you might expect, you can assign list values to variables:\u003Cbr>>>> cheeses = ['Cheddar', 'Edam', 'Gouda']\u003Cbr>>>> numbers = [17, 123]\u003Cbr>>>> empty = []\u003Cbr>>>> print cheeses, numbers, empty\u003Cbr>['Cheddar', 'Edam', 'Gouda'][17, 123][]\u003Cbr>Operations on list:\u003Cbr>1. Indexing\u003Cbr>2. Slicing\u003Cbr>3. Concatenation\u003Cbr>4. Repetitions\u003Cbr>5. Updating\u003Cbr>6. Membership\u003Cbr>7. Comparison |  |  |  |\n| operations | examples | \u003Cbr>description |  |\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 a list at 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 element using negative indexing. |  |\n|  |  |  |  |\n|  |  |  |  |\n\n\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| --- | --- | --- |\n| Concatenation | >>>b=[20,30]\u003Cbr>>>> print(a+b)\u003Cbr>[2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30] | Adding and printing the items of two lists. |\n| Repetition | >>> print(b*3)\u003Cbr>[20, 30, 20, 30, 20, 30] | Create a multiple copies of the same list. |\n\n\n|  |  |  |  |  |  |\n| --- | --- | --- | --- | --- | --- |\n| Updating |  |  | >>> print(a[2])\u003Cbr>4\u003Cbr>>>> a[2]=100\u003Cbr>>>> 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 is present in list. Otherwise returns 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 elements in both elements are same. Otherwise returns false |  |\n| \u003Cbr>List slices:\u003Cbr>􀂙\u003Cbr>List slicing is an operation that extracts a subset of elements from an list and packages them as another list.\u003Cbr>Syntax: |  |  |  |  |  |\n|  |  |  |  |  |  |\n| 􀂙􀂙􀂙􀂙 | Listname[start:stop]\u003Cbr>Listname[start:stop:steps]\u003Cbr>default start value is 0\u003Cbr>default stop value is n-1\u003Cbr>[:] this will print the entire list [2:2] this will create a empty slice |  |  |  |  |\n\n\n| slices | example | description |\n| --- | --- | --- |\n| a[0:3] | >>> a=[9,8,7,6,5,4]\u003Cbr>>>> a[0:3]\u003Cbr>[9, 8, 7] | Printing a part of a list from 0 to 2. |\n| a[:4] | >>> a[:4]\u003Cbr>[9, 8, 7, 6] | Default start value is [0. so](0. so)[ ](0. so)prints from 0 to 3 |\n| a[1:] | >>> a[1:]\u003Cbr>[8, 7, 6, 5, 4] | default stop value will ben-1. so prints from 1 to 5 |\n| a[:] | >>> a[:]\u003Cbr>[9, 8, 7, 6, 5, 4] | Prints the entire list. |\n\n| slices |  |  | example |  | description |  |  |  |  |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| a[2:2] |  |  | >>> a[2:2][] |  | print an empty slice |  |  |  |  |\n| a[0:6:2] |  |  | >>> a=[9,8,7,6,5,4]\u003Cbr>>>> a[0:6:2]\u003Cbr>[9, 7, 5]\u003Cbr>>>> a[0:6:3]\u003Cbr>[9,6] |  | Slicing list values with step size 2.(from index[0] to 2nd element and from that position to next 2nd e","cbCairXE6hhsHlm4","https://ap.wps.com/l/cbCairXE6hhsHlm4","pdf",1337726,23,"English","# Lists\n## List basics and elements\n## List operations\n## List slices\n## List methods\n# Tuples\n# Dictionaries\n# Advanced list processing","[{\"question\":\"What is a list in Python and how is it written?\",\"answer\":\"A list is an ordered sequence of items. It is written as comma-separated values inside square brackets, for example: ['Cheddar', 'Edam', 'Gouda'].\"},{\"question\":\"How do list indexing and slicing work?\",\"answer\":\"Indexing accesses elements by position, including negative indexing for the last element. Slicing uses the form listname[start:stop] and listname[start:stop:steps], with defaults such as start=0 and stop=n-1, and [:] returning the entire list.\"},{\"question\":\"Which common list operations and methods are covered in the unit?\",\"answer\":\"The unit covers indexing, slicing, concatenation (+), repetition (*), updating via index assignment, membership tests (in / not in), and comparison (== / !=). It also introduces methods like append, insert, extend, index, reverse, pop, remove, count, and copy.\"}]","Compound Data - Lists, Tuples, Dictionaries - Unit IV - Learning Notes | PDF",58,[146,150,154],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/7a9f33c0cf3447c33211e73192e93064.webp",983,1391,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/06d02c0bb7f341bcd05bdbe012ccba3f.webp",982,1389,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/c5697227264641ec45f2cb55428edb72.webp",981,1388,{"list":159,"token":66},[160,166,172,178,183,189,195,201,207,213],{"doc_id":161,"doc_title":162,"file_type":137,"home_preview_img_url":163,"slug":164,"view_count":81,"category_name":30,"create_tm":165},697975,"Python Variable Types - Variable Assignment, Multiple Assignment, and Standard Data Types","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146715/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=Xmy1L1X885chJ3NmeNUZpdTB3ww%3D","python-variable-types-variable-assignment-multiple-assignment-and-standard-data-types",1794446554,{"doc_id":167,"doc_title":168,"file_type":137,"home_preview_img_url":169,"slug":170,"view_count":24,"category_name":30,"create_tm":171},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=1796111279&Signature=d%2F9eL0HrlZW7sFjqELrgIqnHIk4%3D","1-tuples",1794018230,{"doc_id":173,"doc_title":174,"file_type":137,"home_preview_img_url":175,"slug":176,"view_count":19,"category_name":30,"create_tm":177},697980,"TUPLES AND DICTIONARIES - Introduction to Tuples","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146829/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=YleoQDELWbPIlnrtTABkiWmgSXI%3D","tuples-and-dictionaries-introduction-to-tuples",1794446564,{"doc_id":179,"doc_title":180,"file_type":137,"home_preview_img_url":181,"slug":182,"view_count":34,"category_name":30,"create_tm":165},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=1796111279&Signature=U3ojl%2FmMYtUHptb02KrRAxHFo5Y%3D","60001-lecture-5-tuples-lists-aliasing-mutability-cloning",{"doc_id":184,"doc_title":185,"file_type":137,"home_preview_img_url":186,"slug":187,"view_count":24,"category_name":30,"create_tm":188},685779,"Topic 6 - Lists, Sets, Tuples, Dictionaries","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203959/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=T9PrL%2Bsh4QPuKiX9puoZphWjnfA%3D","topic-6-lists-sets-tuples-dictionaries",1794018231,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":19,"category_name":30,"create_tm":194},697977,"UNIT-III-2 - Lists, Tuples, Dictionaries - 4.1 Lists - List Operations and Methods","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146775/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=YwVRV1UnaNrMRGWk20UqVaM2V%2Fo%3D","unit-iii-2-lists-tuples-dictionaries-41-lists-list-operations-and-methods",1794446558,{"doc_id":196,"doc_title":197,"file_type":137,"home_preview_img_url":198,"slug":199,"view_count":81,"category_name":30,"create_tm":200},685772,"UNIT-IV - LIST, TUPLES, DICTIONARIES - Problem Solving and Python Programming","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203776/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=pOi6iEwuQc7YW2o9J89XdK60weg%3D","unit-iv-list-tuples-dictionaries-problem-solving-and-python-programming",1794018219,{"doc_id":202,"doc_title":203,"file_type":137,"home_preview_img_url":204,"slug":205,"view_count":19,"category_name":30,"create_tm":206},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=1796111279&Signature=agQGg4lDzTpas5YTTyEnkz%2B4UK4%3D","list-in-python-a-beginner-guide",1794016087,{"doc_id":208,"doc_title":209,"file_type":137,"home_preview_img_url":210,"slug":211,"view_count":81,"category_name":30,"create_tm":212},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=1796111279&Signature=NdAgdq9zphLTZrUrw3CVgvaNkck%3D","lists-and-tuples-learn-to-create-and-use-1d-lists-tuples-and-2d-lists",1794018226,{"doc_id":214,"doc_title":215,"file_type":137,"home_preview_img_url":216,"slug":217,"view_count":34,"category_name":30,"create_tm":200},685773,"Lists and Tuples - Chapter 7 - Programming Concepts","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203784/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=QRPSKHShjh4moTlCA3yFemUJg0Y%3D","lists-and-tuples-chapter-7-programming-concepts"]