[{"data":1,"prerenderedAt":6626},["ShallowReactive",2],{"tutorials-python":3,"category-items-python":987,"content-/python/adding-to-lists":988},[4,22,31,40,49,58,67,76,86,95,104,113,122,131,141,150,159,168,177,186,196,205,214,223,233,242,251,260,269,279,288,297,306,315,324,333,342,351,360,369,379,388,397,406,415,424,433,442,452,461,470,479,488,497,506,515,525,534,543,552,561,570,579,588,597,606,616,625,634,643,652,661,670,680,689,698,707,716,725,734,744,753,762,771,780,789,798,807,817,826,835,844,853,863,872,881,890,900,909,918,927,936,945,953,961,970,979],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"slug":11,"order":12,"isParent":13,"icon":14,"_type":15,"_id":16,"_source":17,"_file":18,"_stem":19,"_extension":20,"children":21,"expanded":13},"/python/getting-started","python",false,"","Getting Started","Begin your Python programming journey. Learn what Python is, how to set it up, and write your first programs. Perfect for complete beginners starting their coding adventure.","getting-started",1,true,"pi pi-folder","markdown","content:python:1.getting-started.md","content","python/1.getting-started.md","python/1.getting-started","md",[22,31,40,49,58,67],{"_path":23,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":15,"_id":28,"_source":17,"_file":29,"_stem":30,"_extension":20},"/python/what-is-python","What is Python","Discover Python's fascinating history, design philosophy, and key features. Learn why Python has become one of the world's most popular programming languages and perfect for beginners.","what-is-python",2,"content:python:2.what-is-python.md","python/2.what-is-python.md","python/2.what-is-python",{"_path":32,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":15,"_id":37,"_source":17,"_file":38,"_stem":39,"_extension":20},"/python/setup-python","Setup Python","Learn how to install Python on your computer and set up your development environment. Step-by-step guide for Windows, macOS, and Linux with beginner-friendly instructions.","setup-python",3,"content:python:3.setup-python.md","python/3.setup-python.md","python/3.setup-python",{"_path":41,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":15,"_id":46,"_source":17,"_file":47,"_stem":48,"_extension":20},"/python/your-first-program","Your First Program","Write and run your first Python program! Learn the basics of Python programming with simple examples and step-by-step instructions for beginners.","your-first-program",4,"content:python:4.your-first-program.md","python/4.your-first-program.md","python/4.your-first-program",{"_path":50,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":15,"_id":55,"_source":17,"_file":56,"_stem":57,"_extension":20},"/python/python-code-structure","Python Code Structure","Learn how Python code is organized and structured. Understand indentation, line breaks, and the basic rules that make Python programs work correctly.","python-code-structure",5,"content:python:5.python-code-structure.md","python/5.python-code-structure.md","python/5.python-code-structure",{"_path":59,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":15,"_id":64,"_source":17,"_file":65,"_stem":66,"_extension":20},"/python/writing-comments","Writing Comments","Learn how to write effective comments in Python. Discover when and how to document your code to make it clear, maintainable, and easy to understand.","writing-comments",6,"content:python:6.writing-comments.md","python/6.writing-comments.md","python/6.writing-comments",{"_path":68,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":69,"description":70,"slug":71,"parentId":5,"order":72,"_type":15,"_id":73,"_source":17,"_file":74,"_stem":75,"_extension":20},"/python/working-with-variables","Working with Variables","Learn how to create, use, and manage variables in Python. Understand how to store data, change values, and follow naming conventions for clean, readable code.","working-with-variables",7,"content:python:7.working-with-variables.md","python/7.working-with-variables.md","python/7.working-with-variables",{"_path":77,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":78,"description":79,"slug":80,"order":81,"isParent":13,"icon":14,"_type":15,"_id":82,"_source":17,"_file":83,"_stem":84,"_extension":20,"children":85,"expanded":13},"/python/basic-data-types","Basic Data Types","Learn about Python's fundamental data types including numbers, text, and boolean values","basic-data-types",8,"content:python:8.basic-data-types.md","python/8.basic-data-types.md","python/8.basic-data-types",[86,95,104,113,122],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":91,"_type":15,"_id":92,"_source":17,"_file":93,"_stem":94,"_extension":20},"/python/understanding-data-types","Understanding Data Types","Learn how Python identifies different data types and why they're important for programming","understanding-data-types",9,"content:python:9.understanding-data-types.md","python/9.understanding-data-types.md","python/9.understanding-data-types",{"_path":96,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":97,"description":98,"slug":99,"parentId":77,"order":100,"_type":15,"_id":101,"_source":17,"_file":102,"_stem":103,"_extension":20},"/python/working-with-numbers","Working with Numbers","Learn about Python's numeric data types including integers and floats, and how to perform calculations","working-with-numbers",10,"content:python:10.working-with-numbers.md","python/10.working-with-numbers.md","python/10.working-with-numbers",{"_path":105,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":106,"description":107,"slug":108,"parentId":77,"order":109,"_type":15,"_id":110,"_source":17,"_file":111,"_stem":112,"_extension":20},"/python/text-and-strings","Text and Strings","Learn how to work with text data in Python using strings, including creation, manipulation, and formatting","text-and-strings",11,"content:python:11.text-and-strings.md","python/11.text-and-strings.md","python/11.text-and-strings",{"_path":114,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":115,"description":116,"slug":117,"parentId":77,"order":118,"_type":15,"_id":119,"_source":17,"_file":120,"_stem":121,"_extension":20},"/python/true-false-values","True/False Values","Learn about boolean values in Python, including True/False logic, comparison operations, and how to use booleans for decision-making in your programs","true-false-values",12,"content:python:12.true-false-values.md","python/12.true-false-values.md","python/12.true-false-values",{"_path":123,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":124,"description":125,"slug":126,"parentId":77,"order":127,"_type":15,"_id":128,"_source":17,"_file":129,"_stem":130,"_extension":20},"/python/converting-types","Converting Types","Learn how to convert between different Python data types including strings, numbers, and booleans","converting-types",13,"content:python:13.converting-types.md","python/13.converting-types.md","python/13.converting-types",{"_path":132,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":133,"description":134,"slug":135,"order":136,"isParent":13,"icon":14,"_type":15,"_id":137,"_source":17,"_file":138,"_stem":139,"_extension":20,"children":140,"expanded":13},"/python/python-operators","Python Operators","Learn about Python operators - the symbols and keywords that perform operations on data. Discover arithmetic, comparison, logical, and assignment operators with simple examples.","python-operators",14,"content:python:14.python-operators.md","python/14.python-operators.md","python/14.python-operators",[141,150,159,168,177],{"_path":142,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":143,"description":144,"slug":145,"parentId":132,"order":146,"_type":15,"_id":147,"_source":17,"_file":148,"_stem":149,"_extension":20},"/python/math-operations","Math Operations","Learn Python's arithmetic operators for mathematical calculations. Master addition, subtraction, multiplication, division, and more with practical examples.","math-operations",15,"content:python:15.math-operations.md","python/15.math-operations.md","python/15.math-operations",{"_path":151,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":152,"description":153,"slug":154,"parentId":132,"order":155,"_type":15,"_id":156,"_source":17,"_file":157,"_stem":158,"_extension":20},"/python/comparing-values","Comparing Values","Learn Python's comparison operators to compare values and make decisions. Master equality, inequality, and relational operators with practical examples.","comparing-values",16,"content:python:16.comparing-values.md","python/16.comparing-values.md","python/16.comparing-values",{"_path":160,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":161,"description":162,"slug":163,"parentId":132,"order":164,"_type":15,"_id":165,"_source":17,"_file":166,"_stem":167,"_extension":20},"/python/logic-operations","Logic Operations","Learn about Python's logical operators for combining conditions and creating complex boolean expressions","logic-operations",17,"content:python:17.logic-operations.md","python/17.logic-operations.md","python/17.logic-operations",{"_path":169,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":170,"description":171,"slug":172,"parentId":132,"order":173,"_type":15,"_id":174,"_source":17,"_file":175,"_stem":176,"_extension":20},"/python/value-assignment","Value Assignment","Learn about Python's assignment operators for efficiently updating variables and performing calculations","value-assignment",18,"content:python:18.value-assignment.md","python/18.value-assignment.md","python/18.value-assignment",{"_path":178,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":179,"description":180,"slug":181,"parentId":132,"order":182,"_type":15,"_id":183,"_source":17,"_file":184,"_stem":185,"_extension":20},"/python/operator-precedence","Operator Precedence","Learn how Python evaluates expressions with multiple operators and how to control evaluation order","operator-precedence",19,"content:python:19.operator-precedence.md","python/19.operator-precedence.md","python/19.operator-precedence",{"_path":187,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":188,"description":189,"slug":190,"order":191,"isParent":13,"icon":14,"_type":15,"_id":192,"_source":17,"_file":193,"_stem":194,"_extension":20,"children":195,"expanded":13},"/python/decision-making","Decision Making","Learn how to make decisions in your Python programs using conditional statements and control flow","decision-making",20,"content:python:20.decision-making.md","python/20.decision-making.md","python/20.decision-making",[196,205,214],{"_path":197,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":198,"description":199,"slug":200,"parentId":187,"order":201,"_type":15,"_id":202,"_source":17,"_file":203,"_stem":204,"_extension":20},"/python/if-statements","If Statements","Learn how to use if statements to make decisions and control program flow in Python","if-statements",21,"content:python:21.if-statements.md","python/21.if-statements.md","python/21.if-statements",{"_path":206,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":207,"description":208,"slug":209,"parentId":187,"order":210,"_type":15,"_id":211,"_source":17,"_file":212,"_stem":213,"_extension":20},"/python/multiple-conditions","Multiple Conditions","Learn how to handle multiple conditions using elif statements and complex conditional logic in Python","multiple-conditions",22,"content:python:22.multiple-conditions.md","python/22.multiple-conditions.md","python/22.multiple-conditions",{"_path":215,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":216,"description":217,"slug":218,"parentId":187,"order":219,"_type":15,"_id":220,"_source":17,"_file":221,"_stem":222,"_extension":20},"/python/pattern-matching","Pattern Matching","Learn how to use Python's match-case statements for powerful pattern matching and complex decision making","pattern-matching",23,"content:python:23.pattern-matching.md","python/23.pattern-matching.md","python/23.pattern-matching",{"_path":224,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":225,"description":226,"slug":227,"order":228,"isParent":13,"icon":14,"_type":15,"_id":229,"_source":17,"_file":230,"_stem":231,"_extension":20,"children":232,"expanded":13},"/python/repetition-and-loops","Python Loops","Learn how to use loops to repeat code efficiently and handle repetitive tasks in Python","repetition-and-loops",24,"content:python:24.repetition-and-loops.md","python/24.repetition-and-loops.md","python/24.repetition-and-loops",[233,242,251,260],{"_path":234,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":235,"description":236,"slug":237,"parentId":224,"order":238,"_type":15,"_id":239,"_source":17,"_file":240,"_stem":241,"_extension":20},"/python/while-loops","While Loops","Learn how to use while loops for condition-based repetition and create loops that run until specific conditions are met","while-loops",25,"content:python:25.while-loops.md","python/25.while-loops.md","python/25.while-loops",{"_path":243,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":244,"description":245,"slug":246,"parentId":224,"order":247,"_type":15,"_id":248,"_source":17,"_file":249,"_stem":250,"_extension":20},"/python/for-loops","For Loops","Learn how to use for loops to iterate through sequences, collections, and ranges efficiently in Python","for-loops",26,"content:python:26.for-loops.md","python/26.for-loops.md","python/26.for-loops",{"_path":252,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":253,"description":254,"slug":255,"parentId":224,"order":256,"_type":15,"_id":257,"_source":17,"_file":258,"_stem":259,"_extension":20},"/python/loop-control","Loop Control","Master advanced loop control techniques including break, continue, and else clauses for sophisticated iteration patterns","loop-control",27,"content:python:27.loop-control.md","python/27.loop-control.md","python/27.loop-control",{"_path":261,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":262,"description":263,"slug":264,"parentId":224,"order":265,"_type":15,"_id":266,"_source":17,"_file":267,"_stem":268,"_extension":20},"/python/nested-loops","Nested Loops","Learn how to use nested loops to process multi-dimensional data, create patterns, and handle complex iteration scenarios","nested-loops",28,"content:python:28.nested-loops.md","python/28.nested-loops.md","python/28.nested-loops",{"_path":270,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":271,"description":272,"slug":273,"order":274,"isParent":13,"icon":14,"_type":15,"_id":275,"_source":17,"_file":276,"_stem":277,"_extension":20,"children":278,"expanded":13},"/python/python-lists","Python Lists","Learn about Python lists, one of the most important and versatile data structures for storing and organizing collections of data","python-lists",29,"content:python:29.python-lists.md","python/29.python-lists.md","python/29.python-lists",[279,288,297,306,315,324,333,342,351,360],{"_path":280,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":281,"description":282,"slug":283,"parentId":270,"order":284,"_type":15,"_id":285,"_source":17,"_file":286,"_stem":287,"_extension":20},"/python/creating-lists","Creating Lists","Learn different methods to create and initialize Python lists, from simple literals to advanced techniques","creating-lists",30,"content:python:30.creating-lists.md","python/30.creating-lists.md","python/30.creating-lists",{"_path":289,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":290,"description":291,"slug":292,"parentId":270,"order":293,"_type":15,"_id":294,"_source":17,"_file":295,"_stem":296,"_extension":20},"/python/reading-list-data","Reading List Data","Master techniques for accessing and retrieving data from Python lists using indexing, slicing, and built-in methods","reading-list-data",31,"content:python:31.reading-list-data.md","python/31.reading-list-data.md","python/31.reading-list-data",{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":270,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python/modifying-lists","Modifying Lists","Learn how to change, update, and modify existing elements in Python lists using indexing and various methods","modifying-lists",32,"content:python:32.modifying-lists.md","python/32.modifying-lists.md","python/32.modifying-lists",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":270,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python/adding-to-lists","Adding to Lists","Learn various methods to add elements to Python lists including append, insert, extend, and concatenation techniques","adding-to-lists",33,"content:python:33.adding-to-lists.md","python/33.adding-to-lists.md","python/33.adding-to-lists",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":270,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python/removing-from-lists","Removing from Lists","Learn different methods to remove and delete elements from Python lists including remove, pop, del, and clear","removing-from-lists",34,"content:python:34.removing-from-lists.md","python/34.removing-from-lists.md","python/34.removing-from-lists",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":270,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python/looping-through-lists","Looping Through Lists","Learn different ways to iterate through Python lists using for loops, while loops, enumerate, and other iteration techniques","looping-through-lists",35,"content:python:35.looping-through-lists.md","python/35.looping-through-lists.md","python/35.looping-through-lists",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":270,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python/list-shortcuts","List Shortcuts","Learn powerful Python list shortcuts including list comprehensions, slicing tricks, and built-in functions for efficient list operations","list-shortcuts",36,"content:python:36.list-shortcuts.md","python/36.list-shortcuts.md","python/36.list-shortcuts",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":270,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python/organizing-lists","Organizing Lists","Learn how to sort, reverse, and organize Python lists using built-in methods and custom sorting techniques","organizing-lists",37,"content:python:37.organizing-lists.md","python/37.organizing-lists.md","python/37.organizing-lists",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":270,"order":356,"_type":15,"_id":357,"_source":17,"_file":358,"_stem":359,"_extension":20},"/python/combining-lists","Combining Lists","Learn various techniques to combine, merge, and join Python lists including concatenation, zipping, and advanced merging strategies","combining-lists",38,"content:python:38.combining-lists.md","python/38.combining-lists.md","python/38.combining-lists",{"_path":361,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":362,"description":363,"slug":364,"parentId":270,"order":365,"_type":15,"_id":366,"_source":17,"_file":367,"_stem":368,"_extension":20},"/python/essential-list-tools","Essential List Tools","Master powerful built-in functions and advanced techniques for efficient Python list manipulation and data processing","essential-list-tools",39,"content:python:39.essential-list-tools.md","python/39.essential-list-tools.md","python/39.essential-list-tools",{"_path":370,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":371,"description":372,"slug":373,"order":374,"isParent":13,"icon":14,"_type":15,"_id":375,"_source":17,"_file":376,"_stem":377,"_extension":20,"children":378},"/python/python-tuples","Python Tuples","Master Python tuples - immutable sequences perfect for storing related data that shouldn't change. Learn creation, access, and manipulation techniques.","python-tuples",40,"content:python:40.python-tuples.md","python/40.python-tuples.md","python/40.python-tuples",[379,388,397,406,415,424,433],{"_path":380,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":381,"description":382,"slug":383,"parentId":370,"order":384,"_type":15,"_id":385,"_source":17,"_file":386,"_stem":387,"_extension":20},"/python/creating-tuples","Creating Tuples","Learn different ways to create Python tuples, from basic syntax to advanced techniques. Master tuple initialization and understand when to use tuples.","creating-tuples",41,"content:python:41.creating-tuples.md","python/41.creating-tuples.md","python/41.creating-tuples",{"_path":389,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":390,"description":391,"slug":392,"parentId":370,"order":393,"_type":15,"_id":394,"_source":17,"_file":395,"_stem":396,"_extension":20},"/python/reading-tuple-data","Reading Tuple Data","Master accessing tuple elements through indexing, slicing, and searching. Learn efficient patterns for reading and working with tuple data.","reading-tuple-data",42,"content:python:42.reading-tuple-data.md","python/42.reading-tuple-data.md","python/42.reading-tuple-data",{"_path":398,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":399,"description":400,"slug":401,"parentId":370,"order":402,"_type":15,"_id":403,"_source":17,"_file":404,"_stem":405,"_extension":20},"/python/changing-tuples","Changing Tuples","Understand tuple immutability and learn techniques for working with unchangeable data. Master creating modified tuple versions and handling immutable constraints.","changing-tuples",43,"content:python:43.changing-tuples.md","python/43.changing-tuples.md","python/43.changing-tuples",{"_path":407,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":408,"description":409,"slug":410,"parentId":370,"order":411,"_type":15,"_id":412,"_source":17,"_file":413,"_stem":414,"_extension":20},"/python/tuple-unpacking","Tuple Unpacking","Master tuple unpacking for elegant variable assignment, function returns, and data extraction. Learn Python's powerful unpacking syntax and patterns.","tuple-unpacking",44,"content:python:44.tuple-unpacking.md","python/44.tuple-unpacking.md","python/44.tuple-unpacking",{"_path":416,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":417,"description":418,"slug":419,"parentId":370,"order":420,"_type":15,"_id":421,"_source":17,"_file":422,"_stem":423,"_extension":20},"/python/iterating-tuples","Iterating Tuples","Master tuple iteration techniques for processing sequence data. Learn basic loops, enumerate, nested iteration, and advanced patterns for efficient data processing.","iterating-tuples",45,"content:python:45.iterating-tuples.md","python/45.iterating-tuples.md","python/45.iterating-tuples",{"_path":425,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":426,"description":427,"slug":428,"parentId":370,"order":429,"_type":15,"_id":430,"_source":17,"_file":431,"_stem":432,"_extension":20},"/python/merging-tuples","Merging Tuples","Learn techniques for combining and merging tuples to create larger data structures. Master concatenation, joining multiple tuples, and advanced merging patterns.","merging-tuples",46,"content:python:46.merging-tuples.md","python/46.merging-tuples.md","python/46.merging-tuples",{"_path":434,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":435,"description":436,"slug":437,"parentId":370,"order":438,"_type":15,"_id":439,"_source":17,"_file":440,"_stem":441,"_extension":20},"/python/tuple-operations","Tuple Operations","Master comprehensive tuple operations including built-in functions, mathematical operations, comparisons, and advanced techniques for efficient tuple manipulation.","tuple-operations",47,"content:python:47.tuple-operations.md","python/47.tuple-operations.md","python/47.tuple-operations",{"_path":443,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":444,"description":445,"slug":446,"order":447,"isParent":13,"icon":14,"_type":15,"_id":448,"_source":17,"_file":449,"_stem":450,"_extension":20,"children":451},"/python/python-sets","Python Sets","Discover Python sets - unique collections that automatically eliminate duplicates and provide powerful mathematical operations for data filtering and analysis.","python-sets",48,"content:python:48.python-sets.md","python/48.python-sets.md","python/48.python-sets",[452,461,470,479,488,497,506],{"_path":453,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":454,"description":455,"slug":456,"parentId":443,"order":457,"_type":15,"_id":458,"_source":17,"_file":459,"_stem":460,"_extension":20},"/python/creating-sets","Creating Sets","Learn multiple ways to create sets in Python including literal syntax, set() function, and set comprehensions. Master set creation from different data sources.","creating-sets",49,"content:python:49.creating-sets.md","python/49.creating-sets.md","python/49.creating-sets",{"_path":462,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":463,"description":464,"slug":465,"parentId":443,"order":466,"_type":15,"_id":467,"_source":17,"_file":468,"_stem":469,"_extension":20},"/python/reading-set-data","Reading Set Data","Learn how to access and examine set data in Python including membership testing, iteration, size checking, and converting sets to other data types.","reading-set-data",50,"content:python:50.reading-set-data.md","python/50.reading-set-data.md","python/50.reading-set-data",{"_path":471,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":472,"description":473,"slug":474,"parentId":443,"order":475,"_type":15,"_id":476,"_source":17,"_file":477,"_stem":478,"_extension":20},"/python/adding-to-sets","Adding to Sets","Learn how to add elements to sets in Python using add(), update(), and union operations. Master growing sets dynamically with single items and multiple elements.","adding-to-sets",51,"content:python:51.adding-to-sets.md","python/51.adding-to-sets.md","python/51.adding-to-sets",{"_path":480,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":481,"description":482,"slug":483,"parentId":443,"order":484,"_type":15,"_id":485,"_source":17,"_file":486,"_stem":487,"_extension":20},"/python/removing-from-sets","Removing from Sets","Learn how to remove elements from Python sets using different methods like remove(), discard(), pop(), and clear()","removing-from-sets",52,"content:python:52.removing-from-sets.md","python/52.removing-from-sets.md","python/52.removing-from-sets",{"_path":489,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":490,"description":491,"slug":492,"parentId":443,"order":493,"_type":15,"_id":494,"_source":17,"_file":495,"_stem":496,"_extension":20},"/python/iterating-sets","Iterating Sets","Learn different ways to iterate through Python sets using for loops, comprehensions, and built-in functions","iterating-sets",53,"content:python:53.iterating-sets.md","python/53.iterating-sets.md","python/53.iterating-sets",{"_path":498,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":499,"description":500,"slug":501,"parentId":443,"order":502,"_type":15,"_id":503,"_source":17,"_file":504,"_stem":505,"_extension":20},"/python/combining-sets","Combining Sets","Learn how to combine Python sets using union, intersection, difference, and other set operations","combining-sets",54,"content:python:54.combining-sets.md","python/54.combining-sets.md","python/54.combining-sets",{"_path":507,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":508,"description":509,"slug":510,"parentId":443,"order":511,"_type":15,"_id":512,"_source":17,"_file":513,"_stem":514,"_extension":20},"/python/set-operations","Set Operations","Learn advanced Python set operations including comparisons, subsets, supersets, and mathematical set relationships","set-operations",55,"content:python:55.set-operations.md","python/55.set-operations.md","python/55.set-operations",{"_path":516,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":517,"description":518,"slug":519,"order":520,"isParent":13,"icon":14,"_type":15,"_id":521,"_source":17,"_file":522,"_stem":523,"_extension":20,"children":524},"/python/python-dictionaries","Python Dictionaries","Learn about Python dictionaries - key-value data structures for storing and organizing related information","python-dictionaries",56,"content:python:56.python-dictionaries.md","python/56.python-dictionaries.md","python/56.python-dictionaries",[525,534,543,552,561,570,579,588,597],{"_path":526,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":527,"description":528,"slug":529,"parentId":516,"order":530,"_type":15,"_id":531,"_source":17,"_file":532,"_stem":533,"_extension":20},"/python/creating-dictionaries","Creating Dictionaries","Learn different methods to create Python dictionaries using literals, constructors, and comprehensions","creating-dictionaries",57,"content:python:57.creating-dictionaries.md","python/57.creating-dictionaries.md","python/57.creating-dictionaries",{"_path":535,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":536,"description":537,"slug":538,"parentId":516,"order":539,"_type":15,"_id":540,"_source":17,"_file":541,"_stem":542,"_extension":20},"/python/getting-dictionary-values","Getting Dictionary Values","Learn safe and efficient methods to retrieve data from Python dictionaries using various access techniques","getting-dictionary-values",58,"content:python:58.getting-dictionary-values.md","python/58.getting-dictionary-values.md","python/58.getting-dictionary-values",{"_path":544,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":545,"description":546,"slug":547,"parentId":516,"order":548,"_type":15,"_id":549,"_source":17,"_file":550,"_stem":551,"_extension":20},"/python/updating-dictionaries","Updating Dictionaries","Learn how to modify and maintain Python dictionary data using various update methods and techniques","updating-dictionaries",59,"content:python:59.updating-dictionaries.md","python/59.updating-dictionaries.md","python/59.updating-dictionaries",{"_path":553,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":554,"description":555,"slug":556,"parentId":516,"order":557,"_type":15,"_id":558,"_source":17,"_file":559,"_stem":560,"_extension":20},"/python/adding-dictionary-items","Adding Dictionary Items","Learn effective techniques for adding new items to Python dictionaries with various methods and best practices","adding-dictionary-items",60,"content:python:60.adding-dictionary-items.md","python/60.adding-dictionary-items.md","python/60.adding-dictionary-items",{"_path":562,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":563,"description":564,"slug":565,"parentId":516,"order":566,"_type":15,"_id":567,"_source":17,"_file":568,"_stem":569,"_extension":20},"/python/deleting-dictionary-items","Deleting Dictionary Items","Master safe and efficient techniques for removing items from Python dictionaries with various methods and error handling","deleting-dictionary-items",61,"content:python:61.deleting-dictionary-items.md","python/61.deleting-dictionary-items.md","python/61.deleting-dictionary-items",{"_path":571,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":572,"description":573,"slug":574,"parentId":516,"order":575,"_type":15,"_id":576,"_source":17,"_file":577,"_stem":578,"_extension":20},"/python/looping-dictionaries","Looping Dictionaries","Learn efficient techniques for iterating through Python dictionaries using keys, values, and items","looping-dictionaries",62,"content:python:62.looping-dictionaries.md","python/62.looping-dictionaries.md","python/62.looping-dictionaries",{"_path":580,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":581,"description":582,"slug":583,"parentId":516,"order":584,"_type":15,"_id":585,"_source":17,"_file":586,"_stem":587,"_extension":20},"/python/dictionary-copies","Dictionary Copies","Learn safe techniques for duplicating Python dictionaries using shallow and deep copy methods","dictionary-copies",63,"content:python:63.dictionary-copies.md","python/63.dictionary-copies.md","python/63.dictionary-copies",{"_path":589,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":590,"description":591,"slug":592,"parentId":516,"order":593,"_type":15,"_id":594,"_source":17,"_file":595,"_stem":596,"_extension":20},"/python/multi-level-dictionaries","Multi-level Dictionaries","Master working with nested Python dictionaries for complex data structures and hierarchical information","multi-level-dictionaries",64,"content:python:64.multi-level-dictionaries.md","python/64.multi-level-dictionaries.md","python/64.multi-level-dictionaries",{"_path":598,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":599,"description":600,"slug":601,"parentId":516,"order":602,"_type":15,"_id":603,"_source":17,"_file":604,"_stem":605,"_extension":20},"/python/dictionary-tools","Dictionary Tools","Explore powerful built-in functions and advanced techniques for efficient Python dictionary manipulation and analysis","dictionary-tools",65,"content:python:65.dictionary-tools.md","python/65.dictionary-tools.md","python/65.dictionary-tools",{"_path":607,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":608,"description":609,"slug":610,"order":611,"isParent":13,"icon":14,"_type":15,"_id":612,"_source":17,"_file":613,"_stem":614,"_extension":20,"children":615},"/python/python-functions","Python Functions","Learn how to create and use Python functions to organize code into reusable, modular components that make programs more efficient and maintainable","python-functions",66,"content:python:66.python-functions.md","python/66.python-functions.md","python/66.python-functions",[616,625,634,643,652,661],{"_path":617,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":618,"description":619,"slug":620,"parentId":607,"order":621,"_type":15,"_id":622,"_source":17,"_file":623,"_stem":624,"_extension":20},"/python/function-basics","Function Basics","Learn the fundamentals of creating and using Python functions to organize code into reusable, modular components","function-basics",67,"content:python:67.function-basics.md","python/67.function-basics.md","python/67.function-basics",{"_path":626,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":627,"description":628,"slug":629,"parentId":607,"order":630,"_type":15,"_id":631,"_source":17,"_file":632,"_stem":633,"_extension":20},"/python/function-parameters","Function Parameters","Master different types of Python function parameters including positional, keyword, default, and variable-length arguments","function-parameters",68,"content:python:68.function-parameters.md","python/68.function-parameters.md","python/68.function-parameters",{"_path":635,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":636,"description":637,"slug":638,"parentId":607,"order":639,"_type":15,"_id":640,"_source":17,"_file":641,"_stem":642,"_extension":20},"/python/returning-values","Returning Values","Learn different ways Python functions return data including single values, multiple values, and conditional returns","returning-values",69,"content:python:69.returning-values.md","python/69.returning-values.md","python/69.returning-values",{"_path":644,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":645,"description":646,"slug":647,"parentId":607,"order":648,"_type":15,"_id":649,"_source":17,"_file":650,"_stem":651,"_extension":20},"/python/variable-scope","Variable Scope","Understand Python variable scope including local, global, and nonlocal variables and how they affect function behavior","variable-scope",70,"content:python:70.variable-scope.md","python/70.variable-scope.md","python/70.variable-scope",{"_path":653,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":654,"description":655,"slug":656,"parentId":607,"order":657,"_type":15,"_id":658,"_source":17,"_file":659,"_stem":660,"_extension":20},"/python/anonymous-functions","Anonymous Functions","Learn to create and use Python lambda functions for concise, inline function definitions and functional programming patterns","anonymous-functions",71,"content:python:71.anonymous-functions.md","python/71.anonymous-functions.md","python/71.anonymous-functions",{"_path":662,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":663,"description":664,"slug":665,"parentId":607,"order":666,"_type":15,"_id":667,"_source":17,"_file":668,"_stem":669,"_extension":20},"/python/function-recursion","Function Recursion","Master recursive functions in Python by learning how functions can call themselves to solve complex problems with elegant, mathematical solutions","function-recursion",72,"content:python:72.function-recursion.md","python/72.function-recursion.md","python/72.function-recursion",{"_path":671,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":672,"description":673,"slug":674,"order":675,"isParent":13,"icon":14,"_type":15,"_id":676,"_source":17,"_file":677,"_stem":678,"_extension":20,"children":679},"/python/object-programming","Object Programming","Learn object-oriented programming (OOP) in Python - create classes, objects, and methods to build organized, reusable code","object-programming",73,"content:python:73.object-programming.md","python/73.object-programming.md","python/73.object-programming",[680,689,698,707,716,725],{"_path":681,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":682,"description":683,"slug":684,"parentId":671,"order":685,"_type":15,"_id":686,"_source":17,"_file":687,"_stem":688,"_extension":20},"/python/classes-and-objects","Classes and Objects","Learn to create Python classes and objects - the foundation of object-oriented programming for building reusable, organized code","classes-and-objects",74,"content:python:74.classes-and-objects.md","python/74.classes-and-objects.md","python/74.classes-and-objects",{"_path":690,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":691,"description":692,"slug":693,"parentId":671,"order":694,"_type":15,"_id":695,"_source":17,"_file":696,"_stem":697,"_extension":20},"/python/object-methods","Object Methods","Master object methods in Python - learn to define behaviors, work with parameters, and create interactive objects that respond to actions","object-methods",75,"content:python:75.object-methods.md","python/75.object-methods.md","python/75.object-methods",{"_path":699,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":700,"description":701,"slug":702,"parentId":671,"order":703,"_type":15,"_id":704,"_source":17,"_file":705,"_stem":706,"_extension":20},"/python/class-inheritance","Class Inheritance","Learn Python class inheritance - create specialized classes that build upon existing functionality while adding new features and behaviors","class-inheritance",76,"content:python:76.class-inheritance.md","python/76.class-inheritance.md","python/76.class-inheritance",{"_path":708,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":709,"description":710,"slug":711,"parentId":671,"order":712,"_type":15,"_id":713,"_source":17,"_file":714,"_stem":715,"_extension":20},"/python/method-overriding","Method Overriding","Master method overriding in Python - learn to customize inherited methods, use super(), and create specialized behaviors while maintaining inheritance benefits","method-overriding",77,"content:python:77.method-overriding.md","python/77.method-overriding.md","python/77.method-overriding",{"_path":717,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":718,"description":719,"slug":720,"parentId":671,"order":721,"_type":15,"_id":722,"_source":17,"_file":723,"_stem":724,"_extension":20},"/python/variable-visibility","Variable Visibility","Master Python variable visibility - learn public, protected, and private attributes to control access and create well-encapsulated classes","variable-visibility",78,"content:python:78.variable-visibility.md","python/78.variable-visibility.md","python/78.variable-visibility",{"_path":726,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":727,"description":728,"slug":729,"parentId":671,"order":730,"_type":15,"_id":731,"_source":17,"_file":732,"_stem":733,"_extension":20},"/python/special-methods","Special Methods","Master Python special methods (magic methods) - learn to implement __str__, __len__, __eq__ and more to make your classes work seamlessly with Python's built-in functions","special-methods",79,"content:python:79.special-methods.md","python/79.special-methods.md","python/79.special-methods",{"_path":735,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":736,"description":737,"slug":738,"order":739,"isParent":13,"icon":14,"_type":15,"_id":740,"_source":17,"_file":741,"_stem":742,"_extension":20,"children":743},"/python/advanced-concepts","Advanced Concepts","Master advanced Python programming concepts - work with dates, mathematics, JSON data, pattern matching, and more sophisticated programming techniques","advanced-concepts",80,"content:python:80.advanced-concepts.md","python/80.advanced-concepts.md","python/80.advanced-concepts",[744,753,762,771,780,789,798],{"_path":745,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":746,"description":747,"slug":748,"parentId":735,"order":749,"_type":15,"_id":750,"_source":17,"_file":751,"_stem":752,"_extension":20},"/python/working-with-dates","Working with Dates","Master Python date and time handling - work with datetime objects, format dates, calculate durations, and build time-aware applications","working-with-dates",81,"content:python:81.working-with-dates.md","python/81.working-with-dates.md","python/81.working-with-dates",{"_path":754,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":755,"description":756,"slug":757,"parentId":735,"order":758,"_type":15,"_id":759,"_source":17,"_file":760,"_stem":761,"_extension":20},"/python/mathematical-operations","Mathematical Operations","Master Python mathematical computing - use math functions, perform statistical calculations, and implement scientific computing for data analysis and problem-solving","mathematical-operations",82,"content:python:82.mathematical-operations.md","python/82.mathematical-operations.md","python/82.mathematical-operations",{"_path":763,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":764,"description":765,"slug":766,"parentId":735,"order":767,"_type":15,"_id":768,"_source":17,"_file":769,"_stem":770,"_extension":20},"/python/json-data","JSON Data","Master JSON data handling in Python - serialize and deserialize data, work with APIs, manage configuration files, and exchange data between applications","json-data",83,"content:python:83.json-data.md","python/83.json-data.md","python/83.json-data",{"_path":772,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":773,"description":774,"slug":775,"parentId":735,"order":776,"_type":15,"_id":777,"_source":17,"_file":778,"_stem":779,"_extension":20},"/python/package-management","Package Management","Master Python package management with pip and virtual environments - install libraries, manage dependencies, create isolated environments, and distribute packages professionally","package-management",85,"content:python:85.package-management.md","python/85.package-management.md","python/85.package-management",{"_path":781,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":782,"description":783,"slug":784,"parentId":735,"order":785,"_type":15,"_id":786,"_source":17,"_file":787,"_stem":788,"_extension":20},"/python/error-handling","Error Handling","Master Python error handling with try/except blocks, exception types, custom exceptions, debugging techniques, and best practices for robust application development","error-handling",86,"content:python:86.error-handling.md","python/86.error-handling.md","python/86.error-handling",{"_path":790,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":791,"description":792,"slug":793,"parentId":735,"order":794,"_type":15,"_id":795,"_source":17,"_file":796,"_stem":797,"_extension":20},"/python/getting-user-input","Getting User Input","Master user input handling in Python with input validation, data type conversion, interactive programs, and command-line interfaces for engaging user experiences","getting-user-input",87,"content:python:87.getting-user-input.md","python/87.getting-user-input.md","python/87.getting-user-input",{"_path":799,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":800,"description":801,"slug":802,"parentId":735,"order":803,"_type":15,"_id":804,"_source":17,"_file":805,"_stem":806,"_extension":20},"/python/text-formatting","Text Formatting","Master Python text formatting with f-strings, format methods, alignment, number formatting, and advanced techniques for professional, readable output","text-formatting",88,"content:python:88.text-formatting.md","python/88.text-formatting.md","python/88.text-formatting",{"_path":808,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":809,"description":810,"slug":811,"order":812,"isParent":13,"icon":14,"_type":15,"_id":813,"_source":17,"_file":814,"_stem":815,"_extension":20,"children":816},"/python/file-operations","File Operations","Master Python file handling with reading, writing, and managing files for data persistence and real-world applications","file-operations",89,"content:python:89.file-operations.md","python/89.file-operations.md","python/89.file-operations",[817,826,835,844],{"_path":818,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":819,"description":820,"slug":821,"parentId":808,"order":822,"_type":15,"_id":823,"_source":17,"_file":824,"_stem":825,"_extension":20},"/python/file-basics","File Basics","Learn fundamental Python file operations including opening files, understanding file modes, using context managers, and basic file handling concepts","file-basics",90,"content:python:90.file-basics.md","python/90.file-basics.md","python/90.file-basics",{"_path":827,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":828,"description":829,"slug":830,"parentId":808,"order":831,"_type":15,"_id":832,"_source":17,"_file":833,"_stem":834,"_extension":20},"/python/reading-files","Reading Files","Master Python file reading techniques including reading entire files, line-by-line processing, and handling different file formats for efficient data processing","reading-files",91,"content:python:91.reading-files.md","python/91.reading-files.md","python/91.reading-files",{"_path":836,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":837,"description":838,"slug":839,"parentId":808,"order":840,"_type":15,"_id":841,"_source":17,"_file":842,"_stem":843,"_extension":20},"/python/writing-files","Writing Files","Learn Python file writing techniques including creating new files, appending content, updating existing files, and saving different data formats safely","writing-files",92,"content:python:92.writing-files.md","python/92.writing-files.md","python/92.writing-files",{"_path":845,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":846,"description":847,"slug":848,"parentId":808,"order":849,"_type":15,"_id":850,"_source":17,"_file":851,"_stem":852,"_extension":20},"/python/file-management","File Management","Learn Python file management techniques including checking file properties, organizing files, directory operations, and implementing file system maintenance tasks","file-management",93,"content:python:93.file-management.md","python/93.file-management.md","python/93.file-management",{"_path":854,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":855,"description":856,"slug":857,"order":858,"isParent":13,"icon":14,"_type":15,"_id":859,"_source":17,"_file":860,"_stem":861,"_extension":20,"children":862},"/python/code-organization","Code Organization","Master Python code organization with modules, built-in libraries, and path management for creating maintainable and reusable applications","code-organization",94,"content:python:94.code-organization.md","python/94.code-organization.md","python/94.code-organization",[863,872,881],{"_path":864,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":865,"description":866,"slug":867,"parentId":854,"order":868,"_type":15,"_id":869,"_source":17,"_file":870,"_stem":871,"_extension":20},"/python/creating-modules","Creating Modules","Learn how to create custom Python modules, organize functions and classes, write reusable code components, and design effective module structures","creating-modules",95,"content:python:95.creating-modules.md","python/95.creating-modules.md","python/95.creating-modules",{"_path":873,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":874,"description":875,"slug":876,"parentId":854,"order":877,"_type":15,"_id":878,"_source":17,"_file":879,"_stem":880,"_extension":20},"/python/using-built-in-modules","Using Built-in Modules","Discover Python's extensive standard library and learn to effectively use built-in modules for common programming tasks, data processing, and system operations","using-built-in-modules",96,"content:python:96.using-built-in-modules.md","python/96.using-built-in-modules.md","python/96.using-built-in-modules",{"_path":882,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":883,"description":884,"slug":885,"parentId":854,"order":886,"_type":15,"_id":887,"_source":17,"_file":888,"_stem":889,"_extension":20},"/python/module-paths","Module Paths","Understand Python's module search system, manage import paths, work with packages, and organize larger projects with proper module path management","module-paths",97,"content:python:97.module-paths.md","python/97.module-paths.md","python/97.module-paths",{"_path":891,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":892,"description":893,"slug":894,"order":895,"isParent":13,"icon":14,"_type":15,"_id":896,"_source":17,"_file":897,"_stem":898,"_extension":20,"children":899,"expanded":13},"/python/reference-materials","Reference Materials","Comprehensive Python reference materials including reserved words, built-in functions, and operation guides for quick lookup and development support","reference-materials",98,"content:python:98.reference-materials.md","python/98.reference-materials.md","python/98.reference-materials",[900,909,918,927,936,945,953,961,970],{"_path":901,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":902,"description":903,"slug":904,"parentId":891,"order":905,"_type":15,"_id":906,"_source":17,"_file":907,"_stem":908,"_extension":20},"/python/reserved-words","Reserved Words","Complete reference of Python keywords and reserved words with descriptions, usage examples, and syntax guidelines","reserved-words",99,"content:python:99.reserved-words.md","python/99.reserved-words.md","python/99.reserved-words",{"_path":910,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":911,"description":912,"slug":913,"parentId":891,"order":914,"_type":15,"_id":915,"_source":17,"_file":916,"_stem":917,"_extension":20},"/python/built-in-functions","Built-in Functions","Comprehensive reference of Python's built-in functions with parameters, return values, and practical usage examples","built-in-functions",100,"content:python:100.built-in-functions.md","python/100.built-in-functions.md","python/100.built-in-functions",{"_path":919,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":920,"description":921,"slug":922,"parentId":891,"order":923,"_type":15,"_id":924,"_source":17,"_file":925,"_stem":926,"_extension":20},"/python/string-operations","String Operations","Complete reference of Python string methods, operations, and formatting techniques with examples and use cases","string-operations",101,"content:python:101.string-operations.md","python/101.string-operations.md","python/101.string-operations",{"_path":928,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":929,"description":930,"slug":931,"parentId":891,"order":932,"_type":15,"_id":933,"_source":17,"_file":934,"_stem":935,"_extension":20},"/python/list-operations","List Operations","Complete reference of Python list methods, operations, and manipulation techniques with examples and performance notes","list-operations",102,"content:python:102.list-operations.md","python/102.list-operations.md","python/102.list-operations",{"_path":937,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":938,"description":939,"slug":940,"parentId":891,"order":941,"_type":15,"_id":942,"_source":17,"_file":943,"_stem":944,"_extension":20},"/python/dictionary-operations","Dictionary Operations","Complete reference of Python dictionary methods, operations, and manipulation techniques with examples and use cases","dictionary-operations",103,"content:python:103.dictionary-operations.md","python/103.dictionary-operations.md","python/103.dictionary-operations",{"_path":946,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":435,"description":947,"slug":948,"parentId":891,"order":949,"_type":15,"_id":950,"_source":17,"_file":951,"_stem":952,"_extension":20},"/python/tuple-methods","Complete reference of Python tuple operations, methods, and techniques with examples and use cases","tuple-methods",104,"content:python:104.tuple-methods.md","python/104.tuple-methods.md","python/104.tuple-methods",{"_path":954,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":508,"description":955,"slug":956,"parentId":891,"order":957,"_type":15,"_id":958,"_source":17,"_file":959,"_stem":960,"_extension":20},"/python/set-methods","Complete reference of Python set operations, methods, and mathematical set operations with examples and use cases","set-methods",105,"content:python:105.set-methods.md","python/105.set-methods.md","python/105.set-methods",{"_path":962,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":963,"description":964,"slug":965,"parentId":891,"order":966,"_type":15,"_id":967,"_source":17,"_file":968,"_stem":969,"_extension":20},"/python/file-operations-reference","File Operations Reference","Complete reference of Python file operations, modes, methods, and file handling techniques with examples","file-operations-reference",106,"content:python:106.file-operations-reference.md","python/106.file-operations-reference.md","python/106.file-operations-reference",{"_path":971,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":972,"description":973,"slug":974,"parentId":891,"order":975,"_type":15,"_id":976,"_source":17,"_file":977,"_stem":978,"_extension":20},"/python/error-types","Error Types","Complete reference of Python exception types, error handling patterns, and debugging techniques with examples","error-types",107,"content:python:107.error-types.md","python/107.error-types.md","python/107.error-types",{"_path":980,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":981,"description":10,"slug":982,"order":983,"icon":14,"_type":15,"_id":984,"_source":17,"_file":985,"_stem":986,"_extension":20},"/python","Introduction","python-tutorial",0,"content:python:index.md","python/index.md","python/index",[306],{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":270,"order":311,"body":989,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},{"type":990,"children":991,"toc":6599},"root",[992,1000,1006,1011,1278,1285,1298,1402,1407,1414,1419,1813,1819,1831,1925,1930,1936,1941,2264,2270,2275,2565,2570,2576,2588,2701,2707,2712,3184,3190,3211,3339,3345,3350,3993,3999,4004,4010,4015,4667,4673,4678,4684,4689,5549,5555,5560,5697,5958,5964,6319,6325,6330,6521,6526,6532,6537,6542,6548,6582,6593],{"type":993,"tag":994,"props":995,"children":996},"element","h1",{"id":310},[997],{"type":998,"value":999},"text","➕ Adding to Lists",{"type":993,"tag":1001,"props":1002,"children":1003},"p",{},[1004],{"type":998,"value":1005},"Adding elements to lists is a fundamental operation that allows you to grow and expand your collections dynamically. Python provides several methods for adding elements, each designed for different scenarios - whether you need to add single items, multiple elements, or insert at specific positions.",{"type":993,"tag":1001,"props":1007,"children":1008},{},[1009],{"type":998,"value":1010},"Understanding these different approaches gives you the flexibility to build lists efficiently and choose the most appropriate method for your specific use case.",{"type":993,"tag":1012,"props":1013,"children":1014},"code-try",{},[1015],{"type":993,"tag":1016,"props":1017,"children":1020},"pre",{"className":1018,"code":1019,"language":6,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Different ways to add elements to lists\nfruits = [\"apple\", \"banana\"]\nprint(\"Original:\", fruits)\n\n# Add single element to end\nfruits.append(\"cherry\")\nprint(\"After append:\", fruits)\n\n# Add multiple elements\nfruits.extend([\"date\", \"elderberry\"])\nprint(\"After extend:\", fruits)\n\n# Insert at specific position\nfruits.insert(1, \"blueberry\")\nprint(\"After insert:\", fruits)\n",[1021],{"type":993,"tag":1022,"props":1023,"children":1024},"code",{"__ignoreMap":8},[1025,1036,1077,1101,1109,1117,1135,1155,1162,1170,1197,1217,1224,1232,1258],{"type":993,"tag":1026,"props":1027,"children":1029},"span",{"class":1028,"line":12},"line",[1030],{"type":993,"tag":1026,"props":1031,"children":1033},{"style":1032},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[1034],{"type":998,"value":1035},"# Different ways to add elements to lists\n",{"type":993,"tag":1026,"props":1037,"children":1038},{"class":1028,"line":27},[1039,1045,1051,1056,1062,1067,1072],{"type":993,"tag":1026,"props":1040,"children":1042},{"style":1041},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[1043],{"type":998,"value":1044},"fruits ",{"type":993,"tag":1026,"props":1046,"children":1048},{"style":1047},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[1049],{"type":998,"value":1050},"=",{"type":993,"tag":1026,"props":1052,"children":1053},{"style":1041},[1054],{"type":998,"value":1055}," [",{"type":993,"tag":1026,"props":1057,"children":1059},{"style":1058},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[1060],{"type":998,"value":1061},"\"apple\"",{"type":993,"tag":1026,"props":1063,"children":1064},{"style":1041},[1065],{"type":998,"value":1066},", ",{"type":993,"tag":1026,"props":1068,"children":1069},{"style":1058},[1070],{"type":998,"value":1071},"\"banana\"",{"type":993,"tag":1026,"props":1073,"children":1074},{"style":1041},[1075],{"type":998,"value":1076},"]\n",{"type":993,"tag":1026,"props":1078,"children":1079},{"class":1028,"line":36},[1080,1086,1091,1096],{"type":993,"tag":1026,"props":1081,"children":1083},{"style":1082},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[1084],{"type":998,"value":1085},"print",{"type":993,"tag":1026,"props":1087,"children":1088},{"style":1041},[1089],{"type":998,"value":1090},"(",{"type":993,"tag":1026,"props":1092,"children":1093},{"style":1058},[1094],{"type":998,"value":1095},"\"Original:\"",{"type":993,"tag":1026,"props":1097,"children":1098},{"style":1041},[1099],{"type":998,"value":1100},", fruits)\n",{"type":993,"tag":1026,"props":1102,"children":1103},{"class":1028,"line":45},[1104],{"type":993,"tag":1026,"props":1105,"children":1106},{"emptyLinePlaceholder":13},[1107],{"type":998,"value":1108},"\n",{"type":993,"tag":1026,"props":1110,"children":1111},{"class":1028,"line":54},[1112],{"type":993,"tag":1026,"props":1113,"children":1114},{"style":1032},[1115],{"type":998,"value":1116},"# Add single element to end\n",{"type":993,"tag":1026,"props":1118,"children":1119},{"class":1028,"line":63},[1120,1125,1130],{"type":993,"tag":1026,"props":1121,"children":1122},{"style":1041},[1123],{"type":998,"value":1124},"fruits.append(",{"type":993,"tag":1026,"props":1126,"children":1127},{"style":1058},[1128],{"type":998,"value":1129},"\"cherry\"",{"type":993,"tag":1026,"props":1131,"children":1132},{"style":1041},[1133],{"type":998,"value":1134},")\n",{"type":993,"tag":1026,"props":1136,"children":1137},{"class":1028,"line":72},[1138,1142,1146,1151],{"type":993,"tag":1026,"props":1139,"children":1140},{"style":1082},[1141],{"type":998,"value":1085},{"type":993,"tag":1026,"props":1143,"children":1144},{"style":1041},[1145],{"type":998,"value":1090},{"type":993,"tag":1026,"props":1147,"children":1148},{"style":1058},[1149],{"type":998,"value":1150},"\"After append:\"",{"type":993,"tag":1026,"props":1152,"children":1153},{"style":1041},[1154],{"type":998,"value":1100},{"type":993,"tag":1026,"props":1156,"children":1157},{"class":1028,"line":81},[1158],{"type":993,"tag":1026,"props":1159,"children":1160},{"emptyLinePlaceholder":13},[1161],{"type":998,"value":1108},{"type":993,"tag":1026,"props":1163,"children":1164},{"class":1028,"line":91},[1165],{"type":993,"tag":1026,"props":1166,"children":1167},{"style":1032},[1168],{"type":998,"value":1169},"# Add multiple elements\n",{"type":993,"tag":1026,"props":1171,"children":1172},{"class":1028,"line":100},[1173,1178,1183,1187,1192],{"type":993,"tag":1026,"props":1174,"children":1175},{"style":1041},[1176],{"type":998,"value":1177},"fruits.extend([",{"type":993,"tag":1026,"props":1179,"children":1180},{"style":1058},[1181],{"type":998,"value":1182},"\"date\"",{"type":993,"tag":1026,"props":1184,"children":1185},{"style":1041},[1186],{"type":998,"value":1066},{"type":993,"tag":1026,"props":1188,"children":1189},{"style":1058},[1190],{"type":998,"value":1191},"\"elderberry\"",{"type":993,"tag":1026,"props":1193,"children":1194},{"style":1041},[1195],{"type":998,"value":1196},"])\n",{"type":993,"tag":1026,"props":1198,"children":1199},{"class":1028,"line":109},[1200,1204,1208,1213],{"type":993,"tag":1026,"props":1201,"children":1202},{"style":1082},[1203],{"type":998,"value":1085},{"type":993,"tag":1026,"props":1205,"children":1206},{"style":1041},[1207],{"type":998,"value":1090},{"type":993,"tag":1026,"props":1209,"children":1210},{"style":1058},[1211],{"type":998,"value":1212},"\"After extend:\"",{"type":993,"tag":1026,"props":1214,"children":1215},{"style":1041},[1216],{"type":998,"value":1100},{"type":993,"tag":1026,"props":1218,"children":1219},{"class":1028,"line":118},[1220],{"type":993,"tag":1026,"props":1221,"children":1222},{"emptyLinePlaceholder":13},[1223],{"type":998,"value":1108},{"type":993,"tag":1026,"props":1225,"children":1226},{"class":1028,"line":127},[1227],{"type":993,"tag":1026,"props":1228,"children":1229},{"style":1032},[1230],{"type":998,"value":1231},"# Insert at specific position\n",{"type":993,"tag":1026,"props":1233,"children":1234},{"class":1028,"line":136},[1235,1240,1245,1249,1254],{"type":993,"tag":1026,"props":1236,"children":1237},{"style":1041},[1238],{"type":998,"value":1239},"fruits.insert(",{"type":993,"tag":1026,"props":1241,"children":1242},{"style":1082},[1243],{"type":998,"value":1244},"1",{"type":993,"tag":1026,"props":1246,"children":1247},{"style":1041},[1248],{"type":998,"value":1066},{"type":993,"tag":1026,"props":1250,"children":1251},{"style":1058},[1252],{"type":998,"value":1253},"\"blueberry\"",{"type":993,"tag":1026,"props":1255,"children":1256},{"style":1041},[1257],{"type":998,"value":1134},{"type":993,"tag":1026,"props":1259,"children":1260},{"class":1028,"line":146},[1261,1265,1269,1274],{"type":993,"tag":1026,"props":1262,"children":1263},{"style":1082},[1264],{"type":998,"value":1085},{"type":993,"tag":1026,"props":1266,"children":1267},{"style":1041},[1268],{"type":998,"value":1090},{"type":993,"tag":1026,"props":1270,"children":1271},{"style":1058},[1272],{"type":998,"value":1273},"\"After insert:\"",{"type":993,"tag":1026,"props":1275,"children":1276},{"style":1041},[1277],{"type":998,"value":1100},{"type":993,"tag":1279,"props":1280,"children":1282},"h2",{"id":1281},"adding-single-elements-with-append",[1283],{"type":998,"value":1284},"📌 Adding Single Elements with append()",{"type":993,"tag":1001,"props":1286,"children":1287},{},[1288,1290,1296],{"type":998,"value":1289},"The ",{"type":993,"tag":1022,"props":1291,"children":1293},{"className":1292},[],[1294],{"type":998,"value":1295},"append()",{"type":998,"value":1297}," method is the most common way to add a single element to the end of a list. This method modifies the original list and is perfect for building collections one item at a time.",{"type":993,"tag":1299,"props":1300,"children":1304},"info-box",{"emoji":1301,"title":1302,"type":1303},"🎯","append() Method Characteristics","info",[1305,1322,1330,1355,1363,1392],{"type":993,"tag":1001,"props":1306,"children":1307},{},[1308,1314,1316],{"type":993,"tag":1309,"props":1310,"children":1311},"strong",{},[1312],{"type":998,"value":1313},"Syntax:",{"type":998,"value":1315}," ",{"type":993,"tag":1022,"props":1317,"children":1319},{"className":1318},[],[1320],{"type":998,"value":1321},"list.append(item)",{"type":993,"tag":1001,"props":1323,"children":1324},{},[1325],{"type":993,"tag":1309,"props":1326,"children":1327},{},[1328],{"type":998,"value":1329},"Key Features:",{"type":993,"tag":1331,"props":1332,"children":1333},"ul",{},[1334,1340,1345,1350],{"type":993,"tag":1335,"props":1336,"children":1337},"li",{},[1338],{"type":998,"value":1339},"Adds exactly one element to the end",{"type":993,"tag":1335,"props":1341,"children":1342},{},[1343],{"type":998,"value":1344},"Modifies original list (returns None)",{"type":993,"tag":1335,"props":1346,"children":1347},{},[1348],{"type":998,"value":1349},"Accepts any data type as argument",{"type":993,"tag":1335,"props":1351,"children":1352},{},[1353],{"type":998,"value":1354},"Very fast operation (O(1) complexity)",{"type":993,"tag":1001,"props":1356,"children":1357},{},[1358],{"type":993,"tag":1309,"props":1359,"children":1360},{},[1361],{"type":998,"value":1362},"Common Use Cases:",{"type":993,"tag":1331,"props":1364,"children":1365},{},[1366,1371,1376,1387],{"type":993,"tag":1335,"props":1367,"children":1368},{},[1369],{"type":998,"value":1370},"Building lists incrementally",{"type":993,"tag":1335,"props":1372,"children":1373},{},[1374],{"type":998,"value":1375},"Collecting user input",{"type":993,"tag":1335,"props":1377,"children":1378},{},[1379,1381],{"type":998,"value":1380},"Accumulating results in ",{"type":993,"tag":1382,"props":1383,"children":1384},"a",{"href":243},[1385],{"type":998,"value":1386},"loops",{"type":993,"tag":1335,"props":1388,"children":1389},{},[1390],{"type":998,"value":1391},"Adding items to shopping carts or queues",{"type":993,"tag":1001,"props":1393,"children":1394},{},[1395,1400],{"type":993,"tag":1309,"props":1396,"children":1397},{},[1398],{"type":998,"value":1399},"Important:",{"type":998,"value":1401}," Always adds as single element, even if item is a list",{"type":993,"tag":1001,"props":1403,"children":1404},{},[1405],{"type":998,"value":1406},"The append method is efficient and straightforward, making it ideal for accumulating data, collecting user input, or building results incrementally.",{"type":993,"tag":1408,"props":1409,"children":1411},"h3",{"id":1410},"append-examples",[1412],{"type":998,"value":1413},"Append Examples",{"type":993,"tag":1001,"props":1415,"children":1416},{},[1417],{"type":998,"value":1418},"Various approaches to building lists one element at a time:",{"type":993,"tag":1012,"props":1420,"children":1421},{},[1422],{"type":993,"tag":1016,"props":1423,"children":1425},{"className":1018,"code":1424,"language":6,"meta":8,"style":8},"# Using append() to add single elements\nshopping_cart = []\nprint(\"Empty cart:\", shopping_cart)\n\n# Add items one by one\nshopping_cart.append(\"bread\")\nshopping_cart.append(\"milk\")\nshopping_cart.append(\"eggs\")\nprint(\"After adding items:\", shopping_cart)\n\n# Append different data types\nmixed_list = []\nmixed_list.append(42)\nmixed_list.append(\"hello\")\nmixed_list.append(True)\nmixed_list.append([1, 2, 3])\nprint(\"Mixed data types:\", mixed_list)\n\n# Building a list in a loop\nsquares = []\nfor i in range(1, 6):\n    squares.append(i ** 2)\nprint(\"Squares:\", squares)\n",[1426],{"type":993,"tag":1022,"props":1427,"children":1428},{"__ignoreMap":8},[1429,1437,1454,1475,1482,1490,1507,1523,1539,1559,1566,1574,1590,1607,1623,1639,1673,1694,1701,1709,1725,1770,1792],{"type":993,"tag":1026,"props":1430,"children":1431},{"class":1028,"line":12},[1432],{"type":993,"tag":1026,"props":1433,"children":1434},{"style":1032},[1435],{"type":998,"value":1436},"# Using append() to add single elements\n",{"type":993,"tag":1026,"props":1438,"children":1439},{"class":1028,"line":27},[1440,1445,1449],{"type":993,"tag":1026,"props":1441,"children":1442},{"style":1041},[1443],{"type":998,"value":1444},"shopping_cart ",{"type":993,"tag":1026,"props":1446,"children":1447},{"style":1047},[1448],{"type":998,"value":1050},{"type":993,"tag":1026,"props":1450,"children":1451},{"style":1041},[1452],{"type":998,"value":1453}," []\n",{"type":993,"tag":1026,"props":1455,"children":1456},{"class":1028,"line":36},[1457,1461,1465,1470],{"type":993,"tag":1026,"props":1458,"children":1459},{"style":1082},[1460],{"type":998,"value":1085},{"type":993,"tag":1026,"props":1462,"children":1463},{"style":1041},[1464],{"type":998,"value":1090},{"type":993,"tag":1026,"props":1466,"children":1467},{"style":1058},[1468],{"type":998,"value":1469},"\"Empty cart:\"",{"type":993,"tag":1026,"props":1471,"children":1472},{"style":1041},[1473],{"type":998,"value":1474},", shopping_cart)\n",{"type":993,"tag":1026,"props":1476,"children":1477},{"class":1028,"line":45},[1478],{"type":993,"tag":1026,"props":1479,"children":1480},{"emptyLinePlaceholder":13},[1481],{"type":998,"value":1108},{"type":993,"tag":1026,"props":1483,"children":1484},{"class":1028,"line":54},[1485],{"type":993,"tag":1026,"props":1486,"children":1487},{"style":1032},[1488],{"type":998,"value":1489},"# Add items one by one\n",{"type":993,"tag":1026,"props":1491,"children":1492},{"class":1028,"line":63},[1493,1498,1503],{"type":993,"tag":1026,"props":1494,"children":1495},{"style":1041},[1496],{"type":998,"value":1497},"shopping_cart.append(",{"type":993,"tag":1026,"props":1499,"children":1500},{"style":1058},[1501],{"type":998,"value":1502},"\"bread\"",{"type":993,"tag":1026,"props":1504,"children":1505},{"style":1041},[1506],{"type":998,"value":1134},{"type":993,"tag":1026,"props":1508,"children":1509},{"class":1028,"line":72},[1510,1514,1519],{"type":993,"tag":1026,"props":1511,"children":1512},{"style":1041},[1513],{"type":998,"value":1497},{"type":993,"tag":1026,"props":1515,"children":1516},{"style":1058},[1517],{"type":998,"value":1518},"\"milk\"",{"type":993,"tag":1026,"props":1520,"children":1521},{"style":1041},[1522],{"type":998,"value":1134},{"type":993,"tag":1026,"props":1524,"children":1525},{"class":1028,"line":81},[1526,1530,1535],{"type":993,"tag":1026,"props":1527,"children":1528},{"style":1041},[1529],{"type":998,"value":1497},{"type":993,"tag":1026,"props":1531,"children":1532},{"style":1058},[1533],{"type":998,"value":1534},"\"eggs\"",{"type":993,"tag":1026,"props":1536,"children":1537},{"style":1041},[1538],{"type":998,"value":1134},{"type":993,"tag":1026,"props":1540,"children":1541},{"class":1028,"line":91},[1542,1546,1550,1555],{"type":993,"tag":1026,"props":1543,"children":1544},{"style":1082},[1545],{"type":998,"value":1085},{"type":993,"tag":1026,"props":1547,"children":1548},{"style":1041},[1549],{"type":998,"value":1090},{"type":993,"tag":1026,"props":1551,"children":1552},{"style":1058},[1553],{"type":998,"value":1554},"\"After adding items:\"",{"type":993,"tag":1026,"props":1556,"children":1557},{"style":1041},[1558],{"type":998,"value":1474},{"type":993,"tag":1026,"props":1560,"children":1561},{"class":1028,"line":100},[1562],{"type":993,"tag":1026,"props":1563,"children":1564},{"emptyLinePlaceholder":13},[1565],{"type":998,"value":1108},{"type":993,"tag":1026,"props":1567,"children":1568},{"class":1028,"line":109},[1569],{"type":993,"tag":1026,"props":1570,"children":1571},{"style":1032},[1572],{"type":998,"value":1573},"# Append different data types\n",{"type":993,"tag":1026,"props":1575,"children":1576},{"class":1028,"line":118},[1577,1582,1586],{"type":993,"tag":1026,"props":1578,"children":1579},{"style":1041},[1580],{"type":998,"value":1581},"mixed_list ",{"type":993,"tag":1026,"props":1583,"children":1584},{"style":1047},[1585],{"type":998,"value":1050},{"type":993,"tag":1026,"props":1587,"children":1588},{"style":1041},[1589],{"type":998,"value":1453},{"type":993,"tag":1026,"props":1591,"children":1592},{"class":1028,"line":127},[1593,1598,1603],{"type":993,"tag":1026,"props":1594,"children":1595},{"style":1041},[1596],{"type":998,"value":1597},"mixed_list.append(",{"type":993,"tag":1026,"props":1599,"children":1600},{"style":1082},[1601],{"type":998,"value":1602},"42",{"type":993,"tag":1026,"props":1604,"children":1605},{"style":1041},[1606],{"type":998,"value":1134},{"type":993,"tag":1026,"props":1608,"children":1609},{"class":1028,"line":136},[1610,1614,1619],{"type":993,"tag":1026,"props":1611,"children":1612},{"style":1041},[1613],{"type":998,"value":1597},{"type":993,"tag":1026,"props":1615,"children":1616},{"style":1058},[1617],{"type":998,"value":1618},"\"hello\"",{"type":993,"tag":1026,"props":1620,"children":1621},{"style":1041},[1622],{"type":998,"value":1134},{"type":993,"tag":1026,"props":1624,"children":1625},{"class":1028,"line":146},[1626,1630,1635],{"type":993,"tag":1026,"props":1627,"children":1628},{"style":1041},[1629],{"type":998,"value":1597},{"type":993,"tag":1026,"props":1631,"children":1632},{"style":1082},[1633],{"type":998,"value":1634},"True",{"type":993,"tag":1026,"props":1636,"children":1637},{"style":1041},[1638],{"type":998,"value":1134},{"type":993,"tag":1026,"props":1640,"children":1641},{"class":1028,"line":155},[1642,1647,1651,1655,1660,1664,1669],{"type":993,"tag":1026,"props":1643,"children":1644},{"style":1041},[1645],{"type":998,"value":1646},"mixed_list.append([",{"type":993,"tag":1026,"props":1648,"children":1649},{"style":1082},[1650],{"type":998,"value":1244},{"type":993,"tag":1026,"props":1652,"children":1653},{"style":1041},[1654],{"type":998,"value":1066},{"type":993,"tag":1026,"props":1656,"children":1657},{"style":1082},[1658],{"type":998,"value":1659},"2",{"type":993,"tag":1026,"props":1661,"children":1662},{"style":1041},[1663],{"type":998,"value":1066},{"type":993,"tag":1026,"props":1665,"children":1666},{"style":1082},[1667],{"type":998,"value":1668},"3",{"type":993,"tag":1026,"props":1670,"children":1671},{"style":1041},[1672],{"type":998,"value":1196},{"type":993,"tag":1026,"props":1674,"children":1675},{"class":1028,"line":164},[1676,1680,1684,1689],{"type":993,"tag":1026,"props":1677,"children":1678},{"style":1082},[1679],{"type":998,"value":1085},{"type":993,"tag":1026,"props":1681,"children":1682},{"style":1041},[1683],{"type":998,"value":1090},{"type":993,"tag":1026,"props":1685,"children":1686},{"style":1058},[1687],{"type":998,"value":1688},"\"Mixed data types:\"",{"type":993,"tag":1026,"props":1690,"children":1691},{"style":1041},[1692],{"type":998,"value":1693},", mixed_list)\n",{"type":993,"tag":1026,"props":1695,"children":1696},{"class":1028,"line":173},[1697],{"type":993,"tag":1026,"props":1698,"children":1699},{"emptyLinePlaceholder":13},[1700],{"type":998,"value":1108},{"type":993,"tag":1026,"props":1702,"children":1703},{"class":1028,"line":182},[1704],{"type":993,"tag":1026,"props":1705,"children":1706},{"style":1032},[1707],{"type":998,"value":1708},"# Building a list in a loop\n",{"type":993,"tag":1026,"props":1710,"children":1711},{"class":1028,"line":191},[1712,1717,1721],{"type":993,"tag":1026,"props":1713,"children":1714},{"style":1041},[1715],{"type":998,"value":1716},"squares ",{"type":993,"tag":1026,"props":1718,"children":1719},{"style":1047},[1720],{"type":998,"value":1050},{"type":993,"tag":1026,"props":1722,"children":1723},{"style":1041},[1724],{"type":998,"value":1453},{"type":993,"tag":1026,"props":1726,"children":1727},{"class":1028,"line":201},[1728,1733,1738,1743,1748,1752,1756,1760,1765],{"type":993,"tag":1026,"props":1729,"children":1730},{"style":1047},[1731],{"type":998,"value":1732},"for",{"type":993,"tag":1026,"props":1734,"children":1735},{"style":1041},[1736],{"type":998,"value":1737}," i ",{"type":993,"tag":1026,"props":1739,"children":1740},{"style":1047},[1741],{"type":998,"value":1742},"in",{"type":993,"tag":1026,"props":1744,"children":1745},{"style":1082},[1746],{"type":998,"value":1747}," range",{"type":993,"tag":1026,"props":1749,"children":1750},{"style":1041},[1751],{"type":998,"value":1090},{"type":993,"tag":1026,"props":1753,"children":1754},{"style":1082},[1755],{"type":998,"value":1244},{"type":993,"tag":1026,"props":1757,"children":1758},{"style":1041},[1759],{"type":998,"value":1066},{"type":993,"tag":1026,"props":1761,"children":1762},{"style":1082},[1763],{"type":998,"value":1764},"6",{"type":993,"tag":1026,"props":1766,"children":1767},{"style":1041},[1768],{"type":998,"value":1769},"):\n",{"type":993,"tag":1026,"props":1771,"children":1772},{"class":1028,"line":210},[1773,1778,1783,1788],{"type":993,"tag":1026,"props":1774,"children":1775},{"style":1041},[1776],{"type":998,"value":1777},"    squares.append(i ",{"type":993,"tag":1026,"props":1779,"children":1780},{"style":1047},[1781],{"type":998,"value":1782},"**",{"type":993,"tag":1026,"props":1784,"children":1785},{"style":1082},[1786],{"type":998,"value":1787}," 2",{"type":993,"tag":1026,"props":1789,"children":1790},{"style":1041},[1791],{"type":998,"value":1134},{"type":993,"tag":1026,"props":1793,"children":1794},{"class":1028,"line":219},[1795,1799,1803,1808],{"type":993,"tag":1026,"props":1796,"children":1797},{"style":1082},[1798],{"type":998,"value":1085},{"type":993,"tag":1026,"props":1800,"children":1801},{"style":1041},[1802],{"type":998,"value":1090},{"type":993,"tag":1026,"props":1804,"children":1805},{"style":1058},[1806],{"type":998,"value":1807},"\"Squares:\"",{"type":993,"tag":1026,"props":1809,"children":1810},{"style":1041},[1811],{"type":998,"value":1812},", squares)\n",{"type":993,"tag":1279,"props":1814,"children":1816},{"id":1815},"inserting-at-specific-positions-with-insert",[1817],{"type":998,"value":1818},"📍 Inserting at Specific Positions with insert()",{"type":993,"tag":1001,"props":1820,"children":1821},{},[1822,1823,1829],{"type":998,"value":1289},{"type":993,"tag":1022,"props":1824,"children":1826},{"className":1825},[],[1827],{"type":998,"value":1828},"insert()",{"type":998,"value":1830}," method allows you to add an element at any position in the list, not just at the end. This method takes two arguments: the index where you want to insert and the element to insert.",{"type":993,"tag":1299,"props":1832,"children":1836},{"emoji":1833,"title":1834,"type":1835},"🎪","insert() Method Guide","success",[1837,1851,1859,1884,1892,1915],{"type":993,"tag":1001,"props":1838,"children":1839},{},[1840,1844,1845],{"type":993,"tag":1309,"props":1841,"children":1842},{},[1843],{"type":998,"value":1313},{"type":998,"value":1315},{"type":993,"tag":1022,"props":1846,"children":1848},{"className":1847},[],[1849],{"type":998,"value":1850},"list.insert(index, item)",{"type":993,"tag":1001,"props":1852,"children":1853},{},[1854],{"type":993,"tag":1309,"props":1855,"children":1856},{},[1857],{"type":998,"value":1858},"Parameters:",{"type":993,"tag":1331,"props":1860,"children":1861},{},[1862,1873],{"type":993,"tag":1335,"props":1863,"children":1864},{},[1865,1871],{"type":993,"tag":1022,"props":1866,"children":1868},{"className":1867},[],[1869],{"type":998,"value":1870},"index",{"type":998,"value":1872},": Position where item will be inserted",{"type":993,"tag":1335,"props":1874,"children":1875},{},[1876,1882],{"type":993,"tag":1022,"props":1877,"children":1879},{"className":1878},[],[1880],{"type":998,"value":1881},"item",{"type":998,"value":1883},": Element to add to the list",{"type":993,"tag":1001,"props":1885,"children":1886},{},[1887],{"type":993,"tag":1309,"props":1888,"children":1889},{},[1890],{"type":998,"value":1891},"Index Behavior:",{"type":993,"tag":1331,"props":1893,"children":1894},{},[1895,1900,1905,1910],{"type":993,"tag":1335,"props":1896,"children":1897},{},[1898],{"type":998,"value":1899},"Valid indices: 0 to len(list)",{"type":993,"tag":1335,"props":1901,"children":1902},{},[1903],{"type":998,"value":1904},"Negative indices count from end",{"type":993,"tag":1335,"props":1906,"children":1907},{},[1908],{"type":998,"value":1909},"Index > length: inserts at end",{"type":993,"tag":1335,"props":1911,"children":1912},{},[1913],{"type":998,"value":1914},"Existing elements shift right",{"type":993,"tag":1001,"props":1916,"children":1917},{},[1918,1923],{"type":993,"tag":1309,"props":1919,"children":1920},{},[1921],{"type":998,"value":1922},"Performance:",{"type":998,"value":1924}," O(n) complexity due to element shifting",{"type":993,"tag":1001,"props":1926,"children":1927},{},[1928],{"type":998,"value":1929},"Insert is particularly useful when you need to maintain order, add elements at the beginning, or place items at specific positions based on logic.",{"type":993,"tag":1408,"props":1931,"children":1933},{"id":1932},"insert-examples",[1934],{"type":998,"value":1935},"Insert Examples",{"type":993,"tag":1001,"props":1937,"children":1938},{},[1939],{"type":998,"value":1940},"Positioned element insertion for precise list construction:",{"type":993,"tag":1012,"props":1942,"children":1943},{},[1944],{"type":993,"tag":1016,"props":1945,"children":1947},{"className":1018,"code":1946,"language":6,"meta":8,"style":8},"# Using insert() for positioned additions\nnames = [\"Alice\", \"Charlie\", \"Diana\"]\nprint(\"Original names:\", names)\n\n# Insert at the beginning\nnames.insert(0, \"Aaron\")\nprint(\"After inserting at start:\", names)\n\n# Insert in the middle\nnames.insert(2, \"Bob\")\nprint(\"After inserting in middle:\", names)\n\n# Insert at the end (same as append)\nnames.insert(len(names), \"Eve\")\nprint(\"After inserting at end:\", names)\n\n# Insert with large index (goes to end)\nnames.insert(100, \"Frank\")\nprint(\"After inserting beyond length:\", names)\n",[1948],{"type":993,"tag":1022,"props":1949,"children":1950},{"__ignoreMap":8},[1951,1959,2002,2023,2030,2038,2064,2084,2091,2099,2123,2143,2150,2158,2184,2204,2211,2219,2244],{"type":993,"tag":1026,"props":1952,"children":1953},{"class":1028,"line":12},[1954],{"type":993,"tag":1026,"props":1955,"children":1956},{"style":1032},[1957],{"type":998,"value":1958},"# Using insert() for positioned additions\n",{"type":993,"tag":1026,"props":1960,"children":1961},{"class":1028,"line":27},[1962,1967,1971,1975,1980,1984,1989,1993,1998],{"type":993,"tag":1026,"props":1963,"children":1964},{"style":1041},[1965],{"type":998,"value":1966},"names ",{"type":993,"tag":1026,"props":1968,"children":1969},{"style":1047},[1970],{"type":998,"value":1050},{"type":993,"tag":1026,"props":1972,"children":1973},{"style":1041},[1974],{"type":998,"value":1055},{"type":993,"tag":1026,"props":1976,"children":1977},{"style":1058},[1978],{"type":998,"value":1979},"\"Alice\"",{"type":993,"tag":1026,"props":1981,"children":1982},{"style":1041},[1983],{"type":998,"value":1066},{"type":993,"tag":1026,"props":1985,"children":1986},{"style":1058},[1987],{"type":998,"value":1988},"\"Charlie\"",{"type":993,"tag":1026,"props":1990,"children":1991},{"style":1041},[1992],{"type":998,"value":1066},{"type":993,"tag":1026,"props":1994,"children":1995},{"style":1058},[1996],{"type":998,"value":1997},"\"Diana\"",{"type":993,"tag":1026,"props":1999,"children":2000},{"style":1041},[2001],{"type":998,"value":1076},{"type":993,"tag":1026,"props":2003,"children":2004},{"class":1028,"line":36},[2005,2009,2013,2018],{"type":993,"tag":1026,"props":2006,"children":2007},{"style":1082},[2008],{"type":998,"value":1085},{"type":993,"tag":1026,"props":2010,"children":2011},{"style":1041},[2012],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2014,"children":2015},{"style":1058},[2016],{"type":998,"value":2017},"\"Original names:\"",{"type":993,"tag":1026,"props":2019,"children":2020},{"style":1041},[2021],{"type":998,"value":2022},", names)\n",{"type":993,"tag":1026,"props":2024,"children":2025},{"class":1028,"line":45},[2026],{"type":993,"tag":1026,"props":2027,"children":2028},{"emptyLinePlaceholder":13},[2029],{"type":998,"value":1108},{"type":993,"tag":1026,"props":2031,"children":2032},{"class":1028,"line":54},[2033],{"type":993,"tag":1026,"props":2034,"children":2035},{"style":1032},[2036],{"type":998,"value":2037},"# Insert at the beginning\n",{"type":993,"tag":1026,"props":2039,"children":2040},{"class":1028,"line":63},[2041,2046,2051,2055,2060],{"type":993,"tag":1026,"props":2042,"children":2043},{"style":1041},[2044],{"type":998,"value":2045},"names.insert(",{"type":993,"tag":1026,"props":2047,"children":2048},{"style":1082},[2049],{"type":998,"value":2050},"0",{"type":993,"tag":1026,"props":2052,"children":2053},{"style":1041},[2054],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2056,"children":2057},{"style":1058},[2058],{"type":998,"value":2059},"\"Aaron\"",{"type":993,"tag":1026,"props":2061,"children":2062},{"style":1041},[2063],{"type":998,"value":1134},{"type":993,"tag":1026,"props":2065,"children":2066},{"class":1028,"line":72},[2067,2071,2075,2080],{"type":993,"tag":1026,"props":2068,"children":2069},{"style":1082},[2070],{"type":998,"value":1085},{"type":993,"tag":1026,"props":2072,"children":2073},{"style":1041},[2074],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2076,"children":2077},{"style":1058},[2078],{"type":998,"value":2079},"\"After inserting at start:\"",{"type":993,"tag":1026,"props":2081,"children":2082},{"style":1041},[2083],{"type":998,"value":2022},{"type":993,"tag":1026,"props":2085,"children":2086},{"class":1028,"line":81},[2087],{"type":993,"tag":1026,"props":2088,"children":2089},{"emptyLinePlaceholder":13},[2090],{"type":998,"value":1108},{"type":993,"tag":1026,"props":2092,"children":2093},{"class":1028,"line":91},[2094],{"type":993,"tag":1026,"props":2095,"children":2096},{"style":1032},[2097],{"type":998,"value":2098},"# Insert in the middle\n",{"type":993,"tag":1026,"props":2100,"children":2101},{"class":1028,"line":100},[2102,2106,2110,2114,2119],{"type":993,"tag":1026,"props":2103,"children":2104},{"style":1041},[2105],{"type":998,"value":2045},{"type":993,"tag":1026,"props":2107,"children":2108},{"style":1082},[2109],{"type":998,"value":1659},{"type":993,"tag":1026,"props":2111,"children":2112},{"style":1041},[2113],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2115,"children":2116},{"style":1058},[2117],{"type":998,"value":2118},"\"Bob\"",{"type":993,"tag":1026,"props":2120,"children":2121},{"style":1041},[2122],{"type":998,"value":1134},{"type":993,"tag":1026,"props":2124,"children":2125},{"class":1028,"line":109},[2126,2130,2134,2139],{"type":993,"tag":1026,"props":2127,"children":2128},{"style":1082},[2129],{"type":998,"value":1085},{"type":993,"tag":1026,"props":2131,"children":2132},{"style":1041},[2133],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2135,"children":2136},{"style":1058},[2137],{"type":998,"value":2138},"\"After inserting in middle:\"",{"type":993,"tag":1026,"props":2140,"children":2141},{"style":1041},[2142],{"type":998,"value":2022},{"type":993,"tag":1026,"props":2144,"children":2145},{"class":1028,"line":118},[2146],{"type":993,"tag":1026,"props":2147,"children":2148},{"emptyLinePlaceholder":13},[2149],{"type":998,"value":1108},{"type":993,"tag":1026,"props":2151,"children":2152},{"class":1028,"line":127},[2153],{"type":993,"tag":1026,"props":2154,"children":2155},{"style":1032},[2156],{"type":998,"value":2157},"# Insert at the end (same as append)\n",{"type":993,"tag":1026,"props":2159,"children":2160},{"class":1028,"line":136},[2161,2165,2170,2175,2180],{"type":993,"tag":1026,"props":2162,"children":2163},{"style":1041},[2164],{"type":998,"value":2045},{"type":993,"tag":1026,"props":2166,"children":2167},{"style":1082},[2168],{"type":998,"value":2169},"len",{"type":993,"tag":1026,"props":2171,"children":2172},{"style":1041},[2173],{"type":998,"value":2174},"(names), ",{"type":993,"tag":1026,"props":2176,"children":2177},{"style":1058},[2178],{"type":998,"value":2179},"\"Eve\"",{"type":993,"tag":1026,"props":2181,"children":2182},{"style":1041},[2183],{"type":998,"value":1134},{"type":993,"tag":1026,"props":2185,"children":2186},{"class":1028,"line":146},[2187,2191,2195,2200],{"type":993,"tag":1026,"props":2188,"children":2189},{"style":1082},[2190],{"type":998,"value":1085},{"type":993,"tag":1026,"props":2192,"children":2193},{"style":1041},[2194],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2196,"children":2197},{"style":1058},[2198],{"type":998,"value":2199},"\"After inserting at end:\"",{"type":993,"tag":1026,"props":2201,"children":2202},{"style":1041},[2203],{"type":998,"value":2022},{"type":993,"tag":1026,"props":2205,"children":2206},{"class":1028,"line":155},[2207],{"type":993,"tag":1026,"props":2208,"children":2209},{"emptyLinePlaceholder":13},[2210],{"type":998,"value":1108},{"type":993,"tag":1026,"props":2212,"children":2213},{"class":1028,"line":164},[2214],{"type":993,"tag":1026,"props":2215,"children":2216},{"style":1032},[2217],{"type":998,"value":2218},"# Insert with large index (goes to end)\n",{"type":993,"tag":1026,"props":2220,"children":2221},{"class":1028,"line":173},[2222,2226,2231,2235,2240],{"type":993,"tag":1026,"props":2223,"children":2224},{"style":1041},[2225],{"type":998,"value":2045},{"type":993,"tag":1026,"props":2227,"children":2228},{"style":1082},[2229],{"type":998,"value":2230},"100",{"type":993,"tag":1026,"props":2232,"children":2233},{"style":1041},[2234],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2236,"children":2237},{"style":1058},[2238],{"type":998,"value":2239},"\"Frank\"",{"type":993,"tag":1026,"props":2241,"children":2242},{"style":1041},[2243],{"type":998,"value":1134},{"type":993,"tag":1026,"props":2245,"children":2246},{"class":1028,"line":182},[2247,2251,2255,2260],{"type":993,"tag":1026,"props":2248,"children":2249},{"style":1082},[2250],{"type":998,"value":1085},{"type":993,"tag":1026,"props":2252,"children":2253},{"style":1041},[2254],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2256,"children":2257},{"style":1058},[2258],{"type":998,"value":2259},"\"After inserting beyond length:\"",{"type":993,"tag":1026,"props":2261,"children":2262},{"style":1041},[2263],{"type":998,"value":2022},{"type":993,"tag":1408,"props":2265,"children":2267},{"id":2266},"building-a-sorted-list",[2268],{"type":998,"value":2269},"Building a Sorted List",{"type":993,"tag":1001,"props":2271,"children":2272},{},[2273],{"type":998,"value":2274},"Ordered insertion for maintaining sorted collections:",{"type":993,"tag":1012,"props":2276,"children":2277},{},[2278],{"type":993,"tag":1016,"props":2279,"children":2281},{"className":1018,"code":2280,"language":6,"meta":8,"style":8},"# Building a sorted list with insert\nscores = []\nnew_scores = [85, 92, 78, 96, 88]\n\nfor score in new_scores:\n    # Insert in sorted position\n    inserted = False\n    for i in range(len(scores)):\n        if score \u003C scores[i]:\n            scores.insert(i, score)\n            inserted = True\n            break\n    if not inserted:\n        scores.append(score)\n\nprint(\"Sorted scores:\", scores)\n",[2282],{"type":993,"tag":1022,"props":2283,"children":2284},{"__ignoreMap":8},[2285,2293,2309,2370,2377,2398,2406,2423,2456,2478,2486,2503,2511,2529,2537,2544],{"type":993,"tag":1026,"props":2286,"children":2287},{"class":1028,"line":12},[2288],{"type":993,"tag":1026,"props":2289,"children":2290},{"style":1032},[2291],{"type":998,"value":2292},"# Building a sorted list with insert\n",{"type":993,"tag":1026,"props":2294,"children":2295},{"class":1028,"line":27},[2296,2301,2305],{"type":993,"tag":1026,"props":2297,"children":2298},{"style":1041},[2299],{"type":998,"value":2300},"scores ",{"type":993,"tag":1026,"props":2302,"children":2303},{"style":1047},[2304],{"type":998,"value":1050},{"type":993,"tag":1026,"props":2306,"children":2307},{"style":1041},[2308],{"type":998,"value":1453},{"type":993,"tag":1026,"props":2310,"children":2311},{"class":1028,"line":36},[2312,2317,2321,2325,2330,2334,2339,2343,2348,2352,2357,2361,2366],{"type":993,"tag":1026,"props":2313,"children":2314},{"style":1041},[2315],{"type":998,"value":2316},"new_scores ",{"type":993,"tag":1026,"props":2318,"children":2319},{"style":1047},[2320],{"type":998,"value":1050},{"type":993,"tag":1026,"props":2322,"children":2323},{"style":1041},[2324],{"type":998,"value":1055},{"type":993,"tag":1026,"props":2326,"children":2327},{"style":1082},[2328],{"type":998,"value":2329},"85",{"type":993,"tag":1026,"props":2331,"children":2332},{"style":1041},[2333],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2335,"children":2336},{"style":1082},[2337],{"type":998,"value":2338},"92",{"type":993,"tag":1026,"props":2340,"children":2341},{"style":1041},[2342],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2344,"children":2345},{"style":1082},[2346],{"type":998,"value":2347},"78",{"type":993,"tag":1026,"props":2349,"children":2350},{"style":1041},[2351],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2353,"children":2354},{"style":1082},[2355],{"type":998,"value":2356},"96",{"type":993,"tag":1026,"props":2358,"children":2359},{"style":1041},[2360],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2362,"children":2363},{"style":1082},[2364],{"type":998,"value":2365},"88",{"type":993,"tag":1026,"props":2367,"children":2368},{"style":1041},[2369],{"type":998,"value":1076},{"type":993,"tag":1026,"props":2371,"children":2372},{"class":1028,"line":45},[2373],{"type":993,"tag":1026,"props":2374,"children":2375},{"emptyLinePlaceholder":13},[2376],{"type":998,"value":1108},{"type":993,"tag":1026,"props":2378,"children":2379},{"class":1028,"line":54},[2380,2384,2389,2393],{"type":993,"tag":1026,"props":2381,"children":2382},{"style":1047},[2383],{"type":998,"value":1732},{"type":993,"tag":1026,"props":2385,"children":2386},{"style":1041},[2387],{"type":998,"value":2388}," score ",{"type":993,"tag":1026,"props":2390,"children":2391},{"style":1047},[2392],{"type":998,"value":1742},{"type":993,"tag":1026,"props":2394,"children":2395},{"style":1041},[2396],{"type":998,"value":2397}," new_scores:\n",{"type":993,"tag":1026,"props":2399,"children":2400},{"class":1028,"line":63},[2401],{"type":993,"tag":1026,"props":2402,"children":2403},{"style":1032},[2404],{"type":998,"value":2405},"    # Insert in sorted position\n",{"type":993,"tag":1026,"props":2407,"children":2408},{"class":1028,"line":72},[2409,2414,2418],{"type":993,"tag":1026,"props":2410,"children":2411},{"style":1041},[2412],{"type":998,"value":2413},"    inserted ",{"type":993,"tag":1026,"props":2415,"children":2416},{"style":1047},[2417],{"type":998,"value":1050},{"type":993,"tag":1026,"props":2419,"children":2420},{"style":1082},[2421],{"type":998,"value":2422}," False\n",{"type":993,"tag":1026,"props":2424,"children":2425},{"class":1028,"line":81},[2426,2431,2435,2439,2443,2447,2451],{"type":993,"tag":1026,"props":2427,"children":2428},{"style":1047},[2429],{"type":998,"value":2430},"    for",{"type":993,"tag":1026,"props":2432,"children":2433},{"style":1041},[2434],{"type":998,"value":1737},{"type":993,"tag":1026,"props":2436,"children":2437},{"style":1047},[2438],{"type":998,"value":1742},{"type":993,"tag":1026,"props":2440,"children":2441},{"style":1082},[2442],{"type":998,"value":1747},{"type":993,"tag":1026,"props":2444,"children":2445},{"style":1041},[2446],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2448,"children":2449},{"style":1082},[2450],{"type":998,"value":2169},{"type":993,"tag":1026,"props":2452,"children":2453},{"style":1041},[2454],{"type":998,"value":2455},"(scores)):\n",{"type":993,"tag":1026,"props":2457,"children":2458},{"class":1028,"line":91},[2459,2464,2468,2473],{"type":993,"tag":1026,"props":2460,"children":2461},{"style":1047},[2462],{"type":998,"value":2463},"        if",{"type":993,"tag":1026,"props":2465,"children":2466},{"style":1041},[2467],{"type":998,"value":2388},{"type":993,"tag":1026,"props":2469,"children":2470},{"style":1047},[2471],{"type":998,"value":2472},"\u003C",{"type":993,"tag":1026,"props":2474,"children":2475},{"style":1041},[2476],{"type":998,"value":2477}," scores[i]:\n",{"type":993,"tag":1026,"props":2479,"children":2480},{"class":1028,"line":100},[2481],{"type":993,"tag":1026,"props":2482,"children":2483},{"style":1041},[2484],{"type":998,"value":2485},"            scores.insert(i, score)\n",{"type":993,"tag":1026,"props":2487,"children":2488},{"class":1028,"line":109},[2489,2494,2498],{"type":993,"tag":1026,"props":2490,"children":2491},{"style":1041},[2492],{"type":998,"value":2493},"            inserted ",{"type":993,"tag":1026,"props":2495,"children":2496},{"style":1047},[2497],{"type":998,"value":1050},{"type":993,"tag":1026,"props":2499,"children":2500},{"style":1082},[2501],{"type":998,"value":2502}," True\n",{"type":993,"tag":1026,"props":2504,"children":2505},{"class":1028,"line":118},[2506],{"type":993,"tag":1026,"props":2507,"children":2508},{"style":1047},[2509],{"type":998,"value":2510},"            break\n",{"type":993,"tag":1026,"props":2512,"children":2513},{"class":1028,"line":127},[2514,2519,2524],{"type":993,"tag":1026,"props":2515,"children":2516},{"style":1047},[2517],{"type":998,"value":2518},"    if",{"type":993,"tag":1026,"props":2520,"children":2521},{"style":1047},[2522],{"type":998,"value":2523}," not",{"type":993,"tag":1026,"props":2525,"children":2526},{"style":1041},[2527],{"type":998,"value":2528}," inserted:\n",{"type":993,"tag":1026,"props":2530,"children":2531},{"class":1028,"line":136},[2532],{"type":993,"tag":1026,"props":2533,"children":2534},{"style":1041},[2535],{"type":998,"value":2536},"        scores.append(score)\n",{"type":993,"tag":1026,"props":2538,"children":2539},{"class":1028,"line":146},[2540],{"type":993,"tag":1026,"props":2541,"children":2542},{"emptyLinePlaceholder":13},[2543],{"type":998,"value":1108},{"type":993,"tag":1026,"props":2545,"children":2546},{"class":1028,"line":155},[2547,2551,2555,2560],{"type":993,"tag":1026,"props":2548,"children":2549},{"style":1082},[2550],{"type":998,"value":1085},{"type":993,"tag":1026,"props":2552,"children":2553},{"style":1041},[2554],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2556,"children":2557},{"style":1058},[2558],{"type":998,"value":2559},"\"Sorted scores:\"",{"type":993,"tag":1026,"props":2561,"children":2562},{"style":1041},[2563],{"type":998,"value":2564},", scores)\n",{"type":993,"tag":2566,"props":2567,"children":2569},"content-exercise",{":widget-view":2568,"category":6,"id":310},"true",[],{"type":993,"tag":1279,"props":2571,"children":2573},{"id":2572},"adding-multiple-elements-with-extend",[2574],{"type":998,"value":2575},"📦 Adding Multiple Elements with extend()",{"type":993,"tag":1001,"props":2577,"children":2578},{},[2579,2580,2586],{"type":998,"value":1289},{"type":993,"tag":1022,"props":2581,"children":2583},{"className":2582},[],[2584],{"type":998,"value":2585},"extend()",{"type":998,"value":2587}," method adds all elements from an iterable (like another list, tuple, or string) to the end of the current list. This is more efficient than multiple append operations when adding several elements.",{"type":993,"tag":1299,"props":2589,"children":2592},{"emoji":2590,"title":2591,"type":1303},"🔧","extend() Method Benefits",[2593,2607,2615,2638,2646,2692],{"type":993,"tag":1001,"props":2594,"children":2595},{},[2596,2600,2601],{"type":993,"tag":1309,"props":2597,"children":2598},{},[2599],{"type":998,"value":1313},{"type":998,"value":1315},{"type":993,"tag":1022,"props":2602,"children":2604},{"className":2603},[],[2605],{"type":998,"value":2606},"list.extend(iterable)",{"type":993,"tag":1001,"props":2608,"children":2609},{},[2610],{"type":993,"tag":1309,"props":2611,"children":2612},{},[2613],{"type":998,"value":2614},"Key Advantages:",{"type":993,"tag":1331,"props":2616,"children":2617},{},[2618,2623,2628,2633],{"type":993,"tag":1335,"props":2619,"children":2620},{},[2621],{"type":998,"value":2622},"Adds all elements individually from iterable",{"type":993,"tag":1335,"props":2624,"children":2625},{},[2626],{"type":998,"value":2627},"More efficient than multiple append() calls",{"type":993,"tag":1335,"props":2629,"children":2630},{},[2631],{"type":998,"value":2632},"Works with any iterable (lists, tuples, strings, ranges)",{"type":993,"tag":1335,"props":2634,"children":2635},{},[2636],{"type":998,"value":2637},"Modifies original list in place",{"type":993,"tag":1001,"props":2639,"children":2640},{},[2641],{"type":993,"tag":1309,"props":2642,"children":2643},{},[2644],{"type":998,"value":2645},"Comparison with append():",{"type":993,"tag":1331,"props":2647,"children":2648},{},[2649,2668],{"type":993,"tag":1335,"props":2650,"children":2651},{},[2652,2658,2660,2666],{"type":993,"tag":1022,"props":2653,"children":2655},{"className":2654},[],[2656],{"type":998,"value":2657},"append([1, 2])",{"type":998,"value":2659}," → adds ",{"type":993,"tag":1022,"props":2661,"children":2663},{"className":2662},[],[2664],{"type":998,"value":2665},"[1, 2]",{"type":998,"value":2667}," as single element",{"type":993,"tag":1335,"props":2669,"children":2670},{},[2671,2677,2678,2683,2685,2690],{"type":993,"tag":1022,"props":2672,"children":2674},{"className":2673},[],[2675],{"type":998,"value":2676},"extend([1, 2])",{"type":998,"value":2659},{"type":993,"tag":1022,"props":2679,"children":2681},{"className":2680},[],[2682],{"type":998,"value":1244},{"type":998,"value":2684}," and ",{"type":993,"tag":1022,"props":2686,"children":2688},{"className":2687},[],[2689],{"type":998,"value":1659},{"type":998,"value":2691}," as separate elements",{"type":993,"tag":1001,"props":2693,"children":2694},{},[2695,2699],{"type":993,"tag":1309,"props":2696,"children":2697},{},[2698],{"type":998,"value":1922},{"type":998,"value":2700}," O(k) where k is number of elements being added",{"type":993,"tag":1408,"props":2702,"children":2704},{"id":2703},"extend-examples",[2705],{"type":998,"value":2706},"Extend Examples",{"type":993,"tag":1001,"props":2708,"children":2709},{},[2710],{"type":998,"value":2711},"Bulk addition of elements from various iterables:",{"type":993,"tag":1012,"props":2713,"children":2714},{},[2715],{"type":993,"tag":1016,"props":2716,"children":2718},{"className":1018,"code":2717,"language":6,"meta":8,"style":8},"# Basic extend usage\nfruits = [\"apple\", \"banana\"]\nprint(\"Original fruits:\", fruits)\n\n# Extend with another list\nmore_fruits = [\"cherry\", \"date\", \"elderberry\"]\nfruits.extend(more_fruits)\nprint(\"After extending with list:\", fruits)\n\n# Extend with different iterables\ncolors = [\"red\", \"green\"]\nprint(\"Original colors:\", colors)\n\n# Extend with tuple\ncolors.extend((\"blue\", \"yellow\"))\nprint(\"After extending with tuple:\", colors)\n\n# Extend with string (adds each character)\nletters = [\"a\", \"b\"]\nletters.extend(\"cd\")\nprint(\"Letters after extending with string:\", letters)\n\n# Extend with range\nnumbers = [1, 2]\nnumbers.extend(range(3, 6))\nprint(\"Numbers after extending with range:\", numbers)\n",[2719],{"type":993,"tag":1022,"props":2720,"children":2721},{"__ignoreMap":8},[2722,2730,2761,2781,2788,2796,2836,2844,2864,2871,2879,2913,2934,2941,2949,2976,2996,3003,3011,3045,3062,3083,3090,3098,3130,3163],{"type":993,"tag":1026,"props":2723,"children":2724},{"class":1028,"line":12},[2725],{"type":993,"tag":1026,"props":2726,"children":2727},{"style":1032},[2728],{"type":998,"value":2729},"# Basic extend usage\n",{"type":993,"tag":1026,"props":2731,"children":2732},{"class":1028,"line":27},[2733,2737,2741,2745,2749,2753,2757],{"type":993,"tag":1026,"props":2734,"children":2735},{"style":1041},[2736],{"type":998,"value":1044},{"type":993,"tag":1026,"props":2738,"children":2739},{"style":1047},[2740],{"type":998,"value":1050},{"type":993,"tag":1026,"props":2742,"children":2743},{"style":1041},[2744],{"type":998,"value":1055},{"type":993,"tag":1026,"props":2746,"children":2747},{"style":1058},[2748],{"type":998,"value":1061},{"type":993,"tag":1026,"props":2750,"children":2751},{"style":1041},[2752],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2754,"children":2755},{"style":1058},[2756],{"type":998,"value":1071},{"type":993,"tag":1026,"props":2758,"children":2759},{"style":1041},[2760],{"type":998,"value":1076},{"type":993,"tag":1026,"props":2762,"children":2763},{"class":1028,"line":36},[2764,2768,2772,2777],{"type":993,"tag":1026,"props":2765,"children":2766},{"style":1082},[2767],{"type":998,"value":1085},{"type":993,"tag":1026,"props":2769,"children":2770},{"style":1041},[2771],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2773,"children":2774},{"style":1058},[2775],{"type":998,"value":2776},"\"Original fruits:\"",{"type":993,"tag":1026,"props":2778,"children":2779},{"style":1041},[2780],{"type":998,"value":1100},{"type":993,"tag":1026,"props":2782,"children":2783},{"class":1028,"line":45},[2784],{"type":993,"tag":1026,"props":2785,"children":2786},{"emptyLinePlaceholder":13},[2787],{"type":998,"value":1108},{"type":993,"tag":1026,"props":2789,"children":2790},{"class":1028,"line":54},[2791],{"type":993,"tag":1026,"props":2792,"children":2793},{"style":1032},[2794],{"type":998,"value":2795},"# Extend with another list\n",{"type":993,"tag":1026,"props":2797,"children":2798},{"class":1028,"line":63},[2799,2804,2808,2812,2816,2820,2824,2828,2832],{"type":993,"tag":1026,"props":2800,"children":2801},{"style":1041},[2802],{"type":998,"value":2803},"more_fruits ",{"type":993,"tag":1026,"props":2805,"children":2806},{"style":1047},[2807],{"type":998,"value":1050},{"type":993,"tag":1026,"props":2809,"children":2810},{"style":1041},[2811],{"type":998,"value":1055},{"type":993,"tag":1026,"props":2813,"children":2814},{"style":1058},[2815],{"type":998,"value":1129},{"type":993,"tag":1026,"props":2817,"children":2818},{"style":1041},[2819],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2821,"children":2822},{"style":1058},[2823],{"type":998,"value":1182},{"type":993,"tag":1026,"props":2825,"children":2826},{"style":1041},[2827],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2829,"children":2830},{"style":1058},[2831],{"type":998,"value":1191},{"type":993,"tag":1026,"props":2833,"children":2834},{"style":1041},[2835],{"type":998,"value":1076},{"type":993,"tag":1026,"props":2837,"children":2838},{"class":1028,"line":72},[2839],{"type":993,"tag":1026,"props":2840,"children":2841},{"style":1041},[2842],{"type":998,"value":2843},"fruits.extend(more_fruits)\n",{"type":993,"tag":1026,"props":2845,"children":2846},{"class":1028,"line":81},[2847,2851,2855,2860],{"type":993,"tag":1026,"props":2848,"children":2849},{"style":1082},[2850],{"type":998,"value":1085},{"type":993,"tag":1026,"props":2852,"children":2853},{"style":1041},[2854],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2856,"children":2857},{"style":1058},[2858],{"type":998,"value":2859},"\"After extending with list:\"",{"type":993,"tag":1026,"props":2861,"children":2862},{"style":1041},[2863],{"type":998,"value":1100},{"type":993,"tag":1026,"props":2865,"children":2866},{"class":1028,"line":91},[2867],{"type":993,"tag":1026,"props":2868,"children":2869},{"emptyLinePlaceholder":13},[2870],{"type":998,"value":1108},{"type":993,"tag":1026,"props":2872,"children":2873},{"class":1028,"line":100},[2874],{"type":993,"tag":1026,"props":2875,"children":2876},{"style":1032},[2877],{"type":998,"value":2878},"# Extend with different iterables\n",{"type":993,"tag":1026,"props":2880,"children":2881},{"class":1028,"line":109},[2882,2887,2891,2895,2900,2904,2909],{"type":993,"tag":1026,"props":2883,"children":2884},{"style":1041},[2885],{"type":998,"value":2886},"colors ",{"type":993,"tag":1026,"props":2888,"children":2889},{"style":1047},[2890],{"type":998,"value":1050},{"type":993,"tag":1026,"props":2892,"children":2893},{"style":1041},[2894],{"type":998,"value":1055},{"type":993,"tag":1026,"props":2896,"children":2897},{"style":1058},[2898],{"type":998,"value":2899},"\"red\"",{"type":993,"tag":1026,"props":2901,"children":2902},{"style":1041},[2903],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2905,"children":2906},{"style":1058},[2907],{"type":998,"value":2908},"\"green\"",{"type":993,"tag":1026,"props":2910,"children":2911},{"style":1041},[2912],{"type":998,"value":1076},{"type":993,"tag":1026,"props":2914,"children":2915},{"class":1028,"line":118},[2916,2920,2924,2929],{"type":993,"tag":1026,"props":2917,"children":2918},{"style":1082},[2919],{"type":998,"value":1085},{"type":993,"tag":1026,"props":2921,"children":2922},{"style":1041},[2923],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2925,"children":2926},{"style":1058},[2927],{"type":998,"value":2928},"\"Original colors:\"",{"type":993,"tag":1026,"props":2930,"children":2931},{"style":1041},[2932],{"type":998,"value":2933},", colors)\n",{"type":993,"tag":1026,"props":2935,"children":2936},{"class":1028,"line":127},[2937],{"type":993,"tag":1026,"props":2938,"children":2939},{"emptyLinePlaceholder":13},[2940],{"type":998,"value":1108},{"type":993,"tag":1026,"props":2942,"children":2943},{"class":1028,"line":136},[2944],{"type":993,"tag":1026,"props":2945,"children":2946},{"style":1032},[2947],{"type":998,"value":2948},"# Extend with tuple\n",{"type":993,"tag":1026,"props":2950,"children":2951},{"class":1028,"line":146},[2952,2957,2962,2966,2971],{"type":993,"tag":1026,"props":2953,"children":2954},{"style":1041},[2955],{"type":998,"value":2956},"colors.extend((",{"type":993,"tag":1026,"props":2958,"children":2959},{"style":1058},[2960],{"type":998,"value":2961},"\"blue\"",{"type":993,"tag":1026,"props":2963,"children":2964},{"style":1041},[2965],{"type":998,"value":1066},{"type":993,"tag":1026,"props":2967,"children":2968},{"style":1058},[2969],{"type":998,"value":2970},"\"yellow\"",{"type":993,"tag":1026,"props":2972,"children":2973},{"style":1041},[2974],{"type":998,"value":2975},"))\n",{"type":993,"tag":1026,"props":2977,"children":2978},{"class":1028,"line":155},[2979,2983,2987,2992],{"type":993,"tag":1026,"props":2980,"children":2981},{"style":1082},[2982],{"type":998,"value":1085},{"type":993,"tag":1026,"props":2984,"children":2985},{"style":1041},[2986],{"type":998,"value":1090},{"type":993,"tag":1026,"props":2988,"children":2989},{"style":1058},[2990],{"type":998,"value":2991},"\"After extending with tuple:\"",{"type":993,"tag":1026,"props":2993,"children":2994},{"style":1041},[2995],{"type":998,"value":2933},{"type":993,"tag":1026,"props":2997,"children":2998},{"class":1028,"line":164},[2999],{"type":993,"tag":1026,"props":3000,"children":3001},{"emptyLinePlaceholder":13},[3002],{"type":998,"value":1108},{"type":993,"tag":1026,"props":3004,"children":3005},{"class":1028,"line":173},[3006],{"type":993,"tag":1026,"props":3007,"children":3008},{"style":1032},[3009],{"type":998,"value":3010},"# Extend with string (adds each character)\n",{"type":993,"tag":1026,"props":3012,"children":3013},{"class":1028,"line":182},[3014,3019,3023,3027,3032,3036,3041],{"type":993,"tag":1026,"props":3015,"children":3016},{"style":1041},[3017],{"type":998,"value":3018},"letters ",{"type":993,"tag":1026,"props":3020,"children":3021},{"style":1047},[3022],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3024,"children":3025},{"style":1041},[3026],{"type":998,"value":1055},{"type":993,"tag":1026,"props":3028,"children":3029},{"style":1058},[3030],{"type":998,"value":3031},"\"a\"",{"type":993,"tag":1026,"props":3033,"children":3034},{"style":1041},[3035],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3037,"children":3038},{"style":1058},[3039],{"type":998,"value":3040},"\"b\"",{"type":993,"tag":1026,"props":3042,"children":3043},{"style":1041},[3044],{"type":998,"value":1076},{"type":993,"tag":1026,"props":3046,"children":3047},{"class":1028,"line":191},[3048,3053,3058],{"type":993,"tag":1026,"props":3049,"children":3050},{"style":1041},[3051],{"type":998,"value":3052},"letters.extend(",{"type":993,"tag":1026,"props":3054,"children":3055},{"style":1058},[3056],{"type":998,"value":3057},"\"cd\"",{"type":993,"tag":1026,"props":3059,"children":3060},{"style":1041},[3061],{"type":998,"value":1134},{"type":993,"tag":1026,"props":3063,"children":3064},{"class":1028,"line":201},[3065,3069,3073,3078],{"type":993,"tag":1026,"props":3066,"children":3067},{"style":1082},[3068],{"type":998,"value":1085},{"type":993,"tag":1026,"props":3070,"children":3071},{"style":1041},[3072],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3074,"children":3075},{"style":1058},[3076],{"type":998,"value":3077},"\"Letters after extending with string:\"",{"type":993,"tag":1026,"props":3079,"children":3080},{"style":1041},[3081],{"type":998,"value":3082},", letters)\n",{"type":993,"tag":1026,"props":3084,"children":3085},{"class":1028,"line":210},[3086],{"type":993,"tag":1026,"props":3087,"children":3088},{"emptyLinePlaceholder":13},[3089],{"type":998,"value":1108},{"type":993,"tag":1026,"props":3091,"children":3092},{"class":1028,"line":219},[3093],{"type":993,"tag":1026,"props":3094,"children":3095},{"style":1032},[3096],{"type":998,"value":3097},"# Extend with range\n",{"type":993,"tag":1026,"props":3099,"children":3100},{"class":1028,"line":228},[3101,3106,3110,3114,3118,3122,3126],{"type":993,"tag":1026,"props":3102,"children":3103},{"style":1041},[3104],{"type":998,"value":3105},"numbers ",{"type":993,"tag":1026,"props":3107,"children":3108},{"style":1047},[3109],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3111,"children":3112},{"style":1041},[3113],{"type":998,"value":1055},{"type":993,"tag":1026,"props":3115,"children":3116},{"style":1082},[3117],{"type":998,"value":1244},{"type":993,"tag":1026,"props":3119,"children":3120},{"style":1041},[3121],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3123,"children":3124},{"style":1082},[3125],{"type":998,"value":1659},{"type":993,"tag":1026,"props":3127,"children":3128},{"style":1041},[3129],{"type":998,"value":1076},{"type":993,"tag":1026,"props":3131,"children":3132},{"class":1028,"line":238},[3133,3138,3143,3147,3151,3155,3159],{"type":993,"tag":1026,"props":3134,"children":3135},{"style":1041},[3136],{"type":998,"value":3137},"numbers.extend(",{"type":993,"tag":1026,"props":3139,"children":3140},{"style":1082},[3141],{"type":998,"value":3142},"range",{"type":993,"tag":1026,"props":3144,"children":3145},{"style":1041},[3146],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3148,"children":3149},{"style":1082},[3150],{"type":998,"value":1668},{"type":993,"tag":1026,"props":3152,"children":3153},{"style":1041},[3154],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3156,"children":3157},{"style":1082},[3158],{"type":998,"value":1764},{"type":993,"tag":1026,"props":3160,"children":3161},{"style":1041},[3162],{"type":998,"value":2975},{"type":993,"tag":1026,"props":3164,"children":3165},{"class":1028,"line":247},[3166,3170,3174,3179],{"type":993,"tag":1026,"props":3167,"children":3168},{"style":1082},[3169],{"type":998,"value":1085},{"type":993,"tag":1026,"props":3171,"children":3172},{"style":1041},[3173],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3175,"children":3176},{"style":1058},[3177],{"type":998,"value":3178},"\"Numbers after extending with range:\"",{"type":993,"tag":1026,"props":3180,"children":3181},{"style":1041},[3182],{"type":998,"value":3183},", numbers)\n",{"type":993,"tag":1279,"props":3185,"children":3187},{"id":3186},"list-concatenation-with-and",[3188],{"type":998,"value":3189},"🔗 List Concatenation with + and +=",{"type":993,"tag":1001,"props":3191,"children":3192},{},[3193,3195,3201,3203,3209],{"type":998,"value":3194},"Python provides operators for combining lists. The ",{"type":993,"tag":1022,"props":3196,"children":3198},{"className":3197},[],[3199],{"type":998,"value":3200},"+",{"type":998,"value":3202}," operator creates a new list, while ",{"type":993,"tag":1022,"props":3204,"children":3206},{"className":3205},[],[3207],{"type":998,"value":3208},"+=",{"type":998,"value":3210}," modifies the existing list (similar to extend).",{"type":993,"tag":1299,"props":3212,"children":3216},{"emoji":3213,"title":3214,"type":3215},"⚖️","Concatenation vs Extension","warning",[3217,3225,3238,3260,3272,3294,3301],{"type":993,"tag":1001,"props":3218,"children":3219},{},[3220],{"type":993,"tag":1309,"props":3221,"children":3222},{},[3223],{"type":998,"value":3224},"Key Differences:",{"type":993,"tag":1001,"props":3226,"children":3227},{},[3228],{"type":993,"tag":1309,"props":3229,"children":3230},{},[3231,3236],{"type":993,"tag":1022,"props":3232,"children":3234},{"className":3233},[],[3235],{"type":998,"value":3200},{"type":998,"value":3237}," Operator:",{"type":993,"tag":1331,"props":3239,"children":3240},{},[3241,3246,3251],{"type":993,"tag":1335,"props":3242,"children":3243},{},[3244],{"type":998,"value":3245},"Creates new list object",{"type":993,"tag":1335,"props":3247,"children":3248},{},[3249],{"type":998,"value":3250},"Original lists unchanged",{"type":993,"tag":1335,"props":3252,"children":3253},{},[3254],{"type":993,"tag":1022,"props":3255,"children":3257},{"className":3256},[],[3258],{"type":998,"value":3259},"result = list1 + list2",{"type":993,"tag":1001,"props":3261,"children":3262},{},[3263],{"type":993,"tag":1309,"props":3264,"children":3265},{},[3266,3271],{"type":993,"tag":1022,"props":3267,"children":3269},{"className":3268},[],[3270],{"type":998,"value":3208},{"type":998,"value":3237},{"type":993,"tag":1331,"props":3273,"children":3274},{},[3275,3280,3285],{"type":993,"tag":1335,"props":3276,"children":3277},{},[3278],{"type":998,"value":3279},"Modifies original list (same as extend)",{"type":993,"tag":1335,"props":3281,"children":3282},{},[3283],{"type":998,"value":3284},"More memory efficient",{"type":993,"tag":1335,"props":3286,"children":3287},{},[3288],{"type":993,"tag":1022,"props":3289,"children":3291},{"className":3290},[],[3292],{"type":998,"value":3293},"list1 += list2",{"type":993,"tag":1001,"props":3295,"children":3296},{},[3297],{"type":993,"tag":1309,"props":3298,"children":3299},{},[3300],{"type":998,"value":1922},{"type":993,"tag":1331,"props":3302,"children":3303},{},[3304,3316,3327],{"type":993,"tag":1335,"props":3305,"children":3306},{},[3307,3309,3314],{"type":998,"value":3308},"Use ",{"type":993,"tag":1022,"props":3310,"children":3312},{"className":3311},[],[3313],{"type":998,"value":3208},{"type":998,"value":3315}," for modifying existing lists",{"type":993,"tag":1335,"props":3317,"children":3318},{},[3319,3320,3325],{"type":998,"value":3308},{"type":993,"tag":1022,"props":3321,"children":3323},{"className":3322},[],[3324],{"type":998,"value":3200},{"type":998,"value":3326}," when you need new list",{"type":993,"tag":1335,"props":3328,"children":3329},{},[3330,3332,3337],{"type":998,"value":3331},"Avoid repeated ",{"type":993,"tag":1022,"props":3333,"children":3335},{"className":3334},[],[3336],{"type":998,"value":3200},{"type":998,"value":3338}," in loops (use extend instead)",{"type":993,"tag":1408,"props":3340,"children":3342},{"id":3341},"concatenation-examples",[3343],{"type":998,"value":3344},"Concatenation Examples",{"type":993,"tag":1001,"props":3346,"children":3347},{},[3348],{"type":998,"value":3349},"Different approaches to combining lists:",{"type":993,"tag":1012,"props":3351,"children":3352},{},[3353],{"type":993,"tag":1016,"props":3354,"children":3356},{"className":1018,"code":3355,"language":6,"meta":8,"style":8},"# Using + operator (creates new list)\nlist1 = [1, 2, 3]\nlist2 = [4, 5, 6]\ncombined = list1 + list2\nprint(\"Original list1:\", list1)\nprint(\"Original list2:\", list2)\nprint(\"Combined (new list):\", combined)\n\n# Using += operator (modifies original)\nlist1 = [1, 2, 3]\nlist2 = [4, 5, 6]\nprint(\"Before +=:\", list1)\nlist1 += list2\nprint(\"After +=:\", list1)\n\n# Concatenating multiple lists\npart1 = [\"a\", \"b\"]\npart2 = [\"c\", \"d\"]\npart3 = [\"e\", \"f\"]\nall_parts = part1 + part2 + part3\nprint(\"All parts:\", all_parts)\n\n# Building list with concatenation\nresult = []\nfor i in range(3):\n    new_items = [i, i*2]\n    result += new_items  # Same as result.extend(new_items)\nprint(\"Built with +=:\", result)\n",[3357],{"type":993,"tag":1022,"props":3358,"children":3359},{"__ignoreMap":8},[3360,3368,3408,3450,3476,3497,3518,3539,3546,3554,3593,3632,3652,3667,3687,3694,3702,3734,3768,3802,3837,3858,3865,3873,3889,3920,3950,3972],{"type":993,"tag":1026,"props":3361,"children":3362},{"class":1028,"line":12},[3363],{"type":993,"tag":1026,"props":3364,"children":3365},{"style":1032},[3366],{"type":998,"value":3367},"# Using + operator (creates new list)\n",{"type":993,"tag":1026,"props":3369,"children":3370},{"class":1028,"line":27},[3371,3376,3380,3384,3388,3392,3396,3400,3404],{"type":993,"tag":1026,"props":3372,"children":3373},{"style":1041},[3374],{"type":998,"value":3375},"list1 ",{"type":993,"tag":1026,"props":3377,"children":3378},{"style":1047},[3379],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3381,"children":3382},{"style":1041},[3383],{"type":998,"value":1055},{"type":993,"tag":1026,"props":3385,"children":3386},{"style":1082},[3387],{"type":998,"value":1244},{"type":993,"tag":1026,"props":3389,"children":3390},{"style":1041},[3391],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3393,"children":3394},{"style":1082},[3395],{"type":998,"value":1659},{"type":993,"tag":1026,"props":3397,"children":3398},{"style":1041},[3399],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3401,"children":3402},{"style":1082},[3403],{"type":998,"value":1668},{"type":993,"tag":1026,"props":3405,"children":3406},{"style":1041},[3407],{"type":998,"value":1076},{"type":993,"tag":1026,"props":3409,"children":3410},{"class":1028,"line":36},[3411,3416,3420,3424,3429,3433,3438,3442,3446],{"type":993,"tag":1026,"props":3412,"children":3413},{"style":1041},[3414],{"type":998,"value":3415},"list2 ",{"type":993,"tag":1026,"props":3417,"children":3418},{"style":1047},[3419],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3421,"children":3422},{"style":1041},[3423],{"type":998,"value":1055},{"type":993,"tag":1026,"props":3425,"children":3426},{"style":1082},[3427],{"type":998,"value":3428},"4",{"type":993,"tag":1026,"props":3430,"children":3431},{"style":1041},[3432],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3434,"children":3435},{"style":1082},[3436],{"type":998,"value":3437},"5",{"type":993,"tag":1026,"props":3439,"children":3440},{"style":1041},[3441],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3443,"children":3444},{"style":1082},[3445],{"type":998,"value":1764},{"type":993,"tag":1026,"props":3447,"children":3448},{"style":1041},[3449],{"type":998,"value":1076},{"type":993,"tag":1026,"props":3451,"children":3452},{"class":1028,"line":45},[3453,3458,3462,3467,3471],{"type":993,"tag":1026,"props":3454,"children":3455},{"style":1041},[3456],{"type":998,"value":3457},"combined ",{"type":993,"tag":1026,"props":3459,"children":3460},{"style":1047},[3461],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3463,"children":3464},{"style":1041},[3465],{"type":998,"value":3466}," list1 ",{"type":993,"tag":1026,"props":3468,"children":3469},{"style":1047},[3470],{"type":998,"value":3200},{"type":993,"tag":1026,"props":3472,"children":3473},{"style":1041},[3474],{"type":998,"value":3475}," list2\n",{"type":993,"tag":1026,"props":3477,"children":3478},{"class":1028,"line":54},[3479,3483,3487,3492],{"type":993,"tag":1026,"props":3480,"children":3481},{"style":1082},[3482],{"type":998,"value":1085},{"type":993,"tag":1026,"props":3484,"children":3485},{"style":1041},[3486],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3488,"children":3489},{"style":1058},[3490],{"type":998,"value":3491},"\"Original list1:\"",{"type":993,"tag":1026,"props":3493,"children":3494},{"style":1041},[3495],{"type":998,"value":3496},", list1)\n",{"type":993,"tag":1026,"props":3498,"children":3499},{"class":1028,"line":63},[3500,3504,3508,3513],{"type":993,"tag":1026,"props":3501,"children":3502},{"style":1082},[3503],{"type":998,"value":1085},{"type":993,"tag":1026,"props":3505,"children":3506},{"style":1041},[3507],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3509,"children":3510},{"style":1058},[3511],{"type":998,"value":3512},"\"Original list2:\"",{"type":993,"tag":1026,"props":3514,"children":3515},{"style":1041},[3516],{"type":998,"value":3517},", list2)\n",{"type":993,"tag":1026,"props":3519,"children":3520},{"class":1028,"line":72},[3521,3525,3529,3534],{"type":993,"tag":1026,"props":3522,"children":3523},{"style":1082},[3524],{"type":998,"value":1085},{"type":993,"tag":1026,"props":3526,"children":3527},{"style":1041},[3528],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3530,"children":3531},{"style":1058},[3532],{"type":998,"value":3533},"\"Combined (new list):\"",{"type":993,"tag":1026,"props":3535,"children":3536},{"style":1041},[3537],{"type":998,"value":3538},", combined)\n",{"type":993,"tag":1026,"props":3540,"children":3541},{"class":1028,"line":81},[3542],{"type":993,"tag":1026,"props":3543,"children":3544},{"emptyLinePlaceholder":13},[3545],{"type":998,"value":1108},{"type":993,"tag":1026,"props":3547,"children":3548},{"class":1028,"line":91},[3549],{"type":993,"tag":1026,"props":3550,"children":3551},{"style":1032},[3552],{"type":998,"value":3553},"# Using += operator (modifies original)\n",{"type":993,"tag":1026,"props":3555,"children":3556},{"class":1028,"line":100},[3557,3561,3565,3569,3573,3577,3581,3585,3589],{"type":993,"tag":1026,"props":3558,"children":3559},{"style":1041},[3560],{"type":998,"value":3375},{"type":993,"tag":1026,"props":3562,"children":3563},{"style":1047},[3564],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3566,"children":3567},{"style":1041},[3568],{"type":998,"value":1055},{"type":993,"tag":1026,"props":3570,"children":3571},{"style":1082},[3572],{"type":998,"value":1244},{"type":993,"tag":1026,"props":3574,"children":3575},{"style":1041},[3576],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3578,"children":3579},{"style":1082},[3580],{"type":998,"value":1659},{"type":993,"tag":1026,"props":3582,"children":3583},{"style":1041},[3584],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3586,"children":3587},{"style":1082},[3588],{"type":998,"value":1668},{"type":993,"tag":1026,"props":3590,"children":3591},{"style":1041},[3592],{"type":998,"value":1076},{"type":993,"tag":1026,"props":3594,"children":3595},{"class":1028,"line":109},[3596,3600,3604,3608,3612,3616,3620,3624,3628],{"type":993,"tag":1026,"props":3597,"children":3598},{"style":1041},[3599],{"type":998,"value":3415},{"type":993,"tag":1026,"props":3601,"children":3602},{"style":1047},[3603],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3605,"children":3606},{"style":1041},[3607],{"type":998,"value":1055},{"type":993,"tag":1026,"props":3609,"children":3610},{"style":1082},[3611],{"type":998,"value":3428},{"type":993,"tag":1026,"props":3613,"children":3614},{"style":1041},[3615],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3617,"children":3618},{"style":1082},[3619],{"type":998,"value":3437},{"type":993,"tag":1026,"props":3621,"children":3622},{"style":1041},[3623],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3625,"children":3626},{"style":1082},[3627],{"type":998,"value":1764},{"type":993,"tag":1026,"props":3629,"children":3630},{"style":1041},[3631],{"type":998,"value":1076},{"type":993,"tag":1026,"props":3633,"children":3634},{"class":1028,"line":118},[3635,3639,3643,3648],{"type":993,"tag":1026,"props":3636,"children":3637},{"style":1082},[3638],{"type":998,"value":1085},{"type":993,"tag":1026,"props":3640,"children":3641},{"style":1041},[3642],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3644,"children":3645},{"style":1058},[3646],{"type":998,"value":3647},"\"Before +=:\"",{"type":993,"tag":1026,"props":3649,"children":3650},{"style":1041},[3651],{"type":998,"value":3496},{"type":993,"tag":1026,"props":3653,"children":3654},{"class":1028,"line":127},[3655,3659,3663],{"type":993,"tag":1026,"props":3656,"children":3657},{"style":1041},[3658],{"type":998,"value":3375},{"type":993,"tag":1026,"props":3660,"children":3661},{"style":1047},[3662],{"type":998,"value":3208},{"type":993,"tag":1026,"props":3664,"children":3665},{"style":1041},[3666],{"type":998,"value":3475},{"type":993,"tag":1026,"props":3668,"children":3669},{"class":1028,"line":136},[3670,3674,3678,3683],{"type":993,"tag":1026,"props":3671,"children":3672},{"style":1082},[3673],{"type":998,"value":1085},{"type":993,"tag":1026,"props":3675,"children":3676},{"style":1041},[3677],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3679,"children":3680},{"style":1058},[3681],{"type":998,"value":3682},"\"After +=:\"",{"type":993,"tag":1026,"props":3684,"children":3685},{"style":1041},[3686],{"type":998,"value":3496},{"type":993,"tag":1026,"props":3688,"children":3689},{"class":1028,"line":146},[3690],{"type":993,"tag":1026,"props":3691,"children":3692},{"emptyLinePlaceholder":13},[3693],{"type":998,"value":1108},{"type":993,"tag":1026,"props":3695,"children":3696},{"class":1028,"line":155},[3697],{"type":993,"tag":1026,"props":3698,"children":3699},{"style":1032},[3700],{"type":998,"value":3701},"# Concatenating multiple lists\n",{"type":993,"tag":1026,"props":3703,"children":3704},{"class":1028,"line":164},[3705,3710,3714,3718,3722,3726,3730],{"type":993,"tag":1026,"props":3706,"children":3707},{"style":1041},[3708],{"type":998,"value":3709},"part1 ",{"type":993,"tag":1026,"props":3711,"children":3712},{"style":1047},[3713],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3715,"children":3716},{"style":1041},[3717],{"type":998,"value":1055},{"type":993,"tag":1026,"props":3719,"children":3720},{"style":1058},[3721],{"type":998,"value":3031},{"type":993,"tag":1026,"props":3723,"children":3724},{"style":1041},[3725],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3727,"children":3728},{"style":1058},[3729],{"type":998,"value":3040},{"type":993,"tag":1026,"props":3731,"children":3732},{"style":1041},[3733],{"type":998,"value":1076},{"type":993,"tag":1026,"props":3735,"children":3736},{"class":1028,"line":173},[3737,3742,3746,3750,3755,3759,3764],{"type":993,"tag":1026,"props":3738,"children":3739},{"style":1041},[3740],{"type":998,"value":3741},"part2 ",{"type":993,"tag":1026,"props":3743,"children":3744},{"style":1047},[3745],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3747,"children":3748},{"style":1041},[3749],{"type":998,"value":1055},{"type":993,"tag":1026,"props":3751,"children":3752},{"style":1058},[3753],{"type":998,"value":3754},"\"c\"",{"type":993,"tag":1026,"props":3756,"children":3757},{"style":1041},[3758],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3760,"children":3761},{"style":1058},[3762],{"type":998,"value":3763},"\"d\"",{"type":993,"tag":1026,"props":3765,"children":3766},{"style":1041},[3767],{"type":998,"value":1076},{"type":993,"tag":1026,"props":3769,"children":3770},{"class":1028,"line":182},[3771,3776,3780,3784,3789,3793,3798],{"type":993,"tag":1026,"props":3772,"children":3773},{"style":1041},[3774],{"type":998,"value":3775},"part3 ",{"type":993,"tag":1026,"props":3777,"children":3778},{"style":1047},[3779],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3781,"children":3782},{"style":1041},[3783],{"type":998,"value":1055},{"type":993,"tag":1026,"props":3785,"children":3786},{"style":1058},[3787],{"type":998,"value":3788},"\"e\"",{"type":993,"tag":1026,"props":3790,"children":3791},{"style":1041},[3792],{"type":998,"value":1066},{"type":993,"tag":1026,"props":3794,"children":3795},{"style":1058},[3796],{"type":998,"value":3797},"\"f\"",{"type":993,"tag":1026,"props":3799,"children":3800},{"style":1041},[3801],{"type":998,"value":1076},{"type":993,"tag":1026,"props":3803,"children":3804},{"class":1028,"line":191},[3805,3810,3814,3819,3823,3828,3832],{"type":993,"tag":1026,"props":3806,"children":3807},{"style":1041},[3808],{"type":998,"value":3809},"all_parts ",{"type":993,"tag":1026,"props":3811,"children":3812},{"style":1047},[3813],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3815,"children":3816},{"style":1041},[3817],{"type":998,"value":3818}," part1 ",{"type":993,"tag":1026,"props":3820,"children":3821},{"style":1047},[3822],{"type":998,"value":3200},{"type":993,"tag":1026,"props":3824,"children":3825},{"style":1041},[3826],{"type":998,"value":3827}," part2 ",{"type":993,"tag":1026,"props":3829,"children":3830},{"style":1047},[3831],{"type":998,"value":3200},{"type":993,"tag":1026,"props":3833,"children":3834},{"style":1041},[3835],{"type":998,"value":3836}," part3\n",{"type":993,"tag":1026,"props":3838,"children":3839},{"class":1028,"line":201},[3840,3844,3848,3853],{"type":993,"tag":1026,"props":3841,"children":3842},{"style":1082},[3843],{"type":998,"value":1085},{"type":993,"tag":1026,"props":3845,"children":3846},{"style":1041},[3847],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3849,"children":3850},{"style":1058},[3851],{"type":998,"value":3852},"\"All parts:\"",{"type":993,"tag":1026,"props":3854,"children":3855},{"style":1041},[3856],{"type":998,"value":3857},", all_parts)\n",{"type":993,"tag":1026,"props":3859,"children":3860},{"class":1028,"line":210},[3861],{"type":993,"tag":1026,"props":3862,"children":3863},{"emptyLinePlaceholder":13},[3864],{"type":998,"value":1108},{"type":993,"tag":1026,"props":3866,"children":3867},{"class":1028,"line":219},[3868],{"type":993,"tag":1026,"props":3869,"children":3870},{"style":1032},[3871],{"type":998,"value":3872},"# Building list with concatenation\n",{"type":993,"tag":1026,"props":3874,"children":3875},{"class":1028,"line":228},[3876,3881,3885],{"type":993,"tag":1026,"props":3877,"children":3878},{"style":1041},[3879],{"type":998,"value":3880},"result ",{"type":993,"tag":1026,"props":3882,"children":3883},{"style":1047},[3884],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3886,"children":3887},{"style":1041},[3888],{"type":998,"value":1453},{"type":993,"tag":1026,"props":3890,"children":3891},{"class":1028,"line":238},[3892,3896,3900,3904,3908,3912,3916],{"type":993,"tag":1026,"props":3893,"children":3894},{"style":1047},[3895],{"type":998,"value":1732},{"type":993,"tag":1026,"props":3897,"children":3898},{"style":1041},[3899],{"type":998,"value":1737},{"type":993,"tag":1026,"props":3901,"children":3902},{"style":1047},[3903],{"type":998,"value":1742},{"type":993,"tag":1026,"props":3905,"children":3906},{"style":1082},[3907],{"type":998,"value":1747},{"type":993,"tag":1026,"props":3909,"children":3910},{"style":1041},[3911],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3913,"children":3914},{"style":1082},[3915],{"type":998,"value":1668},{"type":993,"tag":1026,"props":3917,"children":3918},{"style":1041},[3919],{"type":998,"value":1769},{"type":993,"tag":1026,"props":3921,"children":3922},{"class":1028,"line":247},[3923,3928,3932,3937,3942,3946],{"type":993,"tag":1026,"props":3924,"children":3925},{"style":1041},[3926],{"type":998,"value":3927},"    new_items ",{"type":993,"tag":1026,"props":3929,"children":3930},{"style":1047},[3931],{"type":998,"value":1050},{"type":993,"tag":1026,"props":3933,"children":3934},{"style":1041},[3935],{"type":998,"value":3936}," [i, i",{"type":993,"tag":1026,"props":3938,"children":3939},{"style":1047},[3940],{"type":998,"value":3941},"*",{"type":993,"tag":1026,"props":3943,"children":3944},{"style":1082},[3945],{"type":998,"value":1659},{"type":993,"tag":1026,"props":3947,"children":3948},{"style":1041},[3949],{"type":998,"value":1076},{"type":993,"tag":1026,"props":3951,"children":3952},{"class":1028,"line":256},[3953,3958,3962,3967],{"type":993,"tag":1026,"props":3954,"children":3955},{"style":1041},[3956],{"type":998,"value":3957},"    result ",{"type":993,"tag":1026,"props":3959,"children":3960},{"style":1047},[3961],{"type":998,"value":3208},{"type":993,"tag":1026,"props":3963,"children":3964},{"style":1041},[3965],{"type":998,"value":3966}," new_items  ",{"type":993,"tag":1026,"props":3968,"children":3969},{"style":1032},[3970],{"type":998,"value":3971},"# Same as result.extend(new_items)\n",{"type":993,"tag":1026,"props":3973,"children":3974},{"class":1028,"line":265},[3975,3979,3983,3988],{"type":993,"tag":1026,"props":3976,"children":3977},{"style":1082},[3978],{"type":998,"value":1085},{"type":993,"tag":1026,"props":3980,"children":3981},{"style":1041},[3982],{"type":998,"value":1090},{"type":993,"tag":1026,"props":3984,"children":3985},{"style":1058},[3986],{"type":998,"value":3987},"\"Built with +=:\"",{"type":993,"tag":1026,"props":3989,"children":3990},{"style":1041},[3991],{"type":998,"value":3992},", result)\n",{"type":993,"tag":1279,"props":3994,"children":3996},{"id":3995},"advanced-adding-techniques",[3997],{"type":998,"value":3998},"Advanced Adding Techniques",{"type":993,"tag":1001,"props":4000,"children":4001},{},[4002],{"type":998,"value":4003},"Beyond basic methods, Python offers advanced techniques for adding elements based on conditions, positions, and complex logic.",{"type":993,"tag":1408,"props":4005,"children":4007},{"id":4006},"advanced-examples",[4008],{"type":998,"value":4009},"Advanced Examples",{"type":993,"tag":1001,"props":4011,"children":4012},{},[4013],{"type":998,"value":4014},"Sophisticated element addition for complex scenarios:",{"type":993,"tag":1012,"props":4016,"children":4017},{},[4018],{"type":993,"tag":1016,"props":4019,"children":4021},{"className":1018,"code":4020,"language":6,"meta":8,"style":8},"# Conditional adding\nnumbers = [1, 3, 5]\nprint(\"Original numbers:\", numbers)\n\n# 10 Add even numbers up to\nfor i in range(2, 11, 2):\n    numbers.append(i)\nprint(\"After adding evens:\", numbers)\n\n# Smart insertion to maintain order\nsorted_list = [1, 3, 7, 9]\nnew_value = 5\n\n# Find correct position and insert\ninsert_position = 0\nfor i, value in enumerate(sorted_list):\n    if new_value \u003C= value:\n        insert_position = i\n        break\n    insert_position = i + 1\n\nsorted_list.insert(insert_position, new_value)\nprint(\"Maintained sorted order:\", sorted_list)\n\n# Building complex structures\nstudents = []\n# Add student records as lists\nstudents.append([\"Alice\", 20, [85, 92, 78]])\nstudents.append([\"Bob\", 19, [90, 88, 95]])\nprint(\"Student records:\", students)\n\n# Add grade to existing student\nstudents[0][2].append(88)  # Add grade to Alice\nprint(\"After adding grade:\", students)\n",[4022],{"type":993,"tag":1022,"props":4023,"children":4024},{"__ignoreMap":8},[4025,4033,4072,4092,4099,4107,4155,4163,4183,4190,4198,4248,4265,4272,4280,4297,4323,4345,4362,4370,4395,4402,4410,4431,4438,4446,4462,4470,4521,4571,4592,4599,4607,4647],{"type":993,"tag":1026,"props":4026,"children":4027},{"class":1028,"line":12},[4028],{"type":993,"tag":1026,"props":4029,"children":4030},{"style":1032},[4031],{"type":998,"value":4032},"# Conditional adding\n",{"type":993,"tag":1026,"props":4034,"children":4035},{"class":1028,"line":27},[4036,4040,4044,4048,4052,4056,4060,4064,4068],{"type":993,"tag":1026,"props":4037,"children":4038},{"style":1041},[4039],{"type":998,"value":3105},{"type":993,"tag":1026,"props":4041,"children":4042},{"style":1047},[4043],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4045,"children":4046},{"style":1041},[4047],{"type":998,"value":1055},{"type":993,"tag":1026,"props":4049,"children":4050},{"style":1082},[4051],{"type":998,"value":1244},{"type":993,"tag":1026,"props":4053,"children":4054},{"style":1041},[4055],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4057,"children":4058},{"style":1082},[4059],{"type":998,"value":1668},{"type":993,"tag":1026,"props":4061,"children":4062},{"style":1041},[4063],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4065,"children":4066},{"style":1082},[4067],{"type":998,"value":3437},{"type":993,"tag":1026,"props":4069,"children":4070},{"style":1041},[4071],{"type":998,"value":1076},{"type":993,"tag":1026,"props":4073,"children":4074},{"class":1028,"line":36},[4075,4079,4083,4088],{"type":993,"tag":1026,"props":4076,"children":4077},{"style":1082},[4078],{"type":998,"value":1085},{"type":993,"tag":1026,"props":4080,"children":4081},{"style":1041},[4082],{"type":998,"value":1090},{"type":993,"tag":1026,"props":4084,"children":4085},{"style":1058},[4086],{"type":998,"value":4087},"\"Original numbers:\"",{"type":993,"tag":1026,"props":4089,"children":4090},{"style":1041},[4091],{"type":998,"value":3183},{"type":993,"tag":1026,"props":4093,"children":4094},{"class":1028,"line":45},[4095],{"type":993,"tag":1026,"props":4096,"children":4097},{"emptyLinePlaceholder":13},[4098],{"type":998,"value":1108},{"type":993,"tag":1026,"props":4100,"children":4101},{"class":1028,"line":54},[4102],{"type":993,"tag":1026,"props":4103,"children":4104},{"style":1032},[4105],{"type":998,"value":4106},"# 10 Add even numbers up to\n",{"type":993,"tag":1026,"props":4108,"children":4109},{"class":1028,"line":63},[4110,4114,4118,4122,4126,4130,4134,4138,4143,4147,4151],{"type":993,"tag":1026,"props":4111,"children":4112},{"style":1047},[4113],{"type":998,"value":1732},{"type":993,"tag":1026,"props":4115,"children":4116},{"style":1041},[4117],{"type":998,"value":1737},{"type":993,"tag":1026,"props":4119,"children":4120},{"style":1047},[4121],{"type":998,"value":1742},{"type":993,"tag":1026,"props":4123,"children":4124},{"style":1082},[4125],{"type":998,"value":1747},{"type":993,"tag":1026,"props":4127,"children":4128},{"style":1041},[4129],{"type":998,"value":1090},{"type":993,"tag":1026,"props":4131,"children":4132},{"style":1082},[4133],{"type":998,"value":1659},{"type":993,"tag":1026,"props":4135,"children":4136},{"style":1041},[4137],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4139,"children":4140},{"style":1082},[4141],{"type":998,"value":4142},"11",{"type":993,"tag":1026,"props":4144,"children":4145},{"style":1041},[4146],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4148,"children":4149},{"style":1082},[4150],{"type":998,"value":1659},{"type":993,"tag":1026,"props":4152,"children":4153},{"style":1041},[4154],{"type":998,"value":1769},{"type":993,"tag":1026,"props":4156,"children":4157},{"class":1028,"line":72},[4158],{"type":993,"tag":1026,"props":4159,"children":4160},{"style":1041},[4161],{"type":998,"value":4162},"    numbers.append(i)\n",{"type":993,"tag":1026,"props":4164,"children":4165},{"class":1028,"line":81},[4166,4170,4174,4179],{"type":993,"tag":1026,"props":4167,"children":4168},{"style":1082},[4169],{"type":998,"value":1085},{"type":993,"tag":1026,"props":4171,"children":4172},{"style":1041},[4173],{"type":998,"value":1090},{"type":993,"tag":1026,"props":4175,"children":4176},{"style":1058},[4177],{"type":998,"value":4178},"\"After adding evens:\"",{"type":993,"tag":1026,"props":4180,"children":4181},{"style":1041},[4182],{"type":998,"value":3183},{"type":993,"tag":1026,"props":4184,"children":4185},{"class":1028,"line":91},[4186],{"type":993,"tag":1026,"props":4187,"children":4188},{"emptyLinePlaceholder":13},[4189],{"type":998,"value":1108},{"type":993,"tag":1026,"props":4191,"children":4192},{"class":1028,"line":100},[4193],{"type":993,"tag":1026,"props":4194,"children":4195},{"style":1032},[4196],{"type":998,"value":4197},"# Smart insertion to maintain order\n",{"type":993,"tag":1026,"props":4199,"children":4200},{"class":1028,"line":109},[4201,4206,4210,4214,4218,4222,4226,4230,4235,4239,4244],{"type":993,"tag":1026,"props":4202,"children":4203},{"style":1041},[4204],{"type":998,"value":4205},"sorted_list ",{"type":993,"tag":1026,"props":4207,"children":4208},{"style":1047},[4209],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4211,"children":4212},{"style":1041},[4213],{"type":998,"value":1055},{"type":993,"tag":1026,"props":4215,"children":4216},{"style":1082},[4217],{"type":998,"value":1244},{"type":993,"tag":1026,"props":4219,"children":4220},{"style":1041},[4221],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4223,"children":4224},{"style":1082},[4225],{"type":998,"value":1668},{"type":993,"tag":1026,"props":4227,"children":4228},{"style":1041},[4229],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4231,"children":4232},{"style":1082},[4233],{"type":998,"value":4234},"7",{"type":993,"tag":1026,"props":4236,"children":4237},{"style":1041},[4238],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4240,"children":4241},{"style":1082},[4242],{"type":998,"value":4243},"9",{"type":993,"tag":1026,"props":4245,"children":4246},{"style":1041},[4247],{"type":998,"value":1076},{"type":993,"tag":1026,"props":4249,"children":4250},{"class":1028,"line":118},[4251,4256,4260],{"type":993,"tag":1026,"props":4252,"children":4253},{"style":1041},[4254],{"type":998,"value":4255},"new_value ",{"type":993,"tag":1026,"props":4257,"children":4258},{"style":1047},[4259],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4261,"children":4262},{"style":1082},[4263],{"type":998,"value":4264}," 5\n",{"type":993,"tag":1026,"props":4266,"children":4267},{"class":1028,"line":127},[4268],{"type":993,"tag":1026,"props":4269,"children":4270},{"emptyLinePlaceholder":13},[4271],{"type":998,"value":1108},{"type":993,"tag":1026,"props":4273,"children":4274},{"class":1028,"line":136},[4275],{"type":993,"tag":1026,"props":4276,"children":4277},{"style":1032},[4278],{"type":998,"value":4279},"# Find correct position and insert\n",{"type":993,"tag":1026,"props":4281,"children":4282},{"class":1028,"line":146},[4283,4288,4292],{"type":993,"tag":1026,"props":4284,"children":4285},{"style":1041},[4286],{"type":998,"value":4287},"insert_position ",{"type":993,"tag":1026,"props":4289,"children":4290},{"style":1047},[4291],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4293,"children":4294},{"style":1082},[4295],{"type":998,"value":4296}," 0\n",{"type":993,"tag":1026,"props":4298,"children":4299},{"class":1028,"line":155},[4300,4304,4309,4313,4318],{"type":993,"tag":1026,"props":4301,"children":4302},{"style":1047},[4303],{"type":998,"value":1732},{"type":993,"tag":1026,"props":4305,"children":4306},{"style":1041},[4307],{"type":998,"value":4308}," i, value ",{"type":993,"tag":1026,"props":4310,"children":4311},{"style":1047},[4312],{"type":998,"value":1742},{"type":993,"tag":1026,"props":4314,"children":4315},{"style":1082},[4316],{"type":998,"value":4317}," enumerate",{"type":993,"tag":1026,"props":4319,"children":4320},{"style":1041},[4321],{"type":998,"value":4322},"(sorted_list):\n",{"type":993,"tag":1026,"props":4324,"children":4325},{"class":1028,"line":164},[4326,4330,4335,4340],{"type":993,"tag":1026,"props":4327,"children":4328},{"style":1047},[4329],{"type":998,"value":2518},{"type":993,"tag":1026,"props":4331,"children":4332},{"style":1041},[4333],{"type":998,"value":4334}," new_value ",{"type":993,"tag":1026,"props":4336,"children":4337},{"style":1047},[4338],{"type":998,"value":4339},"\u003C=",{"type":993,"tag":1026,"props":4341,"children":4342},{"style":1041},[4343],{"type":998,"value":4344}," value:\n",{"type":993,"tag":1026,"props":4346,"children":4347},{"class":1028,"line":173},[4348,4353,4357],{"type":993,"tag":1026,"props":4349,"children":4350},{"style":1041},[4351],{"type":998,"value":4352},"        insert_position ",{"type":993,"tag":1026,"props":4354,"children":4355},{"style":1047},[4356],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4358,"children":4359},{"style":1041},[4360],{"type":998,"value":4361}," i\n",{"type":993,"tag":1026,"props":4363,"children":4364},{"class":1028,"line":182},[4365],{"type":993,"tag":1026,"props":4366,"children":4367},{"style":1047},[4368],{"type":998,"value":4369},"        break\n",{"type":993,"tag":1026,"props":4371,"children":4372},{"class":1028,"line":191},[4373,4378,4382,4386,4390],{"type":993,"tag":1026,"props":4374,"children":4375},{"style":1041},[4376],{"type":998,"value":4377},"    insert_position ",{"type":993,"tag":1026,"props":4379,"children":4380},{"style":1047},[4381],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4383,"children":4384},{"style":1041},[4385],{"type":998,"value":1737},{"type":993,"tag":1026,"props":4387,"children":4388},{"style":1047},[4389],{"type":998,"value":3200},{"type":993,"tag":1026,"props":4391,"children":4392},{"style":1082},[4393],{"type":998,"value":4394}," 1\n",{"type":993,"tag":1026,"props":4396,"children":4397},{"class":1028,"line":201},[4398],{"type":993,"tag":1026,"props":4399,"children":4400},{"emptyLinePlaceholder":13},[4401],{"type":998,"value":1108},{"type":993,"tag":1026,"props":4403,"children":4404},{"class":1028,"line":210},[4405],{"type":993,"tag":1026,"props":4406,"children":4407},{"style":1041},[4408],{"type":998,"value":4409},"sorted_list.insert(insert_position, new_value)\n",{"type":993,"tag":1026,"props":4411,"children":4412},{"class":1028,"line":219},[4413,4417,4421,4426],{"type":993,"tag":1026,"props":4414,"children":4415},{"style":1082},[4416],{"type":998,"value":1085},{"type":993,"tag":1026,"props":4418,"children":4419},{"style":1041},[4420],{"type":998,"value":1090},{"type":993,"tag":1026,"props":4422,"children":4423},{"style":1058},[4424],{"type":998,"value":4425},"\"Maintained sorted order:\"",{"type":993,"tag":1026,"props":4427,"children":4428},{"style":1041},[4429],{"type":998,"value":4430},", sorted_list)\n",{"type":993,"tag":1026,"props":4432,"children":4433},{"class":1028,"line":228},[4434],{"type":993,"tag":1026,"props":4435,"children":4436},{"emptyLinePlaceholder":13},[4437],{"type":998,"value":1108},{"type":993,"tag":1026,"props":4439,"children":4440},{"class":1028,"line":238},[4441],{"type":993,"tag":1026,"props":4442,"children":4443},{"style":1032},[4444],{"type":998,"value":4445},"# Building complex structures\n",{"type":993,"tag":1026,"props":4447,"children":4448},{"class":1028,"line":247},[4449,4454,4458],{"type":993,"tag":1026,"props":4450,"children":4451},{"style":1041},[4452],{"type":998,"value":4453},"students ",{"type":993,"tag":1026,"props":4455,"children":4456},{"style":1047},[4457],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4459,"children":4460},{"style":1041},[4461],{"type":998,"value":1453},{"type":993,"tag":1026,"props":4463,"children":4464},{"class":1028,"line":256},[4465],{"type":993,"tag":1026,"props":4466,"children":4467},{"style":1032},[4468],{"type":998,"value":4469},"# Add student records as lists\n",{"type":993,"tag":1026,"props":4471,"children":4472},{"class":1028,"line":265},[4473,4478,4482,4486,4491,4496,4500,4504,4508,4512,4516],{"type":993,"tag":1026,"props":4474,"children":4475},{"style":1041},[4476],{"type":998,"value":4477},"students.append([",{"type":993,"tag":1026,"props":4479,"children":4480},{"style":1058},[4481],{"type":998,"value":1979},{"type":993,"tag":1026,"props":4483,"children":4484},{"style":1041},[4485],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4487,"children":4488},{"style":1082},[4489],{"type":998,"value":4490},"20",{"type":993,"tag":1026,"props":4492,"children":4493},{"style":1041},[4494],{"type":998,"value":4495},", [",{"type":993,"tag":1026,"props":4497,"children":4498},{"style":1082},[4499],{"type":998,"value":2329},{"type":993,"tag":1026,"props":4501,"children":4502},{"style":1041},[4503],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4505,"children":4506},{"style":1082},[4507],{"type":998,"value":2338},{"type":993,"tag":1026,"props":4509,"children":4510},{"style":1041},[4511],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4513,"children":4514},{"style":1082},[4515],{"type":998,"value":2347},{"type":993,"tag":1026,"props":4517,"children":4518},{"style":1041},[4519],{"type":998,"value":4520},"]])\n",{"type":993,"tag":1026,"props":4522,"children":4523},{"class":1028,"line":274},[4524,4528,4532,4536,4541,4545,4550,4554,4558,4562,4567],{"type":993,"tag":1026,"props":4525,"children":4526},{"style":1041},[4527],{"type":998,"value":4477},{"type":993,"tag":1026,"props":4529,"children":4530},{"style":1058},[4531],{"type":998,"value":2118},{"type":993,"tag":1026,"props":4533,"children":4534},{"style":1041},[4535],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4537,"children":4538},{"style":1082},[4539],{"type":998,"value":4540},"19",{"type":993,"tag":1026,"props":4542,"children":4543},{"style":1041},[4544],{"type":998,"value":4495},{"type":993,"tag":1026,"props":4546,"children":4547},{"style":1082},[4548],{"type":998,"value":4549},"90",{"type":993,"tag":1026,"props":4551,"children":4552},{"style":1041},[4553],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4555,"children":4556},{"style":1082},[4557],{"type":998,"value":2365},{"type":993,"tag":1026,"props":4559,"children":4560},{"style":1041},[4561],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4563,"children":4564},{"style":1082},[4565],{"type":998,"value":4566},"95",{"type":993,"tag":1026,"props":4568,"children":4569},{"style":1041},[4570],{"type":998,"value":4520},{"type":993,"tag":1026,"props":4572,"children":4573},{"class":1028,"line":284},[4574,4578,4582,4587],{"type":993,"tag":1026,"props":4575,"children":4576},{"style":1082},[4577],{"type":998,"value":1085},{"type":993,"tag":1026,"props":4579,"children":4580},{"style":1041},[4581],{"type":998,"value":1090},{"type":993,"tag":1026,"props":4583,"children":4584},{"style":1058},[4585],{"type":998,"value":4586},"\"Student records:\"",{"type":993,"tag":1026,"props":4588,"children":4589},{"style":1041},[4590],{"type":998,"value":4591},", students)\n",{"type":993,"tag":1026,"props":4593,"children":4594},{"class":1028,"line":293},[4595],{"type":993,"tag":1026,"props":4596,"children":4597},{"emptyLinePlaceholder":13},[4598],{"type":998,"value":1108},{"type":993,"tag":1026,"props":4600,"children":4601},{"class":1028,"line":302},[4602],{"type":993,"tag":1026,"props":4603,"children":4604},{"style":1032},[4605],{"type":998,"value":4606},"# Add grade to existing student\n",{"type":993,"tag":1026,"props":4608,"children":4609},{"class":1028,"line":311},[4610,4615,4619,4624,4628,4633,4637,4642],{"type":993,"tag":1026,"props":4611,"children":4612},{"style":1041},[4613],{"type":998,"value":4614},"students[",{"type":993,"tag":1026,"props":4616,"children":4617},{"style":1082},[4618],{"type":998,"value":2050},{"type":993,"tag":1026,"props":4620,"children":4621},{"style":1041},[4622],{"type":998,"value":4623},"][",{"type":993,"tag":1026,"props":4625,"children":4626},{"style":1082},[4627],{"type":998,"value":1659},{"type":993,"tag":1026,"props":4629,"children":4630},{"style":1041},[4631],{"type":998,"value":4632},"].append(",{"type":993,"tag":1026,"props":4634,"children":4635},{"style":1082},[4636],{"type":998,"value":2365},{"type":993,"tag":1026,"props":4638,"children":4639},{"style":1041},[4640],{"type":998,"value":4641},")  ",{"type":993,"tag":1026,"props":4643,"children":4644},{"style":1032},[4645],{"type":998,"value":4646},"# Add grade to Alice\n",{"type":993,"tag":1026,"props":4648,"children":4649},{"class":1028,"line":320},[4650,4654,4658,4663],{"type":993,"tag":1026,"props":4651,"children":4652},{"style":1082},[4653],{"type":998,"value":1085},{"type":993,"tag":1026,"props":4655,"children":4656},{"style":1041},[4657],{"type":998,"value":1090},{"type":993,"tag":1026,"props":4659,"children":4660},{"style":1058},[4661],{"type":998,"value":4662},"\"After adding grade:\"",{"type":993,"tag":1026,"props":4664,"children":4665},{"style":1041},[4666],{"type":998,"value":4591},{"type":993,"tag":1279,"props":4668,"children":4670},{"id":4669},"common-adding-patterns",[4671],{"type":998,"value":4672},"Common Adding Patterns",{"type":993,"tag":1001,"props":4674,"children":4675},{},[4676],{"type":998,"value":4677},"Several patterns appear frequently when adding elements to lists in real-world programming. Understanding these patterns helps you choose the right approach.",{"type":993,"tag":1408,"props":4679,"children":4681},{"id":4680},"practical-patterns",[4682],{"type":998,"value":4683},"Practical Patterns",{"type":993,"tag":1001,"props":4685,"children":4686},{},[4687],{"type":998,"value":4688},"Real-world examples of list building techniques:",{"type":993,"tag":1012,"props":4690,"children":4691},{},[4692],{"type":993,"tag":1016,"props":4693,"children":4695},{"className":1018,"code":4694,"language":6,"meta":8,"style":8},"# Pattern 1: Accumulating results\nresults = []\nfor i in range(1, 6):\n    result = i ** 2 + i\n    results.append(result)\nprint(\"Accumulated results:\", results)\n\n# Pattern 2: Collecting valid data\nvalid_scores = []\nall_scores = [85, -5, 92, 101, 78, 150, 88]\nfor score in all_scores:\n    if 0 \u003C= score \u003C= 100:\n        valid_scores.append(score)\nprint(\"Valid scores:\", valid_scores)\n\n# Pattern 3: Building from user input (simulated)\nshopping_list = []\nitems_to_add = [\"milk\", \"bread\", \"eggs\", \"cheese\"]\nfor item in items_to_add:\n    if item not in shopping_list:  # Avoid duplicates\n        shopping_list.append(item)\nprint(\"Unique shopping list:\", shopping_list)\n\n# Pattern 4: Merging data sources\nall_data = []\nsource1 = [1, 2, 3]\nsource2 = [4, 5, 6]\nsource3 = [7, 8, 9]\n\nall_data.extend(source1)\nall_data.extend(source2)\nall_data.extend(source3)\nprint(\"Merged data:\", all_data)\n\n# Pattern 5: Building nested structures\nmatrix = []\nfor row in range(3):\n    matrix.append([])  # Add empty row\n    for col in range(3):\n        matrix[row].append(row * 3 + col + 1)\nprint(\"Built matrix:\", matrix)\n",[4696],{"type":993,"tag":1022,"props":4697,"children":4698},{"__ignoreMap":8},[4699,4707,4723,4762,4794,4802,4823,4830,4838,4854,4933,4953,4988,4996,5017,5024,5032,5048,5097,5118,5149,5157,5178,5185,5193,5209,5249,5289,5330,5337,5345,5353,5361,5382,5389,5397,5413,5445,5458,5490,5528],{"type":993,"tag":1026,"props":4700,"children":4701},{"class":1028,"line":12},[4702],{"type":993,"tag":1026,"props":4703,"children":4704},{"style":1032},[4705],{"type":998,"value":4706},"# Pattern 1: Accumulating results\n",{"type":993,"tag":1026,"props":4708,"children":4709},{"class":1028,"line":27},[4710,4715,4719],{"type":993,"tag":1026,"props":4711,"children":4712},{"style":1041},[4713],{"type":998,"value":4714},"results ",{"type":993,"tag":1026,"props":4716,"children":4717},{"style":1047},[4718],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4720,"children":4721},{"style":1041},[4722],{"type":998,"value":1453},{"type":993,"tag":1026,"props":4724,"children":4725},{"class":1028,"line":36},[4726,4730,4734,4738,4742,4746,4750,4754,4758],{"type":993,"tag":1026,"props":4727,"children":4728},{"style":1047},[4729],{"type":998,"value":1732},{"type":993,"tag":1026,"props":4731,"children":4732},{"style":1041},[4733],{"type":998,"value":1737},{"type":993,"tag":1026,"props":4735,"children":4736},{"style":1047},[4737],{"type":998,"value":1742},{"type":993,"tag":1026,"props":4739,"children":4740},{"style":1082},[4741],{"type":998,"value":1747},{"type":993,"tag":1026,"props":4743,"children":4744},{"style":1041},[4745],{"type":998,"value":1090},{"type":993,"tag":1026,"props":4747,"children":4748},{"style":1082},[4749],{"type":998,"value":1244},{"type":993,"tag":1026,"props":4751,"children":4752},{"style":1041},[4753],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4755,"children":4756},{"style":1082},[4757],{"type":998,"value":1764},{"type":993,"tag":1026,"props":4759,"children":4760},{"style":1041},[4761],{"type":998,"value":1769},{"type":993,"tag":1026,"props":4763,"children":4764},{"class":1028,"line":45},[4765,4769,4773,4777,4781,4785,4790],{"type":993,"tag":1026,"props":4766,"children":4767},{"style":1041},[4768],{"type":998,"value":3957},{"type":993,"tag":1026,"props":4770,"children":4771},{"style":1047},[4772],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4774,"children":4775},{"style":1041},[4776],{"type":998,"value":1737},{"type":993,"tag":1026,"props":4778,"children":4779},{"style":1047},[4780],{"type":998,"value":1782},{"type":993,"tag":1026,"props":4782,"children":4783},{"style":1082},[4784],{"type":998,"value":1787},{"type":993,"tag":1026,"props":4786,"children":4787},{"style":1047},[4788],{"type":998,"value":4789}," +",{"type":993,"tag":1026,"props":4791,"children":4792},{"style":1041},[4793],{"type":998,"value":4361},{"type":993,"tag":1026,"props":4795,"children":4796},{"class":1028,"line":54},[4797],{"type":993,"tag":1026,"props":4798,"children":4799},{"style":1041},[4800],{"type":998,"value":4801},"    results.append(result)\n",{"type":993,"tag":1026,"props":4803,"children":4804},{"class":1028,"line":63},[4805,4809,4813,4818],{"type":993,"tag":1026,"props":4806,"children":4807},{"style":1082},[4808],{"type":998,"value":1085},{"type":993,"tag":1026,"props":4810,"children":4811},{"style":1041},[4812],{"type":998,"value":1090},{"type":993,"tag":1026,"props":4814,"children":4815},{"style":1058},[4816],{"type":998,"value":4817},"\"Accumulated results:\"",{"type":993,"tag":1026,"props":4819,"children":4820},{"style":1041},[4821],{"type":998,"value":4822},", results)\n",{"type":993,"tag":1026,"props":4824,"children":4825},{"class":1028,"line":72},[4826],{"type":993,"tag":1026,"props":4827,"children":4828},{"emptyLinePlaceholder":13},[4829],{"type":998,"value":1108},{"type":993,"tag":1026,"props":4831,"children":4832},{"class":1028,"line":81},[4833],{"type":993,"tag":1026,"props":4834,"children":4835},{"style":1032},[4836],{"type":998,"value":4837},"# Pattern 2: Collecting valid data\n",{"type":993,"tag":1026,"props":4839,"children":4840},{"class":1028,"line":91},[4841,4846,4850],{"type":993,"tag":1026,"props":4842,"children":4843},{"style":1041},[4844],{"type":998,"value":4845},"valid_scores ",{"type":993,"tag":1026,"props":4847,"children":4848},{"style":1047},[4849],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4851,"children":4852},{"style":1041},[4853],{"type":998,"value":1453},{"type":993,"tag":1026,"props":4855,"children":4856},{"class":1028,"line":100},[4857,4862,4866,4870,4874,4878,4883,4887,4891,4895,4899,4904,4908,4912,4916,4921,4925,4929],{"type":993,"tag":1026,"props":4858,"children":4859},{"style":1041},[4860],{"type":998,"value":4861},"all_scores ",{"type":993,"tag":1026,"props":4863,"children":4864},{"style":1047},[4865],{"type":998,"value":1050},{"type":993,"tag":1026,"props":4867,"children":4868},{"style":1041},[4869],{"type":998,"value":1055},{"type":993,"tag":1026,"props":4871,"children":4872},{"style":1082},[4873],{"type":998,"value":2329},{"type":993,"tag":1026,"props":4875,"children":4876},{"style":1041},[4877],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4879,"children":4880},{"style":1047},[4881],{"type":998,"value":4882},"-",{"type":993,"tag":1026,"props":4884,"children":4885},{"style":1082},[4886],{"type":998,"value":3437},{"type":993,"tag":1026,"props":4888,"children":4889},{"style":1041},[4890],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4892,"children":4893},{"style":1082},[4894],{"type":998,"value":2338},{"type":993,"tag":1026,"props":4896,"children":4897},{"style":1041},[4898],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4900,"children":4901},{"style":1082},[4902],{"type":998,"value":4903},"101",{"type":993,"tag":1026,"props":4905,"children":4906},{"style":1041},[4907],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4909,"children":4910},{"style":1082},[4911],{"type":998,"value":2347},{"type":993,"tag":1026,"props":4913,"children":4914},{"style":1041},[4915],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4917,"children":4918},{"style":1082},[4919],{"type":998,"value":4920},"150",{"type":993,"tag":1026,"props":4922,"children":4923},{"style":1041},[4924],{"type":998,"value":1066},{"type":993,"tag":1026,"props":4926,"children":4927},{"style":1082},[4928],{"type":998,"value":2365},{"type":993,"tag":1026,"props":4930,"children":4931},{"style":1041},[4932],{"type":998,"value":1076},{"type":993,"tag":1026,"props":4934,"children":4935},{"class":1028,"line":109},[4936,4940,4944,4948],{"type":993,"tag":1026,"props":4937,"children":4938},{"style":1047},[4939],{"type":998,"value":1732},{"type":993,"tag":1026,"props":4941,"children":4942},{"style":1041},[4943],{"type":998,"value":2388},{"type":993,"tag":1026,"props":4945,"children":4946},{"style":1047},[4947],{"type":998,"value":1742},{"type":993,"tag":1026,"props":4949,"children":4950},{"style":1041},[4951],{"type":998,"value":4952}," all_scores:\n",{"type":993,"tag":1026,"props":4954,"children":4955},{"class":1028,"line":118},[4956,4960,4965,4970,4974,4978,4983],{"type":993,"tag":1026,"props":4957,"children":4958},{"style":1047},[4959],{"type":998,"value":2518},{"type":993,"tag":1026,"props":4961,"children":4962},{"style":1082},[4963],{"type":998,"value":4964}," 0",{"type":993,"tag":1026,"props":4966,"children":4967},{"style":1047},[4968],{"type":998,"value":4969}," \u003C=",{"type":993,"tag":1026,"props":4971,"children":4972},{"style":1041},[4973],{"type":998,"value":2388},{"type":993,"tag":1026,"props":4975,"children":4976},{"style":1047},[4977],{"type":998,"value":4339},{"type":993,"tag":1026,"props":4979,"children":4980},{"style":1082},[4981],{"type":998,"value":4982}," 100",{"type":993,"tag":1026,"props":4984,"children":4985},{"style":1041},[4986],{"type":998,"value":4987},":\n",{"type":993,"tag":1026,"props":4989,"children":4990},{"class":1028,"line":127},[4991],{"type":993,"tag":1026,"props":4992,"children":4993},{"style":1041},[4994],{"type":998,"value":4995},"        valid_scores.append(score)\n",{"type":993,"tag":1026,"props":4997,"children":4998},{"class":1028,"line":136},[4999,5003,5007,5012],{"type":993,"tag":1026,"props":5000,"children":5001},{"style":1082},[5002],{"type":998,"value":1085},{"type":993,"tag":1026,"props":5004,"children":5005},{"style":1041},[5006],{"type":998,"value":1090},{"type":993,"tag":1026,"props":5008,"children":5009},{"style":1058},[5010],{"type":998,"value":5011},"\"Valid scores:\"",{"type":993,"tag":1026,"props":5013,"children":5014},{"style":1041},[5015],{"type":998,"value":5016},", valid_scores)\n",{"type":993,"tag":1026,"props":5018,"children":5019},{"class":1028,"line":146},[5020],{"type":993,"tag":1026,"props":5021,"children":5022},{"emptyLinePlaceholder":13},[5023],{"type":998,"value":1108},{"type":993,"tag":1026,"props":5025,"children":5026},{"class":1028,"line":155},[5027],{"type":993,"tag":1026,"props":5028,"children":5029},{"style":1032},[5030],{"type":998,"value":5031},"# Pattern 3: Building from user input (simulated)\n",{"type":993,"tag":1026,"props":5033,"children":5034},{"class":1028,"line":164},[5035,5040,5044],{"type":993,"tag":1026,"props":5036,"children":5037},{"style":1041},[5038],{"type":998,"value":5039},"shopping_list ",{"type":993,"tag":1026,"props":5041,"children":5042},{"style":1047},[5043],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5045,"children":5046},{"style":1041},[5047],{"type":998,"value":1453},{"type":993,"tag":1026,"props":5049,"children":5050},{"class":1028,"line":173},[5051,5056,5060,5064,5068,5072,5076,5080,5084,5088,5093],{"type":993,"tag":1026,"props":5052,"children":5053},{"style":1041},[5054],{"type":998,"value":5055},"items_to_add ",{"type":993,"tag":1026,"props":5057,"children":5058},{"style":1047},[5059],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5061,"children":5062},{"style":1041},[5063],{"type":998,"value":1055},{"type":993,"tag":1026,"props":5065,"children":5066},{"style":1058},[5067],{"type":998,"value":1518},{"type":993,"tag":1026,"props":5069,"children":5070},{"style":1041},[5071],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5073,"children":5074},{"style":1058},[5075],{"type":998,"value":1502},{"type":993,"tag":1026,"props":5077,"children":5078},{"style":1041},[5079],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5081,"children":5082},{"style":1058},[5083],{"type":998,"value":1534},{"type":993,"tag":1026,"props":5085,"children":5086},{"style":1041},[5087],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5089,"children":5090},{"style":1058},[5091],{"type":998,"value":5092},"\"cheese\"",{"type":993,"tag":1026,"props":5094,"children":5095},{"style":1041},[5096],{"type":998,"value":1076},{"type":993,"tag":1026,"props":5098,"children":5099},{"class":1028,"line":182},[5100,5104,5109,5113],{"type":993,"tag":1026,"props":5101,"children":5102},{"style":1047},[5103],{"type":998,"value":1732},{"type":993,"tag":1026,"props":5105,"children":5106},{"style":1041},[5107],{"type":998,"value":5108}," item ",{"type":993,"tag":1026,"props":5110,"children":5111},{"style":1047},[5112],{"type":998,"value":1742},{"type":993,"tag":1026,"props":5114,"children":5115},{"style":1041},[5116],{"type":998,"value":5117}," items_to_add:\n",{"type":993,"tag":1026,"props":5119,"children":5120},{"class":1028,"line":191},[5121,5125,5129,5134,5139,5144],{"type":993,"tag":1026,"props":5122,"children":5123},{"style":1047},[5124],{"type":998,"value":2518},{"type":993,"tag":1026,"props":5126,"children":5127},{"style":1041},[5128],{"type":998,"value":5108},{"type":993,"tag":1026,"props":5130,"children":5131},{"style":1047},[5132],{"type":998,"value":5133},"not",{"type":993,"tag":1026,"props":5135,"children":5136},{"style":1047},[5137],{"type":998,"value":5138}," in",{"type":993,"tag":1026,"props":5140,"children":5141},{"style":1041},[5142],{"type":998,"value":5143}," shopping_list:  ",{"type":993,"tag":1026,"props":5145,"children":5146},{"style":1032},[5147],{"type":998,"value":5148},"# Avoid duplicates\n",{"type":993,"tag":1026,"props":5150,"children":5151},{"class":1028,"line":201},[5152],{"type":993,"tag":1026,"props":5153,"children":5154},{"style":1041},[5155],{"type":998,"value":5156},"        shopping_list.append(item)\n",{"type":993,"tag":1026,"props":5158,"children":5159},{"class":1028,"line":210},[5160,5164,5168,5173],{"type":993,"tag":1026,"props":5161,"children":5162},{"style":1082},[5163],{"type":998,"value":1085},{"type":993,"tag":1026,"props":5165,"children":5166},{"style":1041},[5167],{"type":998,"value":1090},{"type":993,"tag":1026,"props":5169,"children":5170},{"style":1058},[5171],{"type":998,"value":5172},"\"Unique shopping list:\"",{"type":993,"tag":1026,"props":5174,"children":5175},{"style":1041},[5176],{"type":998,"value":5177},", shopping_list)\n",{"type":993,"tag":1026,"props":5179,"children":5180},{"class":1028,"line":219},[5181],{"type":993,"tag":1026,"props":5182,"children":5183},{"emptyLinePlaceholder":13},[5184],{"type":998,"value":1108},{"type":993,"tag":1026,"props":5186,"children":5187},{"class":1028,"line":228},[5188],{"type":993,"tag":1026,"props":5189,"children":5190},{"style":1032},[5191],{"type":998,"value":5192},"# Pattern 4: Merging data sources\n",{"type":993,"tag":1026,"props":5194,"children":5195},{"class":1028,"line":238},[5196,5201,5205],{"type":993,"tag":1026,"props":5197,"children":5198},{"style":1041},[5199],{"type":998,"value":5200},"all_data ",{"type":993,"tag":1026,"props":5202,"children":5203},{"style":1047},[5204],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5206,"children":5207},{"style":1041},[5208],{"type":998,"value":1453},{"type":993,"tag":1026,"props":5210,"children":5211},{"class":1028,"line":247},[5212,5217,5221,5225,5229,5233,5237,5241,5245],{"type":993,"tag":1026,"props":5213,"children":5214},{"style":1041},[5215],{"type":998,"value":5216},"source1 ",{"type":993,"tag":1026,"props":5218,"children":5219},{"style":1047},[5220],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5222,"children":5223},{"style":1041},[5224],{"type":998,"value":1055},{"type":993,"tag":1026,"props":5226,"children":5227},{"style":1082},[5228],{"type":998,"value":1244},{"type":993,"tag":1026,"props":5230,"children":5231},{"style":1041},[5232],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5234,"children":5235},{"style":1082},[5236],{"type":998,"value":1659},{"type":993,"tag":1026,"props":5238,"children":5239},{"style":1041},[5240],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5242,"children":5243},{"style":1082},[5244],{"type":998,"value":1668},{"type":993,"tag":1026,"props":5246,"children":5247},{"style":1041},[5248],{"type":998,"value":1076},{"type":993,"tag":1026,"props":5250,"children":5251},{"class":1028,"line":256},[5252,5257,5261,5265,5269,5273,5277,5281,5285],{"type":993,"tag":1026,"props":5253,"children":5254},{"style":1041},[5255],{"type":998,"value":5256},"source2 ",{"type":993,"tag":1026,"props":5258,"children":5259},{"style":1047},[5260],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5262,"children":5263},{"style":1041},[5264],{"type":998,"value":1055},{"type":993,"tag":1026,"props":5266,"children":5267},{"style":1082},[5268],{"type":998,"value":3428},{"type":993,"tag":1026,"props":5270,"children":5271},{"style":1041},[5272],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5274,"children":5275},{"style":1082},[5276],{"type":998,"value":3437},{"type":993,"tag":1026,"props":5278,"children":5279},{"style":1041},[5280],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5282,"children":5283},{"style":1082},[5284],{"type":998,"value":1764},{"type":993,"tag":1026,"props":5286,"children":5287},{"style":1041},[5288],{"type":998,"value":1076},{"type":993,"tag":1026,"props":5290,"children":5291},{"class":1028,"line":265},[5292,5297,5301,5305,5309,5313,5318,5322,5326],{"type":993,"tag":1026,"props":5293,"children":5294},{"style":1041},[5295],{"type":998,"value":5296},"source3 ",{"type":993,"tag":1026,"props":5298,"children":5299},{"style":1047},[5300],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5302,"children":5303},{"style":1041},[5304],{"type":998,"value":1055},{"type":993,"tag":1026,"props":5306,"children":5307},{"style":1082},[5308],{"type":998,"value":4234},{"type":993,"tag":1026,"props":5310,"children":5311},{"style":1041},[5312],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5314,"children":5315},{"style":1082},[5316],{"type":998,"value":5317},"8",{"type":993,"tag":1026,"props":5319,"children":5320},{"style":1041},[5321],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5323,"children":5324},{"style":1082},[5325],{"type":998,"value":4243},{"type":993,"tag":1026,"props":5327,"children":5328},{"style":1041},[5329],{"type":998,"value":1076},{"type":993,"tag":1026,"props":5331,"children":5332},{"class":1028,"line":274},[5333],{"type":993,"tag":1026,"props":5334,"children":5335},{"emptyLinePlaceholder":13},[5336],{"type":998,"value":1108},{"type":993,"tag":1026,"props":5338,"children":5339},{"class":1028,"line":284},[5340],{"type":993,"tag":1026,"props":5341,"children":5342},{"style":1041},[5343],{"type":998,"value":5344},"all_data.extend(source1)\n",{"type":993,"tag":1026,"props":5346,"children":5347},{"class":1028,"line":293},[5348],{"type":993,"tag":1026,"props":5349,"children":5350},{"style":1041},[5351],{"type":998,"value":5352},"all_data.extend(source2)\n",{"type":993,"tag":1026,"props":5354,"children":5355},{"class":1028,"line":302},[5356],{"type":993,"tag":1026,"props":5357,"children":5358},{"style":1041},[5359],{"type":998,"value":5360},"all_data.extend(source3)\n",{"type":993,"tag":1026,"props":5362,"children":5363},{"class":1028,"line":311},[5364,5368,5372,5377],{"type":993,"tag":1026,"props":5365,"children":5366},{"style":1082},[5367],{"type":998,"value":1085},{"type":993,"tag":1026,"props":5369,"children":5370},{"style":1041},[5371],{"type":998,"value":1090},{"type":993,"tag":1026,"props":5373,"children":5374},{"style":1058},[5375],{"type":998,"value":5376},"\"Merged data:\"",{"type":993,"tag":1026,"props":5378,"children":5379},{"style":1041},[5380],{"type":998,"value":5381},", all_data)\n",{"type":993,"tag":1026,"props":5383,"children":5384},{"class":1028,"line":320},[5385],{"type":993,"tag":1026,"props":5386,"children":5387},{"emptyLinePlaceholder":13},[5388],{"type":998,"value":1108},{"type":993,"tag":1026,"props":5390,"children":5391},{"class":1028,"line":329},[5392],{"type":993,"tag":1026,"props":5393,"children":5394},{"style":1032},[5395],{"type":998,"value":5396},"# Pattern 5: Building nested structures\n",{"type":993,"tag":1026,"props":5398,"children":5399},{"class":1028,"line":338},[5400,5405,5409],{"type":993,"tag":1026,"props":5401,"children":5402},{"style":1041},[5403],{"type":998,"value":5404},"matrix ",{"type":993,"tag":1026,"props":5406,"children":5407},{"style":1047},[5408],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5410,"children":5411},{"style":1041},[5412],{"type":998,"value":1453},{"type":993,"tag":1026,"props":5414,"children":5415},{"class":1028,"line":347},[5416,5420,5425,5429,5433,5437,5441],{"type":993,"tag":1026,"props":5417,"children":5418},{"style":1047},[5419],{"type":998,"value":1732},{"type":993,"tag":1026,"props":5421,"children":5422},{"style":1041},[5423],{"type":998,"value":5424}," row ",{"type":993,"tag":1026,"props":5426,"children":5427},{"style":1047},[5428],{"type":998,"value":1742},{"type":993,"tag":1026,"props":5430,"children":5431},{"style":1082},[5432],{"type":998,"value":1747},{"type":993,"tag":1026,"props":5434,"children":5435},{"style":1041},[5436],{"type":998,"value":1090},{"type":993,"tag":1026,"props":5438,"children":5439},{"style":1082},[5440],{"type":998,"value":1668},{"type":993,"tag":1026,"props":5442,"children":5443},{"style":1041},[5444],{"type":998,"value":1769},{"type":993,"tag":1026,"props":5446,"children":5447},{"class":1028,"line":356},[5448,5453],{"type":993,"tag":1026,"props":5449,"children":5450},{"style":1041},[5451],{"type":998,"value":5452},"    matrix.append([])  ",{"type":993,"tag":1026,"props":5454,"children":5455},{"style":1032},[5456],{"type":998,"value":5457},"# Add empty row\n",{"type":993,"tag":1026,"props":5459,"children":5460},{"class":1028,"line":365},[5461,5465,5470,5474,5478,5482,5486],{"type":993,"tag":1026,"props":5462,"children":5463},{"style":1047},[5464],{"type":998,"value":2430},{"type":993,"tag":1026,"props":5466,"children":5467},{"style":1041},[5468],{"type":998,"value":5469}," col ",{"type":993,"tag":1026,"props":5471,"children":5472},{"style":1047},[5473],{"type":998,"value":1742},{"type":993,"tag":1026,"props":5475,"children":5476},{"style":1082},[5477],{"type":998,"value":1747},{"type":993,"tag":1026,"props":5479,"children":5480},{"style":1041},[5481],{"type":998,"value":1090},{"type":993,"tag":1026,"props":5483,"children":5484},{"style":1082},[5485],{"type":998,"value":1668},{"type":993,"tag":1026,"props":5487,"children":5488},{"style":1041},[5489],{"type":998,"value":1769},{"type":993,"tag":1026,"props":5491,"children":5492},{"class":1028,"line":374},[5493,5498,5502,5507,5511,5515,5519,5524],{"type":993,"tag":1026,"props":5494,"children":5495},{"style":1041},[5496],{"type":998,"value":5497},"        matrix[row].append(row ",{"type":993,"tag":1026,"props":5499,"children":5500},{"style":1047},[5501],{"type":998,"value":3941},{"type":993,"tag":1026,"props":5503,"children":5504},{"style":1082},[5505],{"type":998,"value":5506}," 3",{"type":993,"tag":1026,"props":5508,"children":5509},{"style":1047},[5510],{"type":998,"value":4789},{"type":993,"tag":1026,"props":5512,"children":5513},{"style":1041},[5514],{"type":998,"value":5469},{"type":993,"tag":1026,"props":5516,"children":5517},{"style":1047},[5518],{"type":998,"value":3200},{"type":993,"tag":1026,"props":5520,"children":5521},{"style":1082},[5522],{"type":998,"value":5523}," 1",{"type":993,"tag":1026,"props":5525,"children":5526},{"style":1041},[5527],{"type":998,"value":1134},{"type":993,"tag":1026,"props":5529,"children":5530},{"class":1028,"line":384},[5531,5535,5539,5544],{"type":993,"tag":1026,"props":5532,"children":5533},{"style":1082},[5534],{"type":998,"value":1085},{"type":993,"tag":1026,"props":5536,"children":5537},{"style":1041},[5538],{"type":998,"value":1090},{"type":993,"tag":1026,"props":5540,"children":5541},{"style":1058},[5542],{"type":998,"value":5543},"\"Built matrix:\"",{"type":993,"tag":1026,"props":5545,"children":5546},{"style":1041},[5547],{"type":998,"value":5548},", matrix)\n",{"type":993,"tag":1279,"props":5550,"children":5552},{"id":5551},"performance-considerations",[5553],{"type":998,"value":5554},"Performance Considerations",{"type":993,"tag":1001,"props":5556,"children":5557},{},[5558],{"type":998,"value":5559},"Understanding the performance characteristics of different adding methods helps you make efficient choices for your applications.",{"type":993,"tag":1299,"props":5561,"children":5564},{"emoji":5562,"title":5563,"type":1835},"⚡","Performance Guidelines",[5565,5573,5628,5636],{"type":993,"tag":1001,"props":5566,"children":5567},{},[5568],{"type":993,"tag":1309,"props":5569,"children":5570},{},[5571],{"type":998,"value":5572},"Efficiency Ranking (Best to Worst):",{"type":993,"tag":5574,"props":5575,"children":5576},"ol",{},[5577,5587,5597,5607,5618],{"type":993,"tag":1335,"props":5578,"children":5579},{},[5580,5585],{"type":993,"tag":1022,"props":5581,"children":5583},{"className":5582},[],[5584],{"type":998,"value":1295},{"type":998,"value":5586}," for single items - O(1)",{"type":993,"tag":1335,"props":5588,"children":5589},{},[5590,5595],{"type":993,"tag":1022,"props":5591,"children":5593},{"className":5592},[],[5594],{"type":998,"value":2585},{"type":998,"value":5596}," for multiple items - O(k)",{"type":993,"tag":1335,"props":5598,"children":5599},{},[5600,5605],{"type":993,"tag":1022,"props":5601,"children":5603},{"className":5602},[],[5604],{"type":998,"value":3208},{"type":998,"value":5606}," for concatenation - O(k)",{"type":993,"tag":1335,"props":5608,"children":5609},{},[5610,5616],{"type":993,"tag":1022,"props":5611,"children":5613},{"className":5612},[],[5614],{"type":998,"value":5615},"insert(0, item)",{"type":998,"value":5617}," at beginning - O(n)",{"type":993,"tag":1335,"props":5619,"children":5620},{},[5621,5626],{"type":993,"tag":1022,"props":5622,"children":5624},{"className":5623},[],[5625],{"type":998,"value":3200},{"type":998,"value":5627}," operator in loops - O(n) each time",{"type":993,"tag":1001,"props":5629,"children":5630},{},[5631],{"type":993,"tag":1309,"props":5632,"children":5633},{},[5634],{"type":998,"value":5635},"Best Practices:",{"type":993,"tag":1331,"props":5637,"children":5638},{},[5639,5650,5661,5679,5692],{"type":993,"tag":1335,"props":5640,"children":5641},{},[5642,5643,5648],{"type":998,"value":3308},{"type":993,"tag":1022,"props":5644,"children":5646},{"className":5645},[],[5647],{"type":998,"value":1295},{"type":998,"value":5649}," for single items",{"type":993,"tag":1335,"props":5651,"children":5652},{},[5653,5654,5659],{"type":998,"value":3308},{"type":993,"tag":1022,"props":5655,"children":5657},{"className":5656},[],[5658],{"type":998,"value":2585},{"type":998,"value":5660}," for multiple items from iterables",{"type":993,"tag":1335,"props":5662,"children":5663},{},[5664,5665,5670,5672,5677],{"type":998,"value":3308},{"type":993,"tag":1022,"props":5666,"children":5668},{"className":5667},[],[5669],{"type":998,"value":3208},{"type":998,"value":5671}," instead of ",{"type":993,"tag":1022,"props":5673,"children":5675},{"className":5674},[],[5676],{"type":998,"value":3200},{"type":998,"value":5678}," when modifying existing lists",{"type":993,"tag":1335,"props":5680,"children":5681},{},[5682,5684,5690],{"type":998,"value":5683},"Avoid frequent insertions at the beginning (consider ",{"type":993,"tag":1022,"props":5685,"children":5687},{"className":5686},[],[5688],{"type":998,"value":5689},"collections.deque",{"type":998,"value":5691},")",{"type":993,"tag":1335,"props":5693,"children":5694},{},[5695],{"type":998,"value":5696},"Build lists forward when possible",{"type":993,"tag":5698,"props":5699,"children":5702},"exercise",{"hint":5700,"prompt":5701},"Use append() in a loop for odds, and extend() to combine lists efficiently!","Build two lists: one with odd numbers 1-9, another by combining multiple smaller lists using extend.",[5703],{"type":993,"tag":1016,"props":5704,"children":5706},{"className":1018,"code":5705,"language":6,"meta":8,"style":8},"# 9 TODO: Part 1: Build a list of odd numbers from 1 to\nodds = []\n# 9 TODO: Your code here to add 1, 3, 5, 7,\n\n# TODO: Part 2: Combine multiple lists using extend\nvowels = []\ngroup1 = ['a', 'e']\ngroup2 = ['i', 'o']\ngroup3 = ['u']\n# TODO: Your code here to combine all groups into vowels list\n\nprint(\"Odd numbers:\", odds)\nprint(\"All vowels:\", vowels)\n",[5707],{"type":993,"tag":1022,"props":5708,"children":5709},{"__ignoreMap":8},[5710,5728,5744,5760,5767,5784,5800,5834,5868,5893,5909,5916,5937],{"type":993,"tag":1026,"props":5711,"children":5712},{"class":1028,"line":12},[5713,5718,5723],{"type":993,"tag":1026,"props":5714,"children":5715},{"style":1032},[5716],{"type":998,"value":5717},"# 9 ",{"type":993,"tag":1026,"props":5719,"children":5720},{"style":1047},[5721],{"type":998,"value":5722},"TODO",{"type":993,"tag":1026,"props":5724,"children":5725},{"style":1032},[5726],{"type":998,"value":5727},": Part 1: Build a list of odd numbers from 1 to\n",{"type":993,"tag":1026,"props":5729,"children":5730},{"class":1028,"line":27},[5731,5736,5740],{"type":993,"tag":1026,"props":5732,"children":5733},{"style":1041},[5734],{"type":998,"value":5735},"odds ",{"type":993,"tag":1026,"props":5737,"children":5738},{"style":1047},[5739],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5741,"children":5742},{"style":1041},[5743],{"type":998,"value":1453},{"type":993,"tag":1026,"props":5745,"children":5746},{"class":1028,"line":36},[5747,5751,5755],{"type":993,"tag":1026,"props":5748,"children":5749},{"style":1032},[5750],{"type":998,"value":5717},{"type":993,"tag":1026,"props":5752,"children":5753},{"style":1047},[5754],{"type":998,"value":5722},{"type":993,"tag":1026,"props":5756,"children":5757},{"style":1032},[5758],{"type":998,"value":5759},": Your code here to add 1, 3, 5, 7,\n",{"type":993,"tag":1026,"props":5761,"children":5762},{"class":1028,"line":45},[5763],{"type":993,"tag":1026,"props":5764,"children":5765},{"emptyLinePlaceholder":13},[5766],{"type":998,"value":1108},{"type":993,"tag":1026,"props":5768,"children":5769},{"class":1028,"line":54},[5770,5775,5779],{"type":993,"tag":1026,"props":5771,"children":5772},{"style":1032},[5773],{"type":998,"value":5774},"# ",{"type":993,"tag":1026,"props":5776,"children":5777},{"style":1047},[5778],{"type":998,"value":5722},{"type":993,"tag":1026,"props":5780,"children":5781},{"style":1032},[5782],{"type":998,"value":5783},": Part 2: Combine multiple lists using extend\n",{"type":993,"tag":1026,"props":5785,"children":5786},{"class":1028,"line":63},[5787,5792,5796],{"type":993,"tag":1026,"props":5788,"children":5789},{"style":1041},[5790],{"type":998,"value":5791},"vowels ",{"type":993,"tag":1026,"props":5793,"children":5794},{"style":1047},[5795],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5797,"children":5798},{"style":1041},[5799],{"type":998,"value":1453},{"type":993,"tag":1026,"props":5801,"children":5802},{"class":1028,"line":72},[5803,5808,5812,5816,5821,5825,5830],{"type":993,"tag":1026,"props":5804,"children":5805},{"style":1041},[5806],{"type":998,"value":5807},"group1 ",{"type":993,"tag":1026,"props":5809,"children":5810},{"style":1047},[5811],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5813,"children":5814},{"style":1041},[5815],{"type":998,"value":1055},{"type":993,"tag":1026,"props":5817,"children":5818},{"style":1058},[5819],{"type":998,"value":5820},"'a'",{"type":993,"tag":1026,"props":5822,"children":5823},{"style":1041},[5824],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5826,"children":5827},{"style":1058},[5828],{"type":998,"value":5829},"'e'",{"type":993,"tag":1026,"props":5831,"children":5832},{"style":1041},[5833],{"type":998,"value":1076},{"type":993,"tag":1026,"props":5835,"children":5836},{"class":1028,"line":81},[5837,5842,5846,5850,5855,5859,5864],{"type":993,"tag":1026,"props":5838,"children":5839},{"style":1041},[5840],{"type":998,"value":5841},"group2 ",{"type":993,"tag":1026,"props":5843,"children":5844},{"style":1047},[5845],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5847,"children":5848},{"style":1041},[5849],{"type":998,"value":1055},{"type":993,"tag":1026,"props":5851,"children":5852},{"style":1058},[5853],{"type":998,"value":5854},"'i'",{"type":993,"tag":1026,"props":5856,"children":5857},{"style":1041},[5858],{"type":998,"value":1066},{"type":993,"tag":1026,"props":5860,"children":5861},{"style":1058},[5862],{"type":998,"value":5863},"'o'",{"type":993,"tag":1026,"props":5865,"children":5866},{"style":1041},[5867],{"type":998,"value":1076},{"type":993,"tag":1026,"props":5869,"children":5870},{"class":1028,"line":91},[5871,5876,5880,5884,5889],{"type":993,"tag":1026,"props":5872,"children":5873},{"style":1041},[5874],{"type":998,"value":5875},"group3 ",{"type":993,"tag":1026,"props":5877,"children":5878},{"style":1047},[5879],{"type":998,"value":1050},{"type":993,"tag":1026,"props":5881,"children":5882},{"style":1041},[5883],{"type":998,"value":1055},{"type":993,"tag":1026,"props":5885,"children":5886},{"style":1058},[5887],{"type":998,"value":5888},"'u'",{"type":993,"tag":1026,"props":5890,"children":5891},{"style":1041},[5892],{"type":998,"value":1076},{"type":993,"tag":1026,"props":5894,"children":5895},{"class":1028,"line":100},[5896,5900,5904],{"type":993,"tag":1026,"props":5897,"children":5898},{"style":1032},[5899],{"type":998,"value":5774},{"type":993,"tag":1026,"props":5901,"children":5902},{"style":1047},[5903],{"type":998,"value":5722},{"type":993,"tag":1026,"props":5905,"children":5906},{"style":1032},[5907],{"type":998,"value":5908},": Your code here to combine all groups into vowels list\n",{"type":993,"tag":1026,"props":5910,"children":5911},{"class":1028,"line":109},[5912],{"type":993,"tag":1026,"props":5913,"children":5914},{"emptyLinePlaceholder":13},[5915],{"type":998,"value":1108},{"type":993,"tag":1026,"props":5917,"children":5918},{"class":1028,"line":118},[5919,5923,5927,5932],{"type":993,"tag":1026,"props":5920,"children":5921},{"style":1082},[5922],{"type":998,"value":1085},{"type":993,"tag":1026,"props":5924,"children":5925},{"style":1041},[5926],{"type":998,"value":1090},{"type":993,"tag":1026,"props":5928,"children":5929},{"style":1058},[5930],{"type":998,"value":5931},"\"Odd numbers:\"",{"type":993,"tag":1026,"props":5933,"children":5934},{"style":1041},[5935],{"type":998,"value":5936},", odds)\n",{"type":993,"tag":1026,"props":5938,"children":5939},{"class":1028,"line":127},[5940,5944,5948,5953],{"type":993,"tag":1026,"props":5941,"children":5942},{"style":1082},[5943],{"type":998,"value":1085},{"type":993,"tag":1026,"props":5945,"children":5946},{"style":1041},[5947],{"type":998,"value":1090},{"type":993,"tag":1026,"props":5949,"children":5950},{"style":1058},[5951],{"type":998,"value":5952},"\"All vowels:\"",{"type":993,"tag":1026,"props":5954,"children":5955},{"style":1041},[5956],{"type":998,"value":5957},", vowels)\n",{"type":993,"tag":1408,"props":5959,"children":5961},{"id":5960},"solution-and-explanation",[5962],{"type":998,"value":5963},"Solution and Explanation 💡",{"type":993,"tag":5965,"props":5966,"children":5967},"details",{},[5968,5976,6255,6263],{"type":993,"tag":5969,"props":5970,"children":5973},"summary",{"className":5971},[5972],"cursor-pointer",[5974],{"type":998,"value":5975},"Click to see the complete solution",{"type":993,"tag":1012,"props":5977,"children":5978},{},[5979],{"type":993,"tag":1016,"props":5980,"children":5982},{"className":1018,"code":5981,"language":6,"meta":8,"style":8},"# 9 Part 1: Build a list of odd numbers from 1 to\nodds = []\nfor i in range(1, 10, 2):  # Start at 1, go to 10, step by 2\n    odds.append(i)\n\n# Part 2: Combine multiple lists using extend\nvowels = []\ngroup1 = ['a', 'e']\ngroup2 = ['i', 'o']\ngroup3 = ['u']\nvowels.extend(group1)\nvowels.extend(group2)\nvowels.extend(group3)\n\nprint(\"Odd numbers:\", odds)\nprint(\"All vowels:\", vowels)\n",[5983],{"type":993,"tag":1022,"props":5984,"children":5985},{"__ignoreMap":8},[5986,5994,6009,6063,6071,6078,6086,6101,6132,6163,6186,6194,6202,6210,6217,6236],{"type":993,"tag":1026,"props":5987,"children":5988},{"class":1028,"line":12},[5989],{"type":993,"tag":1026,"props":5990,"children":5991},{"style":1032},[5992],{"type":998,"value":5993},"# 9 Part 1: Build a list of odd numbers from 1 to\n",{"type":993,"tag":1026,"props":5995,"children":5996},{"class":1028,"line":27},[5997,6001,6005],{"type":993,"tag":1026,"props":5998,"children":5999},{"style":1041},[6000],{"type":998,"value":5735},{"type":993,"tag":1026,"props":6002,"children":6003},{"style":1047},[6004],{"type":998,"value":1050},{"type":993,"tag":1026,"props":6006,"children":6007},{"style":1041},[6008],{"type":998,"value":1453},{"type":993,"tag":1026,"props":6010,"children":6011},{"class":1028,"line":36},[6012,6016,6020,6024,6028,6032,6036,6040,6045,6049,6053,6058],{"type":993,"tag":1026,"props":6013,"children":6014},{"style":1047},[6015],{"type":998,"value":1732},{"type":993,"tag":1026,"props":6017,"children":6018},{"style":1041},[6019],{"type":998,"value":1737},{"type":993,"tag":1026,"props":6021,"children":6022},{"style":1047},[6023],{"type":998,"value":1742},{"type":993,"tag":1026,"props":6025,"children":6026},{"style":1082},[6027],{"type":998,"value":1747},{"type":993,"tag":1026,"props":6029,"children":6030},{"style":1041},[6031],{"type":998,"value":1090},{"type":993,"tag":1026,"props":6033,"children":6034},{"style":1082},[6035],{"type":998,"value":1244},{"type":993,"tag":1026,"props":6037,"children":6038},{"style":1041},[6039],{"type":998,"value":1066},{"type":993,"tag":1026,"props":6041,"children":6042},{"style":1082},[6043],{"type":998,"value":6044},"10",{"type":993,"tag":1026,"props":6046,"children":6047},{"style":1041},[6048],{"type":998,"value":1066},{"type":993,"tag":1026,"props":6050,"children":6051},{"style":1082},[6052],{"type":998,"value":1659},{"type":993,"tag":1026,"props":6054,"children":6055},{"style":1041},[6056],{"type":998,"value":6057},"):  ",{"type":993,"tag":1026,"props":6059,"children":6060},{"style":1032},[6061],{"type":998,"value":6062},"# Start at 1, go to 10, step by 2\n",{"type":993,"tag":1026,"props":6064,"children":6065},{"class":1028,"line":45},[6066],{"type":993,"tag":1026,"props":6067,"children":6068},{"style":1041},[6069],{"type":998,"value":6070},"    odds.append(i)\n",{"type":993,"tag":1026,"props":6072,"children":6073},{"class":1028,"line":54},[6074],{"type":993,"tag":1026,"props":6075,"children":6076},{"emptyLinePlaceholder":13},[6077],{"type":998,"value":1108},{"type":993,"tag":1026,"props":6079,"children":6080},{"class":1028,"line":63},[6081],{"type":993,"tag":1026,"props":6082,"children":6083},{"style":1032},[6084],{"type":998,"value":6085},"# Part 2: Combine multiple lists using extend\n",{"type":993,"tag":1026,"props":6087,"children":6088},{"class":1028,"line":72},[6089,6093,6097],{"type":993,"tag":1026,"props":6090,"children":6091},{"style":1041},[6092],{"type":998,"value":5791},{"type":993,"tag":1026,"props":6094,"children":6095},{"style":1047},[6096],{"type":998,"value":1050},{"type":993,"tag":1026,"props":6098,"children":6099},{"style":1041},[6100],{"type":998,"value":1453},{"type":993,"tag":1026,"props":6102,"children":6103},{"class":1028,"line":81},[6104,6108,6112,6116,6120,6124,6128],{"type":993,"tag":1026,"props":6105,"children":6106},{"style":1041},[6107],{"type":998,"value":5807},{"type":993,"tag":1026,"props":6109,"children":6110},{"style":1047},[6111],{"type":998,"value":1050},{"type":993,"tag":1026,"props":6113,"children":6114},{"style":1041},[6115],{"type":998,"value":1055},{"type":993,"tag":1026,"props":6117,"children":6118},{"style":1058},[6119],{"type":998,"value":5820},{"type":993,"tag":1026,"props":6121,"children":6122},{"style":1041},[6123],{"type":998,"value":1066},{"type":993,"tag":1026,"props":6125,"children":6126},{"style":1058},[6127],{"type":998,"value":5829},{"type":993,"tag":1026,"props":6129,"children":6130},{"style":1041},[6131],{"type":998,"value":1076},{"type":993,"tag":1026,"props":6133,"children":6134},{"class":1028,"line":91},[6135,6139,6143,6147,6151,6155,6159],{"type":993,"tag":1026,"props":6136,"children":6137},{"style":1041},[6138],{"type":998,"value":5841},{"type":993,"tag":1026,"props":6140,"children":6141},{"style":1047},[6142],{"type":998,"value":1050},{"type":993,"tag":1026,"props":6144,"children":6145},{"style":1041},[6146],{"type":998,"value":1055},{"type":993,"tag":1026,"props":6148,"children":6149},{"style":1058},[6150],{"type":998,"value":5854},{"type":993,"tag":1026,"props":6152,"children":6153},{"style":1041},[6154],{"type":998,"value":1066},{"type":993,"tag":1026,"props":6156,"children":6157},{"style":1058},[6158],{"type":998,"value":5863},{"type":993,"tag":1026,"props":6160,"children":6161},{"style":1041},[6162],{"type":998,"value":1076},{"type":993,"tag":1026,"props":6164,"children":6165},{"class":1028,"line":100},[6166,6170,6174,6178,6182],{"type":993,"tag":1026,"props":6167,"children":6168},{"style":1041},[6169],{"type":998,"value":5875},{"type":993,"tag":1026,"props":6171,"children":6172},{"style":1047},[6173],{"type":998,"value":1050},{"type":993,"tag":1026,"props":6175,"children":6176},{"style":1041},[6177],{"type":998,"value":1055},{"type":993,"tag":1026,"props":6179,"children":6180},{"style":1058},[6181],{"type":998,"value":5888},{"type":993,"tag":1026,"props":6183,"children":6184},{"style":1041},[6185],{"type":998,"value":1076},{"type":993,"tag":1026,"props":6187,"children":6188},{"class":1028,"line":109},[6189],{"type":993,"tag":1026,"props":6190,"children":6191},{"style":1041},[6192],{"type":998,"value":6193},"vowels.extend(group1)\n",{"type":993,"tag":1026,"props":6195,"children":6196},{"class":1028,"line":118},[6197],{"type":993,"tag":1026,"props":6198,"children":6199},{"style":1041},[6200],{"type":998,"value":6201},"vowels.extend(group2)\n",{"type":993,"tag":1026,"props":6203,"children":6204},{"class":1028,"line":127},[6205],{"type":993,"tag":1026,"props":6206,"children":6207},{"style":1041},[6208],{"type":998,"value":6209},"vowels.extend(group3)\n",{"type":993,"tag":1026,"props":6211,"children":6212},{"class":1028,"line":136},[6213],{"type":993,"tag":1026,"props":6214,"children":6215},{"emptyLinePlaceholder":13},[6216],{"type":998,"value":1108},{"type":993,"tag":1026,"props":6218,"children":6219},{"class":1028,"line":146},[6220,6224,6228,6232],{"type":993,"tag":1026,"props":6221,"children":6222},{"style":1082},[6223],{"type":998,"value":1085},{"type":993,"tag":1026,"props":6225,"children":6226},{"style":1041},[6227],{"type":998,"value":1090},{"type":993,"tag":1026,"props":6229,"children":6230},{"style":1058},[6231],{"type":998,"value":5931},{"type":993,"tag":1026,"props":6233,"children":6234},{"style":1041},[6235],{"type":998,"value":5936},{"type":993,"tag":1026,"props":6237,"children":6238},{"class":1028,"line":155},[6239,6243,6247,6251],{"type":993,"tag":1026,"props":6240,"children":6241},{"style":1082},[6242],{"type":998,"value":1085},{"type":993,"tag":1026,"props":6244,"children":6245},{"style":1041},[6246],{"type":998,"value":1090},{"type":993,"tag":1026,"props":6248,"children":6249},{"style":1058},[6250],{"type":998,"value":5952},{"type":993,"tag":1026,"props":6252,"children":6253},{"style":1041},[6254],{"type":998,"value":5957},{"type":993,"tag":1001,"props":6256,"children":6257},{},[6258],{"type":993,"tag":1309,"props":6259,"children":6260},{},[6261],{"type":998,"value":6262},"Key Learning Points:",{"type":993,"tag":1331,"props":6264,"children":6265},{},[6266,6286,6297,6308],{"type":993,"tag":1335,"props":6267,"children":6268},{},[6269,6271,6276,6278,6284],{"type":998,"value":6270},"📌 ",{"type":993,"tag":1309,"props":6272,"children":6273},{},[6274],{"type":998,"value":6275},"Range with step",{"type":998,"value":6277},": ",{"type":993,"tag":1022,"props":6279,"children":6281},{"className":6280},[],[6282],{"type":998,"value":6283},"range(1, 10, 2)",{"type":998,"value":6285}," generates 1, 3, 5, 7, 9",{"type":993,"tag":1335,"props":6287,"children":6288},{},[6289,6290,6295],{"type":998,"value":6270},{"type":993,"tag":1309,"props":6291,"children":6292},{},[6293],{"type":998,"value":6294},"append() in loop",{"type":998,"value":6296},": Add single items one at a time",{"type":993,"tag":1335,"props":6298,"children":6299},{},[6300,6301,6306],{"type":998,"value":6270},{"type":993,"tag":1309,"props":6302,"children":6303},{},[6304],{"type":998,"value":6305},"extend() method",{"type":998,"value":6307},": Add all items from another list efficiently",{"type":993,"tag":1335,"props":6309,"children":6310},{},[6311,6312,6317],{"type":998,"value":6270},{"type":993,"tag":1309,"props":6313,"children":6314},{},[6315],{"type":998,"value":6316},"Multiple extends",{"type":998,"value":6318},": Chain multiple extend() calls to combine several lists",{"type":993,"tag":1279,"props":6320,"children":6322},{"id":6321},"adding-methods-reference",[6323],{"type":998,"value":6324},"Adding Methods Reference",{"type":993,"tag":1001,"props":6326,"children":6327},{},[6328],{"type":998,"value":6329},"Python provides various methods for adding elements to lists:",{"type":993,"tag":6331,"props":6332,"children":6333},"table",{},[6334,6363],{"type":993,"tag":6335,"props":6336,"children":6337},"thead",{},[6338],{"type":993,"tag":6339,"props":6340,"children":6341},"tr",{},[6342,6348,6353,6358],{"type":993,"tag":6343,"props":6344,"children":6345},"th",{},[6346],{"type":998,"value":6347},"Method",{"type":993,"tag":6343,"props":6349,"children":6350},{},[6351],{"type":998,"value":6352},"Purpose",{"type":993,"tag":6343,"props":6354,"children":6355},{},[6356],{"type":998,"value":6357},"Example",{"type":993,"tag":6343,"props":6359,"children":6360},{},[6361],{"type":998,"value":6362},"Result",{"type":993,"tag":6364,"props":6365,"children":6366},"tbody",{},[6367,6399,6430,6461,6491],{"type":993,"tag":6339,"props":6368,"children":6369},{},[6370,6380,6385,6394],{"type":993,"tag":6371,"props":6372,"children":6373},"td",{},[6374],{"type":993,"tag":1022,"props":6375,"children":6377},{"className":6376},[],[6378],{"type":998,"value":6379},"append(item)",{"type":993,"tag":6371,"props":6381,"children":6382},{},[6383],{"type":998,"value":6384},"Add single item to end",{"type":993,"tag":6371,"props":6386,"children":6387},{},[6388],{"type":993,"tag":1022,"props":6389,"children":6391},{"className":6390},[],[6392],{"type":998,"value":6393},"lst.append(5)",{"type":993,"tag":6371,"props":6395,"children":6396},{},[6397],{"type":998,"value":6398},"Adds 5 to end",{"type":993,"tag":6339,"props":6400,"children":6401},{},[6402,6411,6416,6425],{"type":993,"tag":6371,"props":6403,"children":6404},{},[6405],{"type":993,"tag":1022,"props":6406,"children":6408},{"className":6407},[],[6409],{"type":998,"value":6410},"insert(index, item)",{"type":993,"tag":6371,"props":6412,"children":6413},{},[6414],{"type":998,"value":6415},"Add item at position",{"type":993,"tag":6371,"props":6417,"children":6418},{},[6419],{"type":993,"tag":1022,"props":6420,"children":6422},{"className":6421},[],[6423],{"type":998,"value":6424},"lst.insert(0, 5)",{"type":993,"tag":6371,"props":6426,"children":6427},{},[6428],{"type":998,"value":6429},"Adds 5 at start",{"type":993,"tag":6339,"props":6431,"children":6432},{},[6433,6442,6447,6456],{"type":993,"tag":6371,"props":6434,"children":6435},{},[6436],{"type":993,"tag":1022,"props":6437,"children":6439},{"className":6438},[],[6440],{"type":998,"value":6441},"extend(iterable)",{"type":993,"tag":6371,"props":6443,"children":6444},{},[6445],{"type":998,"value":6446},"Add all items from iterable",{"type":993,"tag":6371,"props":6448,"children":6449},{},[6450],{"type":993,"tag":1022,"props":6451,"children":6453},{"className":6452},[],[6454],{"type":998,"value":6455},"lst.extend([1,2,3])",{"type":993,"tag":6371,"props":6457,"children":6458},{},[6459],{"type":998,"value":6460},"Adds 1, 2, 3 to end",{"type":993,"tag":6339,"props":6462,"children":6463},{},[6464,6472,6477,6486],{"type":993,"tag":6371,"props":6465,"children":6466},{},[6467],{"type":993,"tag":1022,"props":6468,"children":6470},{"className":6469},[],[6471],{"type":998,"value":3208},{"type":993,"tag":6371,"props":6473,"children":6474},{},[6475],{"type":998,"value":6476},"Concatenate and assign",{"type":993,"tag":6371,"props":6478,"children":6479},{},[6480],{"type":993,"tag":1022,"props":6481,"children":6483},{"className":6482},[],[6484],{"type":998,"value":6485},"lst += [1,2,3]",{"type":993,"tag":6371,"props":6487,"children":6488},{},[6489],{"type":998,"value":6490},"Same as extend",{"type":993,"tag":6339,"props":6492,"children":6493},{},[6494,6502,6507,6516],{"type":993,"tag":6371,"props":6495,"children":6496},{},[6497],{"type":993,"tag":1022,"props":6498,"children":6500},{"className":6499},[],[6501],{"type":998,"value":3200},{"type":993,"tag":6371,"props":6503,"children":6504},{},[6505],{"type":998,"value":6506},"Create new concatenated list",{"type":993,"tag":6371,"props":6508,"children":6509},{},[6510],{"type":993,"tag":1022,"props":6511,"children":6513},{"className":6512},[],[6514],{"type":998,"value":6515},"new = lst + [1,2,3]",{"type":993,"tag":6371,"props":6517,"children":6518},{},[6519],{"type":998,"value":6520},"New list with additions",{"type":993,"tag":1001,"props":6522,"children":6523},{},[6524],{"type":998,"value":6525},"Choose the method that best fits your specific adding needs.",{"type":993,"tag":1279,"props":6527,"children":6529},{"id":6528},"take-quiz",[6530],{"type":998,"value":6531},"Take Quiz",{"type":993,"tag":1001,"props":6533,"children":6534},{},[6535],{"type":998,"value":6536},"Test your understanding of adding to lists:",{"type":993,"tag":6538,"props":6539,"children":6541},"redirect-button",{"label":6531,"url":6540},"/tutorial-quiz/python/adding-to-lists",[],{"type":993,"tag":1279,"props":6543,"children":6545},{"id":6544},"whats-next",[6546],{"type":998,"value":6547},"What's Next?",{"type":993,"tag":1001,"props":6549,"children":6550},{},[6551,6553,6558,6560,6566,6567,6573,6574,6580],{"type":998,"value":6552},"Now that you know how to add elements to lists, you're ready to learn about ",{"type":993,"tag":1309,"props":6554,"children":6555},{},[6556],{"type":998,"value":6557},"removing elements from lists",{"type":998,"value":6559},". This includes using ",{"type":993,"tag":1022,"props":6561,"children":6563},{"className":6562},[],[6564],{"type":998,"value":6565},"remove()",{"type":998,"value":1066},{"type":993,"tag":1022,"props":6568,"children":6570},{"className":6569},[],[6571],{"type":998,"value":6572},"pop()",{"type":998,"value":1066},{"type":993,"tag":1022,"props":6575,"children":6577},{"className":6576},[],[6578],{"type":998,"value":6579},"del",{"type":998,"value":6581},", and other techniques to delete items and shrink your lists.",{"type":993,"tag":1001,"props":6583,"children":6584},{},[6585,6587,6591],{"type":998,"value":6586},"Ready to continue? Check out our lesson on ",{"type":993,"tag":1382,"props":6588,"children":6589},{"href":316},[6590],{"type":998,"value":317},{"type":998,"value":6592}," to complete your list manipulation skills! 🗑️",{"type":993,"tag":6594,"props":6595,"children":6596},"style",{},[6597],{"type":998,"value":6598},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}html.app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}",{"title":8,"searchDepth":36,"depth":36,"links":6600},[6601,6604,6608,6611,6614,6617,6620,6623,6624,6625],{"id":1281,"depth":27,"text":1284,"children":6602},[6603],{"id":1410,"depth":36,"text":1413},{"id":1815,"depth":27,"text":1818,"children":6605},[6606,6607],{"id":1932,"depth":36,"text":1935},{"id":2266,"depth":36,"text":2269},{"id":2572,"depth":27,"text":2575,"children":6609},[6610],{"id":2703,"depth":36,"text":2706},{"id":3186,"depth":27,"text":3189,"children":6612},[6613],{"id":3341,"depth":36,"text":3344},{"id":3995,"depth":27,"text":3998,"children":6615},[6616],{"id":4006,"depth":36,"text":4009},{"id":4669,"depth":27,"text":4672,"children":6618},[6619],{"id":4680,"depth":36,"text":4683},{"id":5551,"depth":27,"text":5554,"children":6621},[6622],{"id":5960,"depth":36,"text":5963},{"id":6321,"depth":27,"text":6324},{"id":6528,"depth":27,"text":6531},{"id":6544,"depth":27,"text":6547},1782373736722]