[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-685788-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-685788-en":130,"doc-similar-685788":154},{"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":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","python-arrays-learn-how-to-create-access-and-modify-lists","Python Arrays - Learn How to Create, Access, and Modify Lists","","Python Arrays lecture explains how Python represents arrays through lists and why lists are commonly used instead of a native array structure. It guides learners through creating lists/arrays, accessing elements with zero-based and negative indexing, finding length with len(), adding items via append(), and removing elements using del, remove(), and pop(). It also covers element modification through indexing and assignment, and introduces slicing and multidimensional concepts.",{"@graph":14,"@context":73},[15,34,56],{"@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/python-arrays-learn-how-to-create-access-and-modify-lists/685788/",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/python-arrays-learn-how-to-create-access-and-modify-lists/685788.png","ImageObject",300,407,{"name":42,"@type":43},"Chumphorn","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-25","2026-11-07",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",7,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"How are arrays represented in Python, and why?","Question",{"text":63,"@type":64},"Python has no native array data structure, so lists are used as the array-like structure for storing elements. Lists can hold items of any data type, making them more flexible.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How do you access elements in a Python array/list?",{"text":68,"@type":64},"Use indexing inside square brackets with zero-based positions (arr[0], arr[1], ...). Python also supports negative indexing where arr[-1] is the last element and arr[-2] is the second to last.",{"name":70,"@type":61,"acceptedAnswer":71},"What methods can add or remove elements from a Python array/list?",{"text":72,"@type":64},"To add elements, use append(). To remove elements, use del with an index, remove() by value, or pop() by index.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},685788,1794018478,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,105,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":102,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":103,"slug":104},6,50,"technology",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},"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":97,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":102,"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":55,"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":80,"read_time":144,"preview_page_count":26,"preview_urls":145},2336475401981,"https://ap-avatar.wpscdn.com/avatar/22000c94efd8d5204d?x-image-process=image/resize,m_fixed,w_180,h_180&k=1786935347598174694","Python Arrays  \nIn this lecture, you’ll learn about arrays in Python. More specifically, you will learn to create arrays, modify them, access elements and so on with the help of examples.  \nTable of Contents  \n􀁸 Python Array (Introduction)  \n􀁸 Create an Array  \n􀁸 Access elements of an Array  \noArray Index  \noNegative Indexing  \n􀁸 Find length of an Array  \n􀁸 Add an element to an Array  \n􀁸 Remove elements from an Array  \n􀁸 Modify elements of an Array  \no Python operators to modify elements in Array  \n􀁸 Slicing an Array?  \n􀁸 Python Array Methods  \n􀁸 Multidimensional Arrays  \nArrays are fundamental part of most programming languages. It is the collection of elements of a single data type, eg. array of int, array of string.  \nHowever, in Python, there is no native array data structure. So, we use Python lists instead of an array.  \nNote:  If you want to create real arrays in Python, you need to use NumPy's array data structure. For mathematical problems, NumPy Array is more efficient.  \nUnlike arrays, a single list can store elements of any data type and does everything an array does. We can store an integer, a float and a string inside the same list. So, it is more flexible to work with.  \n[10, 20, 30, 40, 50 ] is an example of what an array would look like in Python, but it is actually a list.  \nList basics  \nA list in Python is just an ordered collection of items which can be of any type. By comparison an array is an ordered collection of items of a single type –  \nso in principle a list is more flexible than an array but it is this flexibility that makes things slightly harder when you want to work with a regular structure.  \nA list is also a dynamic mutable type and this means you can add and delete elements from the list at any time.  \n􀁸 To define a list you simply write a comma separated list of items in square brackets:  \nmyList=[1,2,3,4,5,6]  \nThis looks like an array because you can use \"slicing\" notation to pick out an individual element- indexes start from 0. For example  \nprint myList[2]  \nwill display the third element, i.e. the value 3 in this case. Similarly to change the third element you can assign directly to it:  \nmyList[2]=100  \nThe slicing notation looks like array indexing but it is a lot more flexible. For example  \nmyList[2:5]  \nis a sublist from the third element to the fifth i.e. from myList[2] to myList[4] . notice that the final element specified i.e. [5] is not included in the slice.  \nAlso notice that you can leave out either of the start and end indexes and they will be assumed to have their maximum possible value. For example  \nmyList[5:]  \nis the list from List[5] to the end of the list and , Finally is it worth knowing that the list you assign to a slice doesn't have to be the same size as the slice -it simply replaces it even if it is a different size.  \nCreate an Array  \nWe can create a Python array with comma separated elements between square brackets[] .  \nExample 1 : How to create an array in Python? We can make an integer array and store it to arr.  \narr = [10 , 20 , 30 , 40 , 50]  \nAccess elements of an Array  \nWe can access individual elements of an array using index inside square brackets [] .  \nArray Index  \nIndex is the position of element in an array. In Python, arrays are zero-indexed. This means, the element's position starts with 0 instead of 1.  \nExample 2: Accessing elements of array using indexing  \narr = [10 , 20 , 30 , 40 , 50] print(arr[0])  \nprint(arr[1])  \nprint(arr[2])  \nWhen we run the above program, the output will be:  \n10  \n20  \n30  \nHere, the first element of arr is arr[0], second is arr[1], third is arr[2], and so on.  \n Negative Indexing  \nPython programming supports negative indexing of arrays, something that is not available in arrays in most programming languages.  \nThis means the index value of-1 gives the last element, and-2 gives the second to last element of an array.  \nExample 3: Accessing elements of array using negative indexing  \narr = [10 , 20 , 30 , 40 ,","cbCaie9m8xN813xZ","https://ap.wps.com/l/cbCaie9m8xN813xZ","pdf",644561,11,"English","# Python Array (Introduction)\n## Create an Array\n## Access elements of an Array\n### Array Index\n### Negative Indexing\n## Find length of an Array\n## Add an element to an Array\n## Remove elements from an Array\n## Modify elements of an Array\n## Slicing an Array?\n## Python Array Methods\n## Multidimensional Arrays","[{\"question\":\"How are arrays represented in Python, and why?\",\"answer\":\"Python has no native array data structure, so lists are used as the array-like structure for storing elements. Lists can hold items of any data type, making them more flexible.\"},{\"question\":\"How do you access elements in a Python array/list?\",\"answer\":\"Use indexing inside square brackets with zero-based positions (arr[0], arr[1], ...). Python also supports negative indexing where arr[-1] is the last element and arr[-2] is the second to last.\"},{\"question\":\"What methods can add or remove elements from a Python array/list?\",\"answer\":\"To add elements, use append(). To remove elements, use del with an index, remove() by value, or pop() by index.\"}]","Python Arrays - Learn How to Create, Access, and Modify Lists | PDF",28,[146,150],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/dd277790b73dc1c0378ab9b5be7289a9.webp",983,1272,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/5830cdd0480a11fd475c5544b908d216.webp",982,1270,{"list":155,"token":11},[156,162,168,174,180,186,192,198,204,210],{"doc_id":157,"doc_title":158,"file_type":137,"home_preview_img_url":159,"slug":160,"view_count":102,"category_name":29,"create_tm":161},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=1796110919&Signature=ajl3BoFbxDAy2LAyAw5ZkFnW%2FLE%3D","python-collections-arrays-list-and-function",1794016101,{"doc_id":163,"doc_title":164,"file_type":137,"home_preview_img_url":165,"slug":166,"view_count":97,"category_name":29,"create_tm":167},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=1796110919&Signature=zlASacymuevQaV5XhoouEYZ34Rs%3D","cheat_sheet-python-final-medium-list-comprehension-indexing",1793572695,{"doc_id":169,"doc_title":170,"file_type":137,"home_preview_img_url":171,"slug":172,"view_count":33,"category_name":29,"create_tm":173},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=1796110919&Signature=TMQuGDZFpJbjOmXXrizqn5yENfU%3D","unit-iii-2-lists-tuples-dictionaries-41-lists-list-operations-and-methods",1794446558,{"doc_id":175,"doc_title":176,"file_type":137,"home_preview_img_url":177,"slug":178,"view_count":97,"category_name":29,"create_tm":179},685805,"Numpy - Array - Chapter 11 - Informatics Practices","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000213217/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110919&Signature=tp1%2B6xr6wndzRvRYv83fP3VxrGg%3D","numpy-array-chapter-11-informatics-practices",1794018711,{"doc_id":181,"doc_title":182,"file_type":137,"home_preview_img_url":183,"slug":184,"view_count":102,"category_name":29,"create_tm":185},685790,"NumPy and SciPy Tutorial - Installation and Array Fundamentals","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000209033/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110919&Signature=szRqStlxiaDfFsIIQLbmLtERlXU%3D","numpy-and-scipy-tutorial-installation-and-array-fundamentals",1794018485,{"doc_id":187,"doc_title":188,"file_type":137,"home_preview_img_url":189,"slug":190,"view_count":30,"category_name":29,"create_tm":191},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=1796110919&Signature=mpRsoDgvmE9s4Uz4yEfosaL1y5E%3D","lists-and-tuples-learn-to-create-and-use-1d-lists-tuples-and-2d-lists",1794018226,{"doc_id":193,"doc_title":194,"file_type":137,"home_preview_img_url":195,"slug":196,"view_count":97,"category_name":29,"create_tm":197},685783,"Programming for GCSE Topic 6.1 - Lists, Arrays, and For Loops","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000208895/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110919&Signature=nkIrKCmey7uCoWQfOsXce3mJNzw%3D","programming-for-gcse-topic-61-lists-arrays-and-for-loops",1794018470,{"doc_id":199,"doc_title":200,"file_type":137,"home_preview_img_url":201,"slug":202,"view_count":55,"category_name":29,"create_tm":203},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=1796110919&Signature=WBYP%2FhM2OxHPjCwXNvzXloOO944%3D","lists-and-tuples-chapter-7-programming-concepts",1794018219,{"doc_id":205,"doc_title":206,"file_type":137,"home_preview_img_url":207,"slug":208,"view_count":97,"category_name":29,"create_tm":209},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=1796110919&Signature=PnVXVOor8erMLG5xbQ4iTpRvDvY%3D","1-tuples",1794018230,{"doc_id":211,"doc_title":212,"file_type":137,"home_preview_img_url":213,"slug":214,"view_count":33,"category_name":29,"create_tm":215},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=1796110919&Signature=ZWHQ0YsNcMx3cwBudBdGaSc0g0o%3D","list-in-python-a-beginner-guide",1794016087]