[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-685783-105":59,"doc-detail-685783-en":130,"doc-similar-685783":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","programming-for-gcse-topic-61-lists-arrays-and-for-loops","Programming for GCSE Topic 6.1 - Lists, Arrays, and For Loops","","This educational resource, part of the Teaching London Computing series, provides a comprehensive introduction to lists and arrays within the Python programming environment for GCSE-level students. It explores the conceptual differences between traditional arrays and Python's more flexible list structure, emphasizing the essential role of collection variables in data representation. The document covers fundamental list operations, including indexing, accessing elements, updating specific entries, and basic looping mechanics, supported by clear code examples. Through logical progression, it demonstrates how to handle array-like behavior in Python, including practical tasks like swapping list elements. This material serves as a foundational guide for understanding data structures, variable manipulation, and iterative logic in modern programming curricula, designed to help students bridge the gap between abstract concepts and practical implementation.",{"@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/programming-for-gcse-topic-61-lists-arrays-and-for-loops/685783/",{"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/programming-for-gcse-topic-61-lists-arrays-and-for-loops/685783.png","ImageObject",300,407,{"name":92,"@type":93},"Aditya","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-22","2026-11-07",true,{"@type":102,"interactionType":103,"userInteractionCount":24},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"Why are lists in Python often used instead of traditional arrays?","Question",{"text":112,"@type":113},"Python lists are more flexible than traditional arrays, which typically have fixed sizes and limited operations. Lists allow for more dynamic data handling and provide 'array-like' behavior that is simpler to implement in Python.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How are elements accessed and updated in a Python list?",{"text":117,"@type":113},"Elements are accessed using their index, which starts at 0 and goes up to the length of the list minus one. You can update an entry by assigning a new value to a specific index, such as list_name[index] = new_value.",{"name":119,"@type":110,"acceptedAnswer":120},"What is the result of attempting to swap two elements in a list using sequential assignments?",{"text":121,"@type":113},"If you simply assign one index to another (e.g., myl[2] = myl[3] then myl[3] = myl[2]), the original value at the first index is overwritten, resulting in two identical values at both positions instead of a successful swap.","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},685783,1794018470,{"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":24,"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},962085564549,"https://ap-avatar.wpscdn.com/davatar_085a072bc5b1113ac321206ff7593b45","Teaching London Computing  \nProgramming for GCSE Topic 6.1: Lists (Arrays)  \nand For Loop  \nWilliam Marsh  \nSchool of Electronic Engineering and Computer Science Queen Mary University of London  \nOutline  \n• Array in Python – the issues  \n• Lists – behaviour that is like an array  \n• Looping through a list  \n• Lists – other behaviour  \n• For loops  \nArrays in Python – The Issue  \n• Python does not have arrays  \n• (A slight simplification)  \n• There are two alternatives  \n• Lists  \n• Dictionaries  \n• Both are more flexible than‘ordinary’arrays  \n• Lists  \n• Simpler  \n• 'Array-like' behaviour  \nBig Idea  \n• A variable can have a value that combines many values . You can:  \n• Extract one value  \n• Update part of the variable  \n• This idea is essential for representing complex data in programs e.g.  \n• A song  \n• An image  \n• A map  \nARRAY BEHAVIOUR OF LISTS  \n‘Simple’Arrays  \n• Size (length) is fixed  \n• When you start using it  \n• Can  \n• Select (i.e . index) one entry  \n• Update one entry  \n• Cannot  \n• Add an extra entry to the start/end  \n• Insert/remove item from middle  \nIndex Into An Array  \n• Select an entry from the array  \n• Numbered from [0]  \n• … up length-1  \n>>> myl = [9,3,5,6,4,3,2]  \n>>> myl[1] 3 >>> myl[0] 9  \n>>> myl[3] + myl[5] 9  \n>>>  \nUpdate An Entry  \n• Change an entry  \n>>> myl  \n[9, 3, 6, 5, 4, 3, 2]>>> myl[3] = -1  \n>>> myl[4] = myl[4] - 2 >>> myl  \n[9, 3, 6, -1, 2, 3, 2]  \n• New form of assignment  \n• array[number] = ...  \nQuiz – Swap?  \n• What is the list after this:  \n>>> myl  \n[9, 3, 5, 6, 4, 3, 2]>>> myl[2] = myl[3]  \n>>> myl[3] = myl[2]>>> myl  \n??????  \nQuiz – Swap?  \n• What is the list after this:  \n>>> myl  \n[9, 3, 5, 6, 4, 3, 2]>>> myl[2] = myl[3]  \n>>> myl[3] = myl[2]>>> myl  \n[9, 3, 6, 6, 4, 3, 2]  \n>>>","cbCaipy43gZcrr2l","https://ap.wps.com/l/cbCaipy43gZcrr2l","pdf",163826,26,"English","# Array Behavior in Python\n## The Issue with Arrays in Python\n## Lists as an Alternative\n# Core Concepts\n## Big Idea: Combining Values\n## Array Behavior of Lists\n# Operations\n## Indexing Arrays\n## Updating Entries\n## Quiz: Swapping Elements","[{\"question\":\"Why are lists in Python often used instead of traditional arrays?\",\"answer\":\"Python lists are more flexible than traditional arrays, which typically have fixed sizes and limited operations. Lists allow for more dynamic data handling and provide 'array-like' behavior that is simpler to implement in Python.\"},{\"question\":\"How are elements accessed and updated in a Python list?\",\"answer\":\"Elements are accessed using their index, which starts at 0 and goes up to the length of the list minus one. You can update an entry by assigning a new value to a specific index, such as list_name[index] = new_value.\"},{\"question\":\"What is the result of attempting to swap two elements in a list using sequential assignments?\",\"answer\":\"If you simply assign one index to another (e.g., myl[2] = myl[3] then myl[3] = myl[2]), the original value at the first index is overwritten, resulting in two identical values at both positions instead of a successful swap.\"}]","Programming for GCSE Topic 6.1 - Lists, Arrays, and For Loops | PDF",66,[146,150,154],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/3aeb85dd9f4594e9e00897ad7fc4c52a.webp",983,737,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/d2e2e0c4510b7d6e18d0535e93bbe17a.webp",982,736,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/5935ae2e8f6b6aa233fa731acb0b9379.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":29,"category_name":30,"create_tm":165},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=1796111459&Signature=faNNxnhVRLaZl7B4%2B1%2BUpUsFlDI%3D","python-collections-arrays-list-and-function",1794016101,{"doc_id":167,"doc_title":168,"file_type":137,"home_preview_img_url":169,"slug":170,"view_count":34,"category_name":30,"create_tm":171},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=1796111459&Signature=Y0NYt%2F6GrdSjNldP0Tx%2BuFih%2Fhk%3D","python-arrays-learn-how-to-create-access-and-modify-lists",1794018478,{"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},697950,"unit06-1-Arrays - Arrays in Memory Lecture Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010141905/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111459&Signature=Dx%2FRbDbZj6%2Bt%2B0pPBBnCWVyUlys%3D","unit06-1-arrays-arrays-in-memory-lecture-notes",1794446318,{"doc_id":179,"doc_title":180,"file_type":137,"home_preview_img_url":181,"slug":182,"view_count":19,"category_name":30,"create_tm":183},697965,"Arrays Made Easy - An Introduction to Arrays and Array Processing - SUGI 30 Tutorials","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010146275/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111459&Signature=zoPy7CtJrvvsgdBKRINXPY%2F02uw%3D","arrays-made-easy-an-introduction-to-arrays-and-array-processing-sugi-30-tutorials",1794446535,{"doc_id":185,"doc_title":186,"file_type":137,"home_preview_img_url":187,"slug":188,"view_count":24,"category_name":30,"create_tm":189},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=1796111459&Signature=Kwb95k%2FOJuI%2FepsZI%2Bt8v8HJd%2BE%3D","cheat_sheet-python-final-medium-list-comprehension-indexing",1793572695,{"doc_id":191,"doc_title":192,"file_type":137,"home_preview_img_url":193,"slug":194,"view_count":81,"category_name":30,"create_tm":195},682652,"A Beginners Guide to Python 3 Programming","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998958669/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111459&Signature=zW7hPsyjklGucTpA6K%2FOsDoEhEg%3D","a-beginners-guide-to-python-3-programming",1793977325,{"doc_id":197,"doc_title":198,"file_type":137,"home_preview_img_url":199,"slug":200,"view_count":19,"category_name":30,"create_tm":201},685688,"Lecture 11 - Arrays and ArrayLists - Introduction","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000179281/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111459&Signature=rSkCyaUxYDYBn2Qgrb6lNCPY0qc%3D","lecture-11-arrays-and-arraylists-introduction",1794016761,{"doc_id":203,"doc_title":204,"file_type":137,"home_preview_img_url":205,"slug":206,"view_count":24,"category_name":30,"create_tm":207},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=1796111459&Signature=4uQpoaDJ4C8STD9y%2FFjhGOvMdcE%3D","numpy-array-chapter-11-informatics-practices",1794018711,{"doc_id":209,"doc_title":210,"file_type":137,"home_preview_img_url":211,"slug":212,"view_count":81,"category_name":30,"create_tm":213},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=1796111459&Signature=Hkv%2Fx%2B4fV79an5jiNOkQcT%2FAF%2Bc%3D","python-variable-types-variable-assignment-multiple-assignment-and-standard-data-types",1794446554,{"doc_id":215,"doc_title":216,"file_type":137,"home_preview_img_url":217,"slug":218,"view_count":81,"category_name":30,"create_tm":171},685787,"Arrays - Java Arrays vs Python Lists - Learn how to declare and use arrays in Java","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000208980/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111459&Signature=2VVpqPDCx%2BN4N3YUhmHEc7XSQio%3D","arrays-java-arrays-vs-python-lists-learn-how-to-declare-and-use-arrays-in-java"]