[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-685627-105":59,"doc-detail-685627-en":130,"doc-similar-685627":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","list-in-python-a-beginner-guide","List in Python - A Beginner Guide -","","Covers the fundamentals of Python lists, including list creation syntax and example assignments. Explains how to access elements using indexing and slicing operators, including both non-negative and negative indexing to retrieve items from the left and right. Introduces common list operators such as concatenation (+), repetition (*), slicing ([] and [:]), and membership checks (in, not in). Also demonstrates updating or changing list elements via slice assignment and direct item assignment with sample outputs.",{"@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/list-in-python-a-beginner-guide/685627/",{"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/list-in-python-a-beginner-guide/685627.png","ImageObject",300,407,{"name":92,"@type":93},"Jasmine","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-18","2026-11-07",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},"How do you create a list in Python?","Question",{"text":112,"@type":113},"A Python list is defined using square brackets and comma-separated values, e.g., list_var = [value1, value2].","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How does list indexing work in Python?",{"text":117,"@type":113},"List indexing starts at 0 from the left, and you can also use negative indices starting at -1 from the right. Slicing can access ranges with the [] operator.",{"name":119,"@type":110,"acceptedAnswer":120},"What are the key list operators covered in this guide?",{"text":121,"@type":113},"The guide covers concatenation (+), repetition (*), slicing ([] and [:]), and membership operators (in and not in) to check whether items exist in a list.","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},685627,1794016087,{"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":81,"preview_urls":145},2336478487870,"https://ap-avatar.wpscdn.com/davatar_085a072bc5b1113ac321206ff7593b45","List in Python  \nList Creation  \nList in Python  \n• In python, a list can be defined as a collection of values or items.  \n• The items in the list are separated with the comma (,) and enclosed with the square brackets [ ] .  \nSyntax:  \nlist-var = [ value1, value2, value3,…. ]  \nExample: “[listdemo.py](listdemo.py)”  \nL1 = []  \nL2 = [123 , \"python\" , 3 .7] L3 = [1 , 2 , 3 , 4 , 5 , 6] L4 = [\"C\" , \"Java\" , \"Python\"] print(L1)  \nprint(L2)  \nprint(L3)  \nprint(L4)  \nOutput:  \npython [listdemo.py](listdemo.py)  \n[]  \n[123 , 'python' , 3 .7][1 , 2 , 3 , 4 , 5 , 6][ 'C' , 'Java', 'Python ' ]  \nList Indexing  \nList Indexing in Python  \n• Like string sequence, the indexing of the python lists starts from 0, i.e. the first element of the list is stored at the 0th index, the second element of the list is stored at the 1st index, and so on.  \n• The elements of the list can be accessed by using the slice operator [] .  \nExample:  \nmylist=[‘banana’,’apple’,’mango’,’tomato’,’berry’]  \n• mylist[0]=”banana” mylist[1:3]=[”apple”,”mango”]  \n• mylist[2]=”mango”  \nList Indexing in Python cont…  \n• Unlike other languages, python provides us the flexibility to use the negative indexing also. The negative indices are counted from the right.  \n• The last element (right most) of the list has the index -1, its adjacent left element is present at the index-2 and so on until the left most element is encountered.  \nExample: mylist=[‘banana’,’apple’,’mango’,’tomato’,’berry’]  \n• mylist [-1]=”berry” mylist [-4:-2]=[“apple”, mango”]  \n• mylist [-3]=”mango”  \nList Operators  \nList Operators in Python  \n\n| + | It is known as concatenation operator used to concatenate two lists. |\n| --- | --- |\n| * | It is known as repetition operator. It concatenates the multiple copies of the same list. |\n| [] | It is known as slice operator. It is used to access the list item from list. |\n| [:] | It is known as range slice operator. It is used to access the range of list items from list. |\n| in | It is known as membership operator. It returns if a particular item is present in the specified list. |\n| not in | It is also a membership operator and It returns true if a particular list item is not present in the list. |\n\nList Operators in Python cont…  \nExample: “[listopdemo.py](listopdemo.py)”  \nnum=[1 , 2 , 3 ,4 , 5]  \nlang=[ 'python' , 'c' , 'java' , 'php ' ]  \nprint(num + lang) \\#concatenates two lists  \nprint(num * 2) \\#concatenates same list 2 times print (lang[2]) \\# prints 2nd index value print (lang[1:4]) \\#prints values from 1st to 3rd index. print ( 'cpp ' in lang) \\# prints False  \nprint (6 not in num) \\# prints True  \nOutput: python listopdemo.py  \n[1 , 2 , 3 , 4 , 5 , 'python' , 'c' , 'java' , 'php ' ][1 , 2 , 3 , 4 , 5 , 1 , 2 , 3 , 4 , 5]  \njava  \n[ 'c' , 'java' , 'php ' ]  \nFalse  \nTrue  \nHow to update or change elements to a list?  \n• Python allows us to modify the list items by using the slice and assignment operator.  \n• We can use assignment operator ( = ) to change an item or a range of items.  \nExample: “[listopdemo1.py](listopdemo1.py)”  \nnum=[1 , 2 , 3 ,4 , 5] print(num) num[2]=30 print(num) num[1:3]=[25 , 36] print(num)  \nnum[4]=\"Python\"  \nprint(num)  \nOutput:  \npython listopdemo1 .py  \n[1 , 2 , 3 , 4 , 5]  \n[1 , 2 , 30 , 4 , 5]  \n[1 , 25 , 36 , 4 , 5]  \n[1 , 25 , 36 , 4 , 'Python' ]","cbCaiqwDiw4tIRtE","https://ap.wps.com/l/cbCaiqwDiw4tIRtE","pdf",1134365,28,"English","# List Creation\n## List Indexing\n## List Operators\n## How to Update or Change Elements to a List","[{\"question\":\"How do you create a list in Python?\",\"answer\":\"A Python list is defined using square brackets and comma-separated values, e.g., list_var = [value1, value2].\"},{\"question\":\"How does list indexing work in Python?\",\"answer\":\"List indexing starts at 0 from the left, and you can also use negative indices starting at -1 from the right. Slicing can access ranges with the [] operator.\"},{\"question\":\"What are the key list operators covered in this guide?\",\"answer\":\"The guide covers concatenation (+), repetition (*), slicing ([] and [:]), and membership operators (in and not in) to check whether items exist in a list.\"}]","List in Python - A Beginner Guide - | PDF",71,[146,150,154],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/a1c2038eee8a755b8ecd59b1069257c4.webp",983,737,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/5db5f947b15b73aaac725cec95605760.webp",982,736,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/b3ca99598b1c9f01ea5b2fa24e970903.webp",981,735,{"list":159,"token":66},[160,166,172,178,184,190,196,202,208,214],{"doc_id":161,"doc_title":162,"file_type":137,"home_preview_img_url":163,"slug":164,"view_count":34,"category_name":30,"create_tm":165},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=1796111999&Signature=F7DLudLeL7w0ZXnUPDQvD7bq7Ok%3D","compound-data-lists-tuples-dictionaries-unit-iv-learning-notes",1794018217,{"doc_id":167,"doc_title":168,"file_type":137,"home_preview_img_url":169,"slug":170,"view_count":29,"category_name":30,"create_tm":171},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=1796111999&Signature=W6KIeLwh5ouCLW5TuOGi4N9PB8g%3D","python-collections-arrays-list-and-function",1794016101,{"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},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=1796111999&Signature=5U4bKpm8yvXcwjCLebuC%2BNxYPwQ%3D","unit-iii-2-lists-tuples-dictionaries-41-lists-list-operations-and-methods",1794446558,{"doc_id":179,"doc_title":180,"file_type":137,"home_preview_img_url":181,"slug":182,"view_count":24,"category_name":30,"create_tm":183},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":185,"doc_title":186,"file_type":137,"home_preview_img_url":187,"slug":188,"view_count":81,"category_name":30,"create_tm":189},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=1796111999&Signature=%2BmcA6ERW4OuXSQFq4SbeMbNyzY4%3D","python-variable-types-variable-assignment-multiple-assignment-and-standard-data-types",1794446554,{"doc_id":191,"doc_title":192,"file_type":137,"home_preview_img_url":193,"slug":194,"view_count":24,"category_name":30,"create_tm":195},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=1796111999&Signature=3zUMhSnQ6eajji96nyL5FcJra7o%3D","cheat_sheet-python-final-medium-list-comprehension-indexing",1793572695,{"doc_id":197,"doc_title":198,"file_type":137,"home_preview_img_url":199,"slug":200,"view_count":24,"category_name":30,"create_tm":201},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=1796111999&Signature=sMRO%2BZcKYyfo9yetNMVF7USi7Cw%3D","introduction-to-list-list-operations-traversing-a-list-list-methods-and-built-in-functions",1794016095,{"doc_id":203,"doc_title":204,"file_type":137,"home_preview_img_url":205,"slug":206,"view_count":34,"category_name":30,"create_tm":207},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",1794018219,{"doc_id":209,"doc_title":210,"file_type":137,"home_preview_img_url":211,"slug":212,"view_count":24,"category_name":30,"create_tm":213},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":215,"doc_title":216,"file_type":137,"home_preview_img_url":217,"slug":218,"view_count":34,"category_name":30,"create_tm":219},685788,"Python Arrays - Learn How to Create, Access, and Modify Lists","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999694760/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=rs2oamYMpxB9v0LHyUCQfZcaXlM%3D","python-arrays-learn-how-to-create-access-and-modify-lists",1794018478]