[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-685772-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-685772-en":130,"doc-similar-685772":191},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","unit-iv-list-tuples-dictionaries-problem-solving-and-python-programming","UNIT-IV - LIST, TUPLES, DICTIONARIES - Problem Solving and Python Programming","","UNIT-IV covers core Python data structures focusing on lists, tuples, and their related operations. It defines lists with examples, explains list operations using + and * and demonstrates list slicing. It further discusses cloning, negative indexing, aliasing, list methods and common method types, and how list parameters pass references so mutations affect callers. The unit then defines tuples, tuple assignment, tuple return values, list comprehensions, tuple functions, and the differences between lists and tuples, concluding with mutable versus immutable concepts.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/unit-iv-list-tuples-dictionaries-problem-solving-and-python-programming/685772/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/unit-iv-list-tuples-dictionaries-problem-solving-and-python-programming/685772.png","ImageObject",300,407,{"name":42,"@type":43},"\tCallum ","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-12","2026-11-07",true,{"@type":52,"interactionType":53,"userInteractionCount":30},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"What is a Python list and how are list elements identified?","Question",{"text":62,"@type":63},"A list is an ordered set of values where each value is identified by an index. The values inside a list are called elements or items.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"How do list slicing and negative indexing work?",{"text":67,"@type":63},"Slicing produces a sub-sequence from a list using slice boundaries like t[1:3], t[:4], or t[3:]. Negative indexing counts backward from the end, for example Fruit(-1) refers to the last element.",{"name":69,"@type":60,"acceptedAnswer":70},"What is the key difference between tuples and lists in Python?",{"text":71,"@type":63},"Lists are enclosed in square brackets and their elements can be changed, while tuples are enclosed in parentheses and cannot be updated because they are immutable.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},685772,1794018219,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":30,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":79,"read_time":144,"preview_page_count":145,"preview_urls":146},137451211410,"https://ap-avatar.wpscdn.com/avatar/2000bb0a9246f588df?x-image-process=image/resize,m_fixed,w_180,h_180&k=1786362646172706240","UNIT-IV  \nLIST,TUPLES,DICTIONARIES  \nTWO MARKS:  \n1. Define List with example?  \n􀁸 A List is an ordered set of values, where each value is identified by an index.  \n􀁸 The Values that make up a list are called its elements or items.  \nExample 1:[10, 20, 30, 40] \\# list of four integers  \nExample 2:['frog', 'Dog', 'Cow'] \\# list of three strings  \n2. What are the list operations?  \n􀁸 Lists respond to the + and * operators much like strings; they mean concatenation and repetition here too, except that the result is a new list, not a string.  \n􀁸 The + operator concatenates lists:>>> a = [1, 2, 3]  \n>>> b = [4, 5, 6]  \n>>> c = a + b  \n>>> print c  \n[1, 2, 3, 4, 5, 6]  \n􀁸 Similarly, the * operator repeats a list a given number of times:  \n>>> [0] * 4  \n[0, 0, 0, 0]\\# It repeats [0] four times  \n>>> [1, 2, 3] * 3  \n[1, 2, 3, 1, 2, 3, 1, 2, 3] \\# It repeats the list [1, 2, 3] three times.  \n3. Describe list slicing with examples.  \n􀂾 A sub-sequence of a sequence is called a slice and the operation that performs on subsequence is called slicing.  \nThe slice operator also works on lists:  \n>>> t = ['a', 'b', 'c', 'd', 'e', 'f']  \n>>> t[1:3]  \nOutput : ['b', 'c']  \n>>> t[:4]  \nOutput:['a', 'b', 'c', 'd']  \n>>> t[3:]  \nOutput:['d', 'e', 'f']  \n>>> t[:]  \nOutput : ['a', 'b', 'c', 'd', 'e', 'f']  \n4. What is Cloning of List?  \n􀂾 Cloning is the process of modifying a list and also keeps a copy of the original. The entire list is copied not just the reference.  \n􀂾 This process is sometimes called cloning, to avoid the ambiguity of the copy.  \n􀂾 The easiest way to clone a list is to use the slice operator.  \nExample:  \n>>>a=[1,2,3]  \n>>>b=a[:]  \n>>>print b [1,2,3] .  \n5. Illustrate negative indexing in list with an example.  \n􀁸 Index can have negative value, it counts backward from the list.  \nExample:  \n>>> Fruit = ['Apple', 'Grapes', 'Orange']  \n>>>Fruit(0) = ‘pear’>>>Fruit(-1) = ‘Jackfruit’>>>print (fruit)  \n[‘pear’, ‘grape’, ‘Jackfruit’]  \n6. What is Aliasing?  \n􀁸 More than one list variable can point to the same data. This is called an alias.  \n􀁸 If ‘A’ refers to an object and you assign ‘ B = A’, then both variables refer to the same object:  \n>>> A = [1, 2, 3]  \n>>> B= A  \n>>> B is A  \nTrue  \n7. What is the purpose of list methods? Types of List method?  \n􀁸 Python has a number of built-in data structures, including lists.  \n􀁸 Data structures provides us with a way to organize and store data.  \n􀁸 We can use built-in methods to retrieve or manipulate that data.  \n\n| 1.List.append( ) | 5.List.insert ( ) | 9.List.reverse( ) |\n| --- | --- | --- |\n| 2.List.remove( ) | 6.List.pop ( ) | 10.List.clear ( ) |\n| 3.List.copy ( ) | 7.List.sort ( ) | 11.List.index ( ) |\n| 4.List. Count ( ) | 8.List.extend ( ) |  |\n\n8. What is the List Parameter?  \n􀁸 Passing a list as an argument actually passes a reference to the list, not a copy of the list. Since list mutable changes made to the parameter changes the argument as well.  \n􀁸 When you pass a list to a function, the function gets a reference to the list. If the function modifies a list parameter, the caller sees the change.  \nFor example, delete_head removes the first element from a list:  \ndef delete_head(t): del t[0]  \nHere’s how it is used:>>> letters = ['a', 'b', 'c']>>> delete_head(letters)  \n>>> print letters ['b', 'c'] .  \n9. Define Tuples?  \n􀁸 A tuple is a sequence of values.  \n􀁸 The values can be any type, and they are indexed by integers, so in that respect tuples are alot like lists. The important difference is that tuples are immutable.  \nSyntactically, a tuple is a comma-separated list of values:  \n>>> t = 'a', 'b', 'c', 'd', 'e'  \nAlthough it is not necessary, it is common to enclose tuples in parentheses:  \n>>> t = ('a', 'b', 'c', 'd', 'e')  \nTo create a tuple with a single element, you have to include the final comma:  \n>>> t1 = ('a',)  \n>>> type(t1)  \n\u003Ctype 'tuple'>  \n10. Give Example for Tuple Assignment?  \n􀁸 One of the unique features of the python language is the ability to have a tup","cbCaifP7oR2BbFMF","https://ap.wps.com/l/cbCaifP7oR2BbFMF","pdf",2680009,101,"English","# List\n## List definition and examples\n## List operations (+, *)\n## List slicing\n## Cloning, aliasing, negative indexing\n## List methods and list parameters\n# Tuples\n## Tuple definition and examples\n## Tuple assignment and return values\n## List comprehension\n## Tuple functions\n## Tuples vs lists\n# Mutable vs immutable","[{\"question\":\"What is a Python list and how are list elements identified?\",\"answer\":\"A list is an ordered set of values where each value is identified by an index. The values inside a list are called elements or items.\"},{\"question\":\"How do list slicing and negative indexing work?\",\"answer\":\"Slicing produces a sub-sequence from a list using slice boundaries like t[1:3], t[:4], or t[3:]. Negative indexing counts backward from the end, for example Fruit(-1) refers to the last element.\"},{\"question\":\"What is the key difference between tuples and lists in Python?\",\"answer\":\"Lists are enclosed in square brackets and their elements can be changed, while tuples are enclosed in parentheses and cannot be updated because they are immutable.\"}]","UNIT-IV - LIST, TUPLES, DICTIONARIES - Problem Solving and Python Programming | PDF",255,11,[147,151,155,159,163,167,171,175,179,183,187],{"page_no":22,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/aa6e2b7c9d7ebd832895f72bf5bfa775.webp",983,1390,{"page_no":26,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/0bb1f1b6fd50f8b114f1abef13adaf4e.webp",982,1388,{"page_no":30,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/da803f9de1b58a355cc6f3bb6ee84734.webp",981,1387,{"page_no":33,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/678fb12405eb4e9e8b9ab3407371e52d.webp",980,1385,{"page_no":96,"url":164,"width":165,"height":166},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/626942075f3aa9f83cf95aa821b9dbcc.webp",979,1384,{"page_no":101,"url":168,"width":169,"height":170},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/1f3298fe57b1f838ab1a2c9fe91d20a0.webp",978,1383,{"page_no":105,"url":172,"width":173,"height":174},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/d32ea1fe3704ff3974f25420b68912eb.webp",977,1381,{"page_no":110,"url":176,"width":177,"height":178},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/8675dbbc9a61c4350dd9f6836765e868.webp",976,1380,{"page_no":115,"url":180,"width":181,"height":182},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/7f949148a64ee3e2ea17b40effe71419.webp",975,1378,{"page_no":123,"url":184,"width":185,"height":186},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/9ea4f20d8a644aaffb5b405c0d98ce88.webp",974,1377,{"page_no":145,"url":188,"width":189,"height":190},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/b20b8f2df1d9b0552d53f0542c6d6a51.webp",973,1375,{"list":192,"token":11},[193,199,205,211,217,223,229,235,240,246],{"doc_id":194,"doc_title":195,"file_type":137,"home_preview_img_url":196,"slug":197,"view_count":105,"category_name":29,"create_tm":198},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=1796111999&Signature=ifyKtNbn2YC4beXkWXMFocXzzyY%3D","60001-lecture-5-tuples-lists-aliasing-mutability-cloning",1794446554,{"doc_id":200,"doc_title":201,"file_type":137,"home_preview_img_url":202,"slug":203,"view_count":30,"category_name":29,"create_tm":204},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=1796111999&Signature=gc%2B2npMvn6v8Fxr%2BQTfzF11871A%3D","lists-and-tuples-learn-to-create-and-use-1d-lists-tuples-and-2d-lists",1794018226,{"doc_id":206,"doc_title":207,"file_type":137,"home_preview_img_url":208,"slug":209,"view_count":33,"category_name":29,"create_tm":210},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=1796111999&Signature=ndtMg7VKuh%2FVZnGgkoFg2qKMT3g%3D","tuples-and-dictionaries-introduction-to-tuples",1794446564,{"doc_id":212,"doc_title":213,"file_type":137,"home_preview_img_url":214,"slug":215,"view_count":33,"category_name":29,"create_tm":216},685780,"Tuple in Python - Lecture 2","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000203975/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=tpz81tw8DAmjuqvzC35DzDextZc%3D","tuple-in-python-lecture-2",1794018232,{"doc_id":218,"doc_title":219,"file_type":137,"home_preview_img_url":220,"slug":221,"view_count":96,"category_name":29,"create_tm":222},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=1796111999&Signature=Ivzhs6oX%2BGDj6JR9WD2HpXbL11U%3D","topic-6-lists-sets-tuples-dictionaries",1794018231,{"doc_id":224,"doc_title":225,"file_type":137,"home_preview_img_url":226,"slug":227,"view_count":101,"category_name":29,"create_tm":228},697978,"Lecture 4: Tuples, List Slicing, List Comprehension, Strings","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146771/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=rwwZmmC7gwYmPKYiUIXUQjEmUKI%3D","lecture-4-tuples-list-slicing-list-comprehension-strings",1794446559,{"doc_id":230,"doc_title":231,"file_type":137,"home_preview_img_url":232,"slug":233,"view_count":96,"category_name":29,"create_tm":234},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=1796111999&Signature=D3wxv0cFXXA2AOvXbuAWe7DbHJg%3D","1-tuples",1794018230,{"doc_id":236,"doc_title":237,"file_type":137,"home_preview_img_url":238,"slug":239,"view_count":105,"category_name":29,"create_tm":79},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=1796111999&Signature=kx6s1pNU36hyyYlAEUNFYt5aGXc%3D","lists-and-tuples-chapter-7-programming-concepts",{"doc_id":241,"doc_title":242,"file_type":137,"home_preview_img_url":243,"slug":244,"view_count":101,"category_name":29,"create_tm":245},685629,"Chapter 2: Lists, Arrays and Dictionaries","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999084017/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=kREccyYa27NHolZjZpJfsR4Xbwk%3D","chapter-2-lists-arrays-and-dictionaries",1794016092,{"doc_id":247,"doc_title":248,"file_type":137,"home_preview_img_url":249,"slug":250,"view_count":105,"category_name":29,"create_tm":251},670917,"Python 3 Cheat Sheet - concise reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988704071/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=ihL%2FTMsBjTd6lOjac%2BtMSUrgsTI%3D","python-3-cheat-sheet-concise-reference",1793572698]