[{"data":1,"prerenderedAt":7442},["ShallowReactive",2],{"tutorials-python":3,"category-items-python":987,"content-/python/removing-from-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",[315],{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":270,"order":320,"body":989,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},{"type":990,"children":991,"toc":7415},"root",[992,1001,1007,1012,1321,1328,1341,1434,1439,1446,1451,1968,1974,1986,2083,2088,2094,2099,2743,2748,2754,2765,2875,2880,2886,2891,3526,3532,3544,3656,3662,3667,4258,4264,4269,4275,4280,4965,4971,4976,4982,4987,5596,5819,5825,6093,6099,6104,6110,6115,6967,6973,6978,7252,7257,7356,7362,7367,7372,7378,7398,7409],{"type":993,"tag":994,"props":995,"children":997},"element","h1",{"id":996},"️-removing-from-lists",[998],{"type":999,"value":1000},"text","🗑️ Removing from Lists",{"type":993,"tag":1002,"props":1003,"children":1004},"p",{},[1005],{"type":999,"value":1006},"Removing elements from lists is just as important as adding them. Python provides several methods for removing elements, each suited for different situations - whether you want to remove by value, by position, or clear the entire list.",{"type":993,"tag":1002,"props":1008,"children":1009},{},[1010],{"type":999,"value":1011},"Understanding these removal methods helps you maintain clean data, filter unwanted items, and manage your list contents effectively.",{"type":993,"tag":1013,"props":1014,"children":1015},"code-try",{},[1016],{"type":993,"tag":1017,"props":1018,"children":1021},"pre",{"className":1019,"code":1020,"language":6,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Different ways to remove elements from lists\nfruits = [\"apple\", \"banana\", \"cherry\", \"date\", \"elderberry\"]\nprint(\"Original:\", fruits)\n\n# Remove by value\nfruits.remove(\"banana\")\nprint(\"After remove:\", fruits)\n\n# Remove by index and get the value\nremoved_item = fruits.pop(1)\nprint(\"Popped item:\", removed_item)\nprint(\"After pop:\", fruits)\n\n# Delete by index\ndel fruits[0]\nprint(\"After del:\", fruits)\n",[1022],{"type":993,"tag":1023,"props":1024,"children":1025},"code",{"__ignoreMap":8},[1026,1037,1105,1129,1137,1145,1162,1182,1189,1197,1223,1244,1264,1271,1279,1301],{"type":993,"tag":1027,"props":1028,"children":1030},"span",{"class":1029,"line":12},"line",[1031],{"type":993,"tag":1027,"props":1032,"children":1034},{"style":1033},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[1035],{"type":999,"value":1036},"# Different ways to remove elements from lists\n",{"type":993,"tag":1027,"props":1038,"children":1039},{"class":1029,"line":27},[1040,1046,1052,1057,1063,1068,1073,1077,1082,1086,1091,1095,1100],{"type":993,"tag":1027,"props":1041,"children":1043},{"style":1042},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[1044],{"type":999,"value":1045},"fruits ",{"type":993,"tag":1027,"props":1047,"children":1049},{"style":1048},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[1050],{"type":999,"value":1051},"=",{"type":993,"tag":1027,"props":1053,"children":1054},{"style":1042},[1055],{"type":999,"value":1056}," [",{"type":993,"tag":1027,"props":1058,"children":1060},{"style":1059},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[1061],{"type":999,"value":1062},"\"apple\"",{"type":993,"tag":1027,"props":1064,"children":1065},{"style":1042},[1066],{"type":999,"value":1067},", ",{"type":993,"tag":1027,"props":1069,"children":1070},{"style":1059},[1071],{"type":999,"value":1072},"\"banana\"",{"type":993,"tag":1027,"props":1074,"children":1075},{"style":1042},[1076],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1078,"children":1079},{"style":1059},[1080],{"type":999,"value":1081},"\"cherry\"",{"type":993,"tag":1027,"props":1083,"children":1084},{"style":1042},[1085],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1087,"children":1088},{"style":1059},[1089],{"type":999,"value":1090},"\"date\"",{"type":993,"tag":1027,"props":1092,"children":1093},{"style":1042},[1094],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1096,"children":1097},{"style":1059},[1098],{"type":999,"value":1099},"\"elderberry\"",{"type":993,"tag":1027,"props":1101,"children":1102},{"style":1042},[1103],{"type":999,"value":1104},"]\n",{"type":993,"tag":1027,"props":1106,"children":1107},{"class":1029,"line":36},[1108,1114,1119,1124],{"type":993,"tag":1027,"props":1109,"children":1111},{"style":1110},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[1112],{"type":999,"value":1113},"print",{"type":993,"tag":1027,"props":1115,"children":1116},{"style":1042},[1117],{"type":999,"value":1118},"(",{"type":993,"tag":1027,"props":1120,"children":1121},{"style":1059},[1122],{"type":999,"value":1123},"\"Original:\"",{"type":993,"tag":1027,"props":1125,"children":1126},{"style":1042},[1127],{"type":999,"value":1128},", fruits)\n",{"type":993,"tag":1027,"props":1130,"children":1131},{"class":1029,"line":45},[1132],{"type":993,"tag":1027,"props":1133,"children":1134},{"emptyLinePlaceholder":13},[1135],{"type":999,"value":1136},"\n",{"type":993,"tag":1027,"props":1138,"children":1139},{"class":1029,"line":54},[1140],{"type":993,"tag":1027,"props":1141,"children":1142},{"style":1033},[1143],{"type":999,"value":1144},"# Remove by value\n",{"type":993,"tag":1027,"props":1146,"children":1147},{"class":1029,"line":63},[1148,1153,1157],{"type":993,"tag":1027,"props":1149,"children":1150},{"style":1042},[1151],{"type":999,"value":1152},"fruits.remove(",{"type":993,"tag":1027,"props":1154,"children":1155},{"style":1059},[1156],{"type":999,"value":1072},{"type":993,"tag":1027,"props":1158,"children":1159},{"style":1042},[1160],{"type":999,"value":1161},")\n",{"type":993,"tag":1027,"props":1163,"children":1164},{"class":1029,"line":72},[1165,1169,1173,1178],{"type":993,"tag":1027,"props":1166,"children":1167},{"style":1110},[1168],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1170,"children":1171},{"style":1042},[1172],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1174,"children":1175},{"style":1059},[1176],{"type":999,"value":1177},"\"After remove:\"",{"type":993,"tag":1027,"props":1179,"children":1180},{"style":1042},[1181],{"type":999,"value":1128},{"type":993,"tag":1027,"props":1183,"children":1184},{"class":1029,"line":81},[1185],{"type":993,"tag":1027,"props":1186,"children":1187},{"emptyLinePlaceholder":13},[1188],{"type":999,"value":1136},{"type":993,"tag":1027,"props":1190,"children":1191},{"class":1029,"line":91},[1192],{"type":993,"tag":1027,"props":1193,"children":1194},{"style":1033},[1195],{"type":999,"value":1196},"# Remove by index and get the value\n",{"type":993,"tag":1027,"props":1198,"children":1199},{"class":1029,"line":100},[1200,1205,1209,1214,1219],{"type":993,"tag":1027,"props":1201,"children":1202},{"style":1042},[1203],{"type":999,"value":1204},"removed_item ",{"type":993,"tag":1027,"props":1206,"children":1207},{"style":1048},[1208],{"type":999,"value":1051},{"type":993,"tag":1027,"props":1210,"children":1211},{"style":1042},[1212],{"type":999,"value":1213}," fruits.pop(",{"type":993,"tag":1027,"props":1215,"children":1216},{"style":1110},[1217],{"type":999,"value":1218},"1",{"type":993,"tag":1027,"props":1220,"children":1221},{"style":1042},[1222],{"type":999,"value":1161},{"type":993,"tag":1027,"props":1224,"children":1225},{"class":1029,"line":109},[1226,1230,1234,1239],{"type":993,"tag":1027,"props":1227,"children":1228},{"style":1110},[1229],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1231,"children":1232},{"style":1042},[1233],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1235,"children":1236},{"style":1059},[1237],{"type":999,"value":1238},"\"Popped item:\"",{"type":993,"tag":1027,"props":1240,"children":1241},{"style":1042},[1242],{"type":999,"value":1243},", removed_item)\n",{"type":993,"tag":1027,"props":1245,"children":1246},{"class":1029,"line":118},[1247,1251,1255,1260],{"type":993,"tag":1027,"props":1248,"children":1249},{"style":1110},[1250],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1252,"children":1253},{"style":1042},[1254],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1256,"children":1257},{"style":1059},[1258],{"type":999,"value":1259},"\"After pop:\"",{"type":993,"tag":1027,"props":1261,"children":1262},{"style":1042},[1263],{"type":999,"value":1128},{"type":993,"tag":1027,"props":1265,"children":1266},{"class":1029,"line":127},[1267],{"type":993,"tag":1027,"props":1268,"children":1269},{"emptyLinePlaceholder":13},[1270],{"type":999,"value":1136},{"type":993,"tag":1027,"props":1272,"children":1273},{"class":1029,"line":136},[1274],{"type":993,"tag":1027,"props":1275,"children":1276},{"style":1033},[1277],{"type":999,"value":1278},"# Delete by index\n",{"type":993,"tag":1027,"props":1280,"children":1281},{"class":1029,"line":146},[1282,1287,1292,1297],{"type":993,"tag":1027,"props":1283,"children":1284},{"style":1048},[1285],{"type":999,"value":1286},"del",{"type":993,"tag":1027,"props":1288,"children":1289},{"style":1042},[1290],{"type":999,"value":1291}," fruits[",{"type":993,"tag":1027,"props":1293,"children":1294},{"style":1110},[1295],{"type":999,"value":1296},"0",{"type":993,"tag":1027,"props":1298,"children":1299},{"style":1042},[1300],{"type":999,"value":1104},{"type":993,"tag":1027,"props":1302,"children":1303},{"class":1029,"line":155},[1304,1308,1312,1317],{"type":993,"tag":1027,"props":1305,"children":1306},{"style":1110},[1307],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1309,"children":1310},{"style":1042},[1311],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1313,"children":1314},{"style":1059},[1315],{"type":999,"value":1316},"\"After del:\"",{"type":993,"tag":1027,"props":1318,"children":1319},{"style":1042},[1320],{"type":999,"value":1128},{"type":993,"tag":1322,"props":1323,"children":1325},"h2",{"id":1324},"removing-by-value-with-remove",[1326],{"type":999,"value":1327},"🎯 Removing by Value with remove()",{"type":993,"tag":1002,"props":1329,"children":1330},{},[1331,1333,1339],{"type":999,"value":1332},"The ",{"type":993,"tag":1023,"props":1334,"children":1336},{"className":1335},[],[1337],{"type":999,"value":1338},"remove()",{"type":999,"value":1340}," method deletes the first occurrence of a specific value from the list. This is perfect when you know what item you want to remove but don't know its position.",{"type":993,"tag":1342,"props":1343,"children":1347},"info-box",{"emoji":1344,"title":1345,"type":1346},"🔍","remove() Method Characteristics","info",[1348,1365,1373,1398,1406,1424],{"type":993,"tag":1002,"props":1349,"children":1350},{},[1351,1357,1359],{"type":993,"tag":1352,"props":1353,"children":1354},"strong",{},[1355],{"type":999,"value":1356},"Syntax:",{"type":999,"value":1358}," ",{"type":993,"tag":1023,"props":1360,"children":1362},{"className":1361},[],[1363],{"type":999,"value":1364},"list.remove(value)",{"type":993,"tag":1002,"props":1366,"children":1367},{},[1368],{"type":993,"tag":1352,"props":1369,"children":1370},{},[1371],{"type":999,"value":1372},"Key Features:",{"type":993,"tag":1374,"props":1375,"children":1376},"ul",{},[1377,1383,1388,1393],{"type":993,"tag":1378,"props":1379,"children":1380},"li",{},[1381],{"type":999,"value":1382},"Removes first occurrence of specified value",{"type":993,"tag":1378,"props":1384,"children":1385},{},[1386],{"type":999,"value":1387},"Raises ValueError if value not found",{"type":993,"tag":1378,"props":1389,"children":1390},{},[1391],{"type":999,"value":1392},"Modifies original list (returns None)",{"type":993,"tag":1378,"props":1394,"children":1395},{},[1396],{"type":999,"value":1397},"Searches from beginning to end",{"type":993,"tag":1002,"props":1399,"children":1400},{},[1401],{"type":993,"tag":1352,"props":1402,"children":1403},{},[1404],{"type":999,"value":1405},"Important Limitations:",{"type":993,"tag":1374,"props":1407,"children":1408},{},[1409,1414,1419],{"type":993,"tag":1378,"props":1410,"children":1411},{},[1412],{"type":999,"value":1413},"Only removes first match (not all occurrences)",{"type":993,"tag":1378,"props":1415,"children":1416},{},[1417],{"type":999,"value":1418},"Must handle ValueError for missing items",{"type":993,"tag":1378,"props":1420,"children":1421},{},[1422],{"type":999,"value":1423},"Cannot remove by index (use pop() or del instead)",{"type":993,"tag":1002,"props":1425,"children":1426},{},[1427,1432],{"type":993,"tag":1352,"props":1428,"children":1429},{},[1430],{"type":999,"value":1431},"Use Cases:",{"type":999,"value":1433}," Content-based removal, data cleaning, filtering",{"type":993,"tag":1002,"props":1435,"children":1436},{},[1437],{"type":999,"value":1438},"The remove method is commonly used for cleaning data, removing unwanted items, or filtering lists based on content.",{"type":993,"tag":1440,"props":1441,"children":1443},"h3",{"id":1442},"remove-examples",[1444],{"type":999,"value":1445},"Remove Examples",{"type":993,"tag":1002,"props":1447,"children":1448},{},[1449],{"type":999,"value":1450},"Value-based deletion for content-driven list management:",{"type":993,"tag":1013,"props":1452,"children":1453},{},[1454],{"type":993,"tag":1017,"props":1455,"children":1457},{"className":1019,"code":1456,"language":6,"meta":8,"style":8},"# Using remove() to delete by value\ncolors = [\"red\", \"blue\", \"green\", \"blue\", \"yellow\"]\nprint(\"Original colors:\", colors)\n\n# Remove first occurrence of \"blue\"\ncolors.remove(\"blue\")\nprint(\"After removing blue:\", colors)\n\n# Remove other items\ncolors.remove(\"green\")\nprint(\"After removing green:\", colors)\n\n# Practical shopping list example\nshopping_list = [\"bread\", \"milk\", \"eggs\", \"cheese\", \"butter\"]\nprint(\"Shopping list:\", shopping_list)\n\n# Remove items as we shop\nshopping_list.remove(\"bread\")\nshopping_list.remove(\"milk\")\nprint(\"Still need to buy:\", shopping_list)\n\n# Removing from a list of numbers\nnumbers = [1, 5, 3, 5, 7, 5, 9]\nprint(\"Numbers:\", numbers)\nnumbers.remove(5)  # Removes first 5\nprint(\"After removing first 5:\", numbers)\n",[1458],{"type":993,"tag":1023,"props":1459,"children":1460},{"__ignoreMap":8},[1461,1469,1529,1550,1557,1565,1581,1601,1608,1616,1631,1651,1658,1666,1727,1748,1755,1763,1779,1794,1814,1821,1829,1905,1926,1948],{"type":993,"tag":1027,"props":1462,"children":1463},{"class":1029,"line":12},[1464],{"type":993,"tag":1027,"props":1465,"children":1466},{"style":1033},[1467],{"type":999,"value":1468},"# Using remove() to delete by value\n",{"type":993,"tag":1027,"props":1470,"children":1471},{"class":1029,"line":27},[1472,1477,1481,1485,1490,1494,1499,1503,1508,1512,1516,1520,1525],{"type":993,"tag":1027,"props":1473,"children":1474},{"style":1042},[1475],{"type":999,"value":1476},"colors ",{"type":993,"tag":1027,"props":1478,"children":1479},{"style":1048},[1480],{"type":999,"value":1051},{"type":993,"tag":1027,"props":1482,"children":1483},{"style":1042},[1484],{"type":999,"value":1056},{"type":993,"tag":1027,"props":1486,"children":1487},{"style":1059},[1488],{"type":999,"value":1489},"\"red\"",{"type":993,"tag":1027,"props":1491,"children":1492},{"style":1042},[1493],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1495,"children":1496},{"style":1059},[1497],{"type":999,"value":1498},"\"blue\"",{"type":993,"tag":1027,"props":1500,"children":1501},{"style":1042},[1502],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1504,"children":1505},{"style":1059},[1506],{"type":999,"value":1507},"\"green\"",{"type":993,"tag":1027,"props":1509,"children":1510},{"style":1042},[1511],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1513,"children":1514},{"style":1059},[1515],{"type":999,"value":1498},{"type":993,"tag":1027,"props":1517,"children":1518},{"style":1042},[1519],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1521,"children":1522},{"style":1059},[1523],{"type":999,"value":1524},"\"yellow\"",{"type":993,"tag":1027,"props":1526,"children":1527},{"style":1042},[1528],{"type":999,"value":1104},{"type":993,"tag":1027,"props":1530,"children":1531},{"class":1029,"line":36},[1532,1536,1540,1545],{"type":993,"tag":1027,"props":1533,"children":1534},{"style":1110},[1535],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1537,"children":1538},{"style":1042},[1539],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1541,"children":1542},{"style":1059},[1543],{"type":999,"value":1544},"\"Original colors:\"",{"type":993,"tag":1027,"props":1546,"children":1547},{"style":1042},[1548],{"type":999,"value":1549},", colors)\n",{"type":993,"tag":1027,"props":1551,"children":1552},{"class":1029,"line":45},[1553],{"type":993,"tag":1027,"props":1554,"children":1555},{"emptyLinePlaceholder":13},[1556],{"type":999,"value":1136},{"type":993,"tag":1027,"props":1558,"children":1559},{"class":1029,"line":54},[1560],{"type":993,"tag":1027,"props":1561,"children":1562},{"style":1033},[1563],{"type":999,"value":1564},"# Remove first occurrence of \"blue\"\n",{"type":993,"tag":1027,"props":1566,"children":1567},{"class":1029,"line":63},[1568,1573,1577],{"type":993,"tag":1027,"props":1569,"children":1570},{"style":1042},[1571],{"type":999,"value":1572},"colors.remove(",{"type":993,"tag":1027,"props":1574,"children":1575},{"style":1059},[1576],{"type":999,"value":1498},{"type":993,"tag":1027,"props":1578,"children":1579},{"style":1042},[1580],{"type":999,"value":1161},{"type":993,"tag":1027,"props":1582,"children":1583},{"class":1029,"line":72},[1584,1588,1592,1597],{"type":993,"tag":1027,"props":1585,"children":1586},{"style":1110},[1587],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1589,"children":1590},{"style":1042},[1591],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1593,"children":1594},{"style":1059},[1595],{"type":999,"value":1596},"\"After removing blue:\"",{"type":993,"tag":1027,"props":1598,"children":1599},{"style":1042},[1600],{"type":999,"value":1549},{"type":993,"tag":1027,"props":1602,"children":1603},{"class":1029,"line":81},[1604],{"type":993,"tag":1027,"props":1605,"children":1606},{"emptyLinePlaceholder":13},[1607],{"type":999,"value":1136},{"type":993,"tag":1027,"props":1609,"children":1610},{"class":1029,"line":91},[1611],{"type":993,"tag":1027,"props":1612,"children":1613},{"style":1033},[1614],{"type":999,"value":1615},"# Remove other items\n",{"type":993,"tag":1027,"props":1617,"children":1618},{"class":1029,"line":100},[1619,1623,1627],{"type":993,"tag":1027,"props":1620,"children":1621},{"style":1042},[1622],{"type":999,"value":1572},{"type":993,"tag":1027,"props":1624,"children":1625},{"style":1059},[1626],{"type":999,"value":1507},{"type":993,"tag":1027,"props":1628,"children":1629},{"style":1042},[1630],{"type":999,"value":1161},{"type":993,"tag":1027,"props":1632,"children":1633},{"class":1029,"line":109},[1634,1638,1642,1647],{"type":993,"tag":1027,"props":1635,"children":1636},{"style":1110},[1637],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1639,"children":1640},{"style":1042},[1641],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1643,"children":1644},{"style":1059},[1645],{"type":999,"value":1646},"\"After removing green:\"",{"type":993,"tag":1027,"props":1648,"children":1649},{"style":1042},[1650],{"type":999,"value":1549},{"type":993,"tag":1027,"props":1652,"children":1653},{"class":1029,"line":118},[1654],{"type":993,"tag":1027,"props":1655,"children":1656},{"emptyLinePlaceholder":13},[1657],{"type":999,"value":1136},{"type":993,"tag":1027,"props":1659,"children":1660},{"class":1029,"line":127},[1661],{"type":993,"tag":1027,"props":1662,"children":1663},{"style":1033},[1664],{"type":999,"value":1665},"# Practical shopping list example\n",{"type":993,"tag":1027,"props":1667,"children":1668},{"class":1029,"line":136},[1669,1674,1678,1682,1687,1691,1696,1700,1705,1709,1714,1718,1723],{"type":993,"tag":1027,"props":1670,"children":1671},{"style":1042},[1672],{"type":999,"value":1673},"shopping_list ",{"type":993,"tag":1027,"props":1675,"children":1676},{"style":1048},[1677],{"type":999,"value":1051},{"type":993,"tag":1027,"props":1679,"children":1680},{"style":1042},[1681],{"type":999,"value":1056},{"type":993,"tag":1027,"props":1683,"children":1684},{"style":1059},[1685],{"type":999,"value":1686},"\"bread\"",{"type":993,"tag":1027,"props":1688,"children":1689},{"style":1042},[1690],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1692,"children":1693},{"style":1059},[1694],{"type":999,"value":1695},"\"milk\"",{"type":993,"tag":1027,"props":1697,"children":1698},{"style":1042},[1699],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1701,"children":1702},{"style":1059},[1703],{"type":999,"value":1704},"\"eggs\"",{"type":993,"tag":1027,"props":1706,"children":1707},{"style":1042},[1708],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1710,"children":1711},{"style":1059},[1712],{"type":999,"value":1713},"\"cheese\"",{"type":993,"tag":1027,"props":1715,"children":1716},{"style":1042},[1717],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1719,"children":1720},{"style":1059},[1721],{"type":999,"value":1722},"\"butter\"",{"type":993,"tag":1027,"props":1724,"children":1725},{"style":1042},[1726],{"type":999,"value":1104},{"type":993,"tag":1027,"props":1728,"children":1729},{"class":1029,"line":146},[1730,1734,1738,1743],{"type":993,"tag":1027,"props":1731,"children":1732},{"style":1110},[1733],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1735,"children":1736},{"style":1042},[1737],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1739,"children":1740},{"style":1059},[1741],{"type":999,"value":1742},"\"Shopping list:\"",{"type":993,"tag":1027,"props":1744,"children":1745},{"style":1042},[1746],{"type":999,"value":1747},", shopping_list)\n",{"type":993,"tag":1027,"props":1749,"children":1750},{"class":1029,"line":155},[1751],{"type":993,"tag":1027,"props":1752,"children":1753},{"emptyLinePlaceholder":13},[1754],{"type":999,"value":1136},{"type":993,"tag":1027,"props":1756,"children":1757},{"class":1029,"line":164},[1758],{"type":993,"tag":1027,"props":1759,"children":1760},{"style":1033},[1761],{"type":999,"value":1762},"# Remove items as we shop\n",{"type":993,"tag":1027,"props":1764,"children":1765},{"class":1029,"line":173},[1766,1771,1775],{"type":993,"tag":1027,"props":1767,"children":1768},{"style":1042},[1769],{"type":999,"value":1770},"shopping_list.remove(",{"type":993,"tag":1027,"props":1772,"children":1773},{"style":1059},[1774],{"type":999,"value":1686},{"type":993,"tag":1027,"props":1776,"children":1777},{"style":1042},[1778],{"type":999,"value":1161},{"type":993,"tag":1027,"props":1780,"children":1781},{"class":1029,"line":182},[1782,1786,1790],{"type":993,"tag":1027,"props":1783,"children":1784},{"style":1042},[1785],{"type":999,"value":1770},{"type":993,"tag":1027,"props":1787,"children":1788},{"style":1059},[1789],{"type":999,"value":1695},{"type":993,"tag":1027,"props":1791,"children":1792},{"style":1042},[1793],{"type":999,"value":1161},{"type":993,"tag":1027,"props":1795,"children":1796},{"class":1029,"line":191},[1797,1801,1805,1810],{"type":993,"tag":1027,"props":1798,"children":1799},{"style":1110},[1800],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1802,"children":1803},{"style":1042},[1804],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1806,"children":1807},{"style":1059},[1808],{"type":999,"value":1809},"\"Still need to buy:\"",{"type":993,"tag":1027,"props":1811,"children":1812},{"style":1042},[1813],{"type":999,"value":1747},{"type":993,"tag":1027,"props":1815,"children":1816},{"class":1029,"line":201},[1817],{"type":993,"tag":1027,"props":1818,"children":1819},{"emptyLinePlaceholder":13},[1820],{"type":999,"value":1136},{"type":993,"tag":1027,"props":1822,"children":1823},{"class":1029,"line":210},[1824],{"type":993,"tag":1027,"props":1825,"children":1826},{"style":1033},[1827],{"type":999,"value":1828},"# Removing from a list of numbers\n",{"type":993,"tag":1027,"props":1830,"children":1831},{"class":1029,"line":219},[1832,1837,1841,1845,1849,1853,1858,1862,1867,1871,1875,1879,1884,1888,1892,1896,1901],{"type":993,"tag":1027,"props":1833,"children":1834},{"style":1042},[1835],{"type":999,"value":1836},"numbers ",{"type":993,"tag":1027,"props":1838,"children":1839},{"style":1048},[1840],{"type":999,"value":1051},{"type":993,"tag":1027,"props":1842,"children":1843},{"style":1042},[1844],{"type":999,"value":1056},{"type":993,"tag":1027,"props":1846,"children":1847},{"style":1110},[1848],{"type":999,"value":1218},{"type":993,"tag":1027,"props":1850,"children":1851},{"style":1042},[1852],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1854,"children":1855},{"style":1110},[1856],{"type":999,"value":1857},"5",{"type":993,"tag":1027,"props":1859,"children":1860},{"style":1042},[1861],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1863,"children":1864},{"style":1110},[1865],{"type":999,"value":1866},"3",{"type":993,"tag":1027,"props":1868,"children":1869},{"style":1042},[1870],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1872,"children":1873},{"style":1110},[1874],{"type":999,"value":1857},{"type":993,"tag":1027,"props":1876,"children":1877},{"style":1042},[1878],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1880,"children":1881},{"style":1110},[1882],{"type":999,"value":1883},"7",{"type":993,"tag":1027,"props":1885,"children":1886},{"style":1042},[1887],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1889,"children":1890},{"style":1110},[1891],{"type":999,"value":1857},{"type":993,"tag":1027,"props":1893,"children":1894},{"style":1042},[1895],{"type":999,"value":1067},{"type":993,"tag":1027,"props":1897,"children":1898},{"style":1110},[1899],{"type":999,"value":1900},"9",{"type":993,"tag":1027,"props":1902,"children":1903},{"style":1042},[1904],{"type":999,"value":1104},{"type":993,"tag":1027,"props":1906,"children":1907},{"class":1029,"line":228},[1908,1912,1916,1921],{"type":993,"tag":1027,"props":1909,"children":1910},{"style":1110},[1911],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1913,"children":1914},{"style":1042},[1915],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1917,"children":1918},{"style":1059},[1919],{"type":999,"value":1920},"\"Numbers:\"",{"type":993,"tag":1027,"props":1922,"children":1923},{"style":1042},[1924],{"type":999,"value":1925},", numbers)\n",{"type":993,"tag":1027,"props":1927,"children":1928},{"class":1029,"line":238},[1929,1934,1938,1943],{"type":993,"tag":1027,"props":1930,"children":1931},{"style":1042},[1932],{"type":999,"value":1933},"numbers.remove(",{"type":993,"tag":1027,"props":1935,"children":1936},{"style":1110},[1937],{"type":999,"value":1857},{"type":993,"tag":1027,"props":1939,"children":1940},{"style":1042},[1941],{"type":999,"value":1942},")  ",{"type":993,"tag":1027,"props":1944,"children":1945},{"style":1033},[1946],{"type":999,"value":1947},"# Removes first 5\n",{"type":993,"tag":1027,"props":1949,"children":1950},{"class":1029,"line":247},[1951,1955,1959,1964],{"type":993,"tag":1027,"props":1952,"children":1953},{"style":1110},[1954],{"type":999,"value":1113},{"type":993,"tag":1027,"props":1956,"children":1957},{"style":1042},[1958],{"type":999,"value":1118},{"type":993,"tag":1027,"props":1960,"children":1961},{"style":1059},[1962],{"type":999,"value":1963},"\"After removing first 5:\"",{"type":993,"tag":1027,"props":1965,"children":1966},{"style":1042},[1967],{"type":999,"value":1925},{"type":993,"tag":1322,"props":1969,"children":1971},{"id":1970},"removing-by-position-with-pop",[1972],{"type":999,"value":1973},"📍 Removing by Position with pop()",{"type":993,"tag":1002,"props":1975,"children":1976},{},[1977,1978,1984],{"type":999,"value":1332},{"type":993,"tag":1023,"props":1979,"children":1981},{"className":1980},[],[1982],{"type":999,"value":1983},"pop()",{"type":999,"value":1985}," method removes an element at a specific position and returns that element. If no index is provided, it removes and returns the last element.",{"type":993,"tag":1342,"props":1987,"children":1991},{"emoji":1988,"title":1989,"type":1990},"🎪","pop() Method Benefits","success",[1992,2016,2024,2047,2055,2073],{"type":993,"tag":1002,"props":1993,"children":1994},{},[1995,1999,2000,2006,2008,2014],{"type":993,"tag":1352,"props":1996,"children":1997},{},[1998],{"type":999,"value":1356},{"type":999,"value":1358},{"type":993,"tag":1023,"props":2001,"children":2003},{"className":2002},[],[2004],{"type":999,"value":2005},"list.pop(index)",{"type":999,"value":2007}," or ",{"type":993,"tag":1023,"props":2009,"children":2011},{"className":2010},[],[2012],{"type":999,"value":2013},"list.pop()",{"type":999,"value":2015}," (for last item)",{"type":993,"tag":1002,"props":2017,"children":2018},{},[2019],{"type":993,"tag":1352,"props":2020,"children":2021},{},[2022],{"type":999,"value":2023},"Key Advantages:",{"type":993,"tag":1374,"props":2025,"children":2026},{},[2027,2032,2037,2042],{"type":993,"tag":1378,"props":2028,"children":2029},{},[2030],{"type":999,"value":2031},"Removes element AND returns its value",{"type":993,"tag":1378,"props":2033,"children":2034},{},[2035],{"type":999,"value":2036},"Default behavior removes last element",{"type":993,"tag":1378,"props":2038,"children":2039},{},[2040],{"type":999,"value":2041},"Raises IndexError for invalid indices",{"type":993,"tag":1378,"props":2043,"children":2044},{},[2045],{"type":999,"value":2046},"Perfect for stack operations (LIFO)",{"type":993,"tag":1002,"props":2048,"children":2049},{},[2050],{"type":993,"tag":1352,"props":2051,"children":2052},{},[2053],{"type":999,"value":2054},"Return Value:",{"type":993,"tag":1374,"props":2056,"children":2057},{},[2058,2063,2068],{"type":993,"tag":1378,"props":2059,"children":2060},{},[2061],{"type":999,"value":2062},"Returns the removed element",{"type":993,"tag":1378,"props":2064,"children":2065},{},[2066],{"type":999,"value":2067},"Allows you to use the removed value",{"type":993,"tag":1378,"props":2069,"children":2070},{},[2071],{"type":999,"value":2072},"Enables stack-like data structures",{"type":993,"tag":1002,"props":2074,"children":2075},{},[2076,2081],{"type":993,"tag":1352,"props":2077,"children":2078},{},[2079],{"type":999,"value":2080},"Performance:",{"type":999,"value":2082}," O(1) for last element, O(n) for other positions",{"type":993,"tag":1002,"props":2084,"children":2085},{},[2086],{"type":999,"value":2087},"Pop is useful when you need both to remove an item and use its value, or when working with lists as stacks (last-in, first-out).",{"type":993,"tag":1440,"props":2089,"children":2091},{"id":2090},"pop-examples",[2092],{"type":999,"value":2093},"Pop Examples",{"type":993,"tag":1002,"props":2095,"children":2096},{},[2097],{"type":999,"value":2098},"Position-based removal with value retrieval for data processing:",{"type":993,"tag":1013,"props":2100,"children":2101},{},[2102],{"type":993,"tag":1017,"props":2103,"children":2105},{"className":1019,"code":2104,"language":6,"meta":8,"style":8},"# Using pop() to remove by position\ntasks = [\"wake up\", \"brush teeth\", \"eat breakfast\", \"go to work\"]\nprint(\"Morning tasks:\", tasks)\n\n# Remove and get the last task\nlast_task = tasks.pop()\nprint(\"Completed task:\", last_task)\nprint(\"Remaining tasks:\", tasks)\n\n# Remove and get task at specific position\nfirst_task = tasks.pop(0)\nprint(\"Completed task:\", first_task)\nprint(\"Remaining tasks:\", tasks)\n\n# Using pop() with a stack-like list\nstack = [1, 2, 3, 4, 5]\nprint(\"Stack:\", stack)\n\n# Remove items from the top (end)\nwhile stack:\n    item = stack.pop()\n    print(f\"Popped: {item}, Stack now: {stack}\")\n\n# Working with a list of scores\nscores = [85, 92, 78, 96, 88]\nprint(\"All scores:\", scores)\n\n# Remove the lowest score (assuming it's at index 2)\nremoved_score = scores.pop(2)\nprint(f\"Removed score: {removed_score}\")\nprint(\"Remaining scores:\", scores)\n",[2106],{"type":993,"tag":1023,"props":2107,"children":2108},{"__ignoreMap":8},[2109,2117,2169,2190,2197,2205,2222,2243,2263,2270,2278,2303,2323,2342,2349,2357,2415,2436,2443,2451,2464,2481,2545,2552,2560,2621,2642,2649,2657,2682,2723],{"type":993,"tag":1027,"props":2110,"children":2111},{"class":1029,"line":12},[2112],{"type":993,"tag":1027,"props":2113,"children":2114},{"style":1033},[2115],{"type":999,"value":2116},"# Using pop() to remove by position\n",{"type":993,"tag":1027,"props":2118,"children":2119},{"class":1029,"line":27},[2120,2125,2129,2133,2138,2142,2147,2151,2156,2160,2165],{"type":993,"tag":1027,"props":2121,"children":2122},{"style":1042},[2123],{"type":999,"value":2124},"tasks ",{"type":993,"tag":1027,"props":2126,"children":2127},{"style":1048},[2128],{"type":999,"value":1051},{"type":993,"tag":1027,"props":2130,"children":2131},{"style":1042},[2132],{"type":999,"value":1056},{"type":993,"tag":1027,"props":2134,"children":2135},{"style":1059},[2136],{"type":999,"value":2137},"\"wake up\"",{"type":993,"tag":1027,"props":2139,"children":2140},{"style":1042},[2141],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2143,"children":2144},{"style":1059},[2145],{"type":999,"value":2146},"\"brush teeth\"",{"type":993,"tag":1027,"props":2148,"children":2149},{"style":1042},[2150],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2152,"children":2153},{"style":1059},[2154],{"type":999,"value":2155},"\"eat breakfast\"",{"type":993,"tag":1027,"props":2157,"children":2158},{"style":1042},[2159],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2161,"children":2162},{"style":1059},[2163],{"type":999,"value":2164},"\"go to work\"",{"type":993,"tag":1027,"props":2166,"children":2167},{"style":1042},[2168],{"type":999,"value":1104},{"type":993,"tag":1027,"props":2170,"children":2171},{"class":1029,"line":36},[2172,2176,2180,2185],{"type":993,"tag":1027,"props":2173,"children":2174},{"style":1110},[2175],{"type":999,"value":1113},{"type":993,"tag":1027,"props":2177,"children":2178},{"style":1042},[2179],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2181,"children":2182},{"style":1059},[2183],{"type":999,"value":2184},"\"Morning tasks:\"",{"type":993,"tag":1027,"props":2186,"children":2187},{"style":1042},[2188],{"type":999,"value":2189},", tasks)\n",{"type":993,"tag":1027,"props":2191,"children":2192},{"class":1029,"line":45},[2193],{"type":993,"tag":1027,"props":2194,"children":2195},{"emptyLinePlaceholder":13},[2196],{"type":999,"value":1136},{"type":993,"tag":1027,"props":2198,"children":2199},{"class":1029,"line":54},[2200],{"type":993,"tag":1027,"props":2201,"children":2202},{"style":1033},[2203],{"type":999,"value":2204},"# Remove and get the last task\n",{"type":993,"tag":1027,"props":2206,"children":2207},{"class":1029,"line":63},[2208,2213,2217],{"type":993,"tag":1027,"props":2209,"children":2210},{"style":1042},[2211],{"type":999,"value":2212},"last_task ",{"type":993,"tag":1027,"props":2214,"children":2215},{"style":1048},[2216],{"type":999,"value":1051},{"type":993,"tag":1027,"props":2218,"children":2219},{"style":1042},[2220],{"type":999,"value":2221}," tasks.pop()\n",{"type":993,"tag":1027,"props":2223,"children":2224},{"class":1029,"line":72},[2225,2229,2233,2238],{"type":993,"tag":1027,"props":2226,"children":2227},{"style":1110},[2228],{"type":999,"value":1113},{"type":993,"tag":1027,"props":2230,"children":2231},{"style":1042},[2232],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2234,"children":2235},{"style":1059},[2236],{"type":999,"value":2237},"\"Completed task:\"",{"type":993,"tag":1027,"props":2239,"children":2240},{"style":1042},[2241],{"type":999,"value":2242},", last_task)\n",{"type":993,"tag":1027,"props":2244,"children":2245},{"class":1029,"line":81},[2246,2250,2254,2259],{"type":993,"tag":1027,"props":2247,"children":2248},{"style":1110},[2249],{"type":999,"value":1113},{"type":993,"tag":1027,"props":2251,"children":2252},{"style":1042},[2253],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2255,"children":2256},{"style":1059},[2257],{"type":999,"value":2258},"\"Remaining tasks:\"",{"type":993,"tag":1027,"props":2260,"children":2261},{"style":1042},[2262],{"type":999,"value":2189},{"type":993,"tag":1027,"props":2264,"children":2265},{"class":1029,"line":91},[2266],{"type":993,"tag":1027,"props":2267,"children":2268},{"emptyLinePlaceholder":13},[2269],{"type":999,"value":1136},{"type":993,"tag":1027,"props":2271,"children":2272},{"class":1029,"line":100},[2273],{"type":993,"tag":1027,"props":2274,"children":2275},{"style":1033},[2276],{"type":999,"value":2277},"# Remove and get task at specific position\n",{"type":993,"tag":1027,"props":2279,"children":2280},{"class":1029,"line":109},[2281,2286,2290,2295,2299],{"type":993,"tag":1027,"props":2282,"children":2283},{"style":1042},[2284],{"type":999,"value":2285},"first_task ",{"type":993,"tag":1027,"props":2287,"children":2288},{"style":1048},[2289],{"type":999,"value":1051},{"type":993,"tag":1027,"props":2291,"children":2292},{"style":1042},[2293],{"type":999,"value":2294}," tasks.pop(",{"type":993,"tag":1027,"props":2296,"children":2297},{"style":1110},[2298],{"type":999,"value":1296},{"type":993,"tag":1027,"props":2300,"children":2301},{"style":1042},[2302],{"type":999,"value":1161},{"type":993,"tag":1027,"props":2304,"children":2305},{"class":1029,"line":118},[2306,2310,2314,2318],{"type":993,"tag":1027,"props":2307,"children":2308},{"style":1110},[2309],{"type":999,"value":1113},{"type":993,"tag":1027,"props":2311,"children":2312},{"style":1042},[2313],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2315,"children":2316},{"style":1059},[2317],{"type":999,"value":2237},{"type":993,"tag":1027,"props":2319,"children":2320},{"style":1042},[2321],{"type":999,"value":2322},", first_task)\n",{"type":993,"tag":1027,"props":2324,"children":2325},{"class":1029,"line":127},[2326,2330,2334,2338],{"type":993,"tag":1027,"props":2327,"children":2328},{"style":1110},[2329],{"type":999,"value":1113},{"type":993,"tag":1027,"props":2331,"children":2332},{"style":1042},[2333],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2335,"children":2336},{"style":1059},[2337],{"type":999,"value":2258},{"type":993,"tag":1027,"props":2339,"children":2340},{"style":1042},[2341],{"type":999,"value":2189},{"type":993,"tag":1027,"props":2343,"children":2344},{"class":1029,"line":136},[2345],{"type":993,"tag":1027,"props":2346,"children":2347},{"emptyLinePlaceholder":13},[2348],{"type":999,"value":1136},{"type":993,"tag":1027,"props":2350,"children":2351},{"class":1029,"line":146},[2352],{"type":993,"tag":1027,"props":2353,"children":2354},{"style":1033},[2355],{"type":999,"value":2356},"# Using pop() with a stack-like list\n",{"type":993,"tag":1027,"props":2358,"children":2359},{"class":1029,"line":155},[2360,2365,2369,2373,2377,2381,2386,2390,2394,2398,2403,2407,2411],{"type":993,"tag":1027,"props":2361,"children":2362},{"style":1042},[2363],{"type":999,"value":2364},"stack ",{"type":993,"tag":1027,"props":2366,"children":2367},{"style":1048},[2368],{"type":999,"value":1051},{"type":993,"tag":1027,"props":2370,"children":2371},{"style":1042},[2372],{"type":999,"value":1056},{"type":993,"tag":1027,"props":2374,"children":2375},{"style":1110},[2376],{"type":999,"value":1218},{"type":993,"tag":1027,"props":2378,"children":2379},{"style":1042},[2380],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2382,"children":2383},{"style":1110},[2384],{"type":999,"value":2385},"2",{"type":993,"tag":1027,"props":2387,"children":2388},{"style":1042},[2389],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2391,"children":2392},{"style":1110},[2393],{"type":999,"value":1866},{"type":993,"tag":1027,"props":2395,"children":2396},{"style":1042},[2397],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2399,"children":2400},{"style":1110},[2401],{"type":999,"value":2402},"4",{"type":993,"tag":1027,"props":2404,"children":2405},{"style":1042},[2406],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2408,"children":2409},{"style":1110},[2410],{"type":999,"value":1857},{"type":993,"tag":1027,"props":2412,"children":2413},{"style":1042},[2414],{"type":999,"value":1104},{"type":993,"tag":1027,"props":2416,"children":2417},{"class":1029,"line":164},[2418,2422,2426,2431],{"type":993,"tag":1027,"props":2419,"children":2420},{"style":1110},[2421],{"type":999,"value":1113},{"type":993,"tag":1027,"props":2423,"children":2424},{"style":1042},[2425],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2427,"children":2428},{"style":1059},[2429],{"type":999,"value":2430},"\"Stack:\"",{"type":993,"tag":1027,"props":2432,"children":2433},{"style":1042},[2434],{"type":999,"value":2435},", stack)\n",{"type":993,"tag":1027,"props":2437,"children":2438},{"class":1029,"line":173},[2439],{"type":993,"tag":1027,"props":2440,"children":2441},{"emptyLinePlaceholder":13},[2442],{"type":999,"value":1136},{"type":993,"tag":1027,"props":2444,"children":2445},{"class":1029,"line":182},[2446],{"type":993,"tag":1027,"props":2447,"children":2448},{"style":1033},[2449],{"type":999,"value":2450},"# Remove items from the top (end)\n",{"type":993,"tag":1027,"props":2452,"children":2453},{"class":1029,"line":191},[2454,2459],{"type":993,"tag":1027,"props":2455,"children":2456},{"style":1048},[2457],{"type":999,"value":2458},"while",{"type":993,"tag":1027,"props":2460,"children":2461},{"style":1042},[2462],{"type":999,"value":2463}," stack:\n",{"type":993,"tag":1027,"props":2465,"children":2466},{"class":1029,"line":201},[2467,2472,2476],{"type":993,"tag":1027,"props":2468,"children":2469},{"style":1042},[2470],{"type":999,"value":2471},"    item ",{"type":993,"tag":1027,"props":2473,"children":2474},{"style":1048},[2475],{"type":999,"value":1051},{"type":993,"tag":1027,"props":2477,"children":2478},{"style":1042},[2479],{"type":999,"value":2480}," stack.pop()\n",{"type":993,"tag":1027,"props":2482,"children":2483},{"class":1029,"line":210},[2484,2489,2493,2498,2503,2508,2513,2518,2523,2527,2532,2536,2541],{"type":993,"tag":1027,"props":2485,"children":2486},{"style":1110},[2487],{"type":999,"value":2488},"    print",{"type":993,"tag":1027,"props":2490,"children":2491},{"style":1042},[2492],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2494,"children":2495},{"style":1048},[2496],{"type":999,"value":2497},"f",{"type":993,"tag":1027,"props":2499,"children":2500},{"style":1059},[2501],{"type":999,"value":2502},"\"Popped: ",{"type":993,"tag":1027,"props":2504,"children":2505},{"style":1110},[2506],{"type":999,"value":2507},"{",{"type":993,"tag":1027,"props":2509,"children":2510},{"style":1042},[2511],{"type":999,"value":2512},"item",{"type":993,"tag":1027,"props":2514,"children":2515},{"style":1110},[2516],{"type":999,"value":2517},"}",{"type":993,"tag":1027,"props":2519,"children":2520},{"style":1059},[2521],{"type":999,"value":2522},", Stack now: ",{"type":993,"tag":1027,"props":2524,"children":2525},{"style":1110},[2526],{"type":999,"value":2507},{"type":993,"tag":1027,"props":2528,"children":2529},{"style":1042},[2530],{"type":999,"value":2531},"stack",{"type":993,"tag":1027,"props":2533,"children":2534},{"style":1110},[2535],{"type":999,"value":2517},{"type":993,"tag":1027,"props":2537,"children":2538},{"style":1059},[2539],{"type":999,"value":2540},"\"",{"type":993,"tag":1027,"props":2542,"children":2543},{"style":1042},[2544],{"type":999,"value":1161},{"type":993,"tag":1027,"props":2546,"children":2547},{"class":1029,"line":219},[2548],{"type":993,"tag":1027,"props":2549,"children":2550},{"emptyLinePlaceholder":13},[2551],{"type":999,"value":1136},{"type":993,"tag":1027,"props":2553,"children":2554},{"class":1029,"line":228},[2555],{"type":993,"tag":1027,"props":2556,"children":2557},{"style":1033},[2558],{"type":999,"value":2559},"# Working with a list of scores\n",{"type":993,"tag":1027,"props":2561,"children":2562},{"class":1029,"line":238},[2563,2568,2572,2576,2581,2585,2590,2594,2599,2603,2608,2612,2617],{"type":993,"tag":1027,"props":2564,"children":2565},{"style":1042},[2566],{"type":999,"value":2567},"scores ",{"type":993,"tag":1027,"props":2569,"children":2570},{"style":1048},[2571],{"type":999,"value":1051},{"type":993,"tag":1027,"props":2573,"children":2574},{"style":1042},[2575],{"type":999,"value":1056},{"type":993,"tag":1027,"props":2577,"children":2578},{"style":1110},[2579],{"type":999,"value":2580},"85",{"type":993,"tag":1027,"props":2582,"children":2583},{"style":1042},[2584],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2586,"children":2587},{"style":1110},[2588],{"type":999,"value":2589},"92",{"type":993,"tag":1027,"props":2591,"children":2592},{"style":1042},[2593],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2595,"children":2596},{"style":1110},[2597],{"type":999,"value":2598},"78",{"type":993,"tag":1027,"props":2600,"children":2601},{"style":1042},[2602],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2604,"children":2605},{"style":1110},[2606],{"type":999,"value":2607},"96",{"type":993,"tag":1027,"props":2609,"children":2610},{"style":1042},[2611],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2613,"children":2614},{"style":1110},[2615],{"type":999,"value":2616},"88",{"type":993,"tag":1027,"props":2618,"children":2619},{"style":1042},[2620],{"type":999,"value":1104},{"type":993,"tag":1027,"props":2622,"children":2623},{"class":1029,"line":247},[2624,2628,2632,2637],{"type":993,"tag":1027,"props":2625,"children":2626},{"style":1110},[2627],{"type":999,"value":1113},{"type":993,"tag":1027,"props":2629,"children":2630},{"style":1042},[2631],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2633,"children":2634},{"style":1059},[2635],{"type":999,"value":2636},"\"All scores:\"",{"type":993,"tag":1027,"props":2638,"children":2639},{"style":1042},[2640],{"type":999,"value":2641},", scores)\n",{"type":993,"tag":1027,"props":2643,"children":2644},{"class":1029,"line":256},[2645],{"type":993,"tag":1027,"props":2646,"children":2647},{"emptyLinePlaceholder":13},[2648],{"type":999,"value":1136},{"type":993,"tag":1027,"props":2650,"children":2651},{"class":1029,"line":265},[2652],{"type":993,"tag":1027,"props":2653,"children":2654},{"style":1033},[2655],{"type":999,"value":2656},"# Remove the lowest score (assuming it's at index 2)\n",{"type":993,"tag":1027,"props":2658,"children":2659},{"class":1029,"line":274},[2660,2665,2669,2674,2678],{"type":993,"tag":1027,"props":2661,"children":2662},{"style":1042},[2663],{"type":999,"value":2664},"removed_score ",{"type":993,"tag":1027,"props":2666,"children":2667},{"style":1048},[2668],{"type":999,"value":1051},{"type":993,"tag":1027,"props":2670,"children":2671},{"style":1042},[2672],{"type":999,"value":2673}," scores.pop(",{"type":993,"tag":1027,"props":2675,"children":2676},{"style":1110},[2677],{"type":999,"value":2385},{"type":993,"tag":1027,"props":2679,"children":2680},{"style":1042},[2681],{"type":999,"value":1161},{"type":993,"tag":1027,"props":2683,"children":2684},{"class":1029,"line":284},[2685,2689,2693,2697,2702,2706,2711,2715,2719],{"type":993,"tag":1027,"props":2686,"children":2687},{"style":1110},[2688],{"type":999,"value":1113},{"type":993,"tag":1027,"props":2690,"children":2691},{"style":1042},[2692],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2694,"children":2695},{"style":1048},[2696],{"type":999,"value":2497},{"type":993,"tag":1027,"props":2698,"children":2699},{"style":1059},[2700],{"type":999,"value":2701},"\"Removed score: ",{"type":993,"tag":1027,"props":2703,"children":2704},{"style":1110},[2705],{"type":999,"value":2507},{"type":993,"tag":1027,"props":2707,"children":2708},{"style":1042},[2709],{"type":999,"value":2710},"removed_score",{"type":993,"tag":1027,"props":2712,"children":2713},{"style":1110},[2714],{"type":999,"value":2517},{"type":993,"tag":1027,"props":2716,"children":2717},{"style":1059},[2718],{"type":999,"value":2540},{"type":993,"tag":1027,"props":2720,"children":2721},{"style":1042},[2722],{"type":999,"value":1161},{"type":993,"tag":1027,"props":2724,"children":2725},{"class":1029,"line":293},[2726,2730,2734,2739],{"type":993,"tag":1027,"props":2727,"children":2728},{"style":1110},[2729],{"type":999,"value":1113},{"type":993,"tag":1027,"props":2731,"children":2732},{"style":1042},[2733],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2735,"children":2736},{"style":1059},[2737],{"type":999,"value":2738},"\"Remaining scores:\"",{"type":993,"tag":1027,"props":2740,"children":2741},{"style":1042},[2742],{"type":999,"value":2641},{"type":993,"tag":2744,"props":2745,"children":2747},"content-exercise",{":widget-view":2746,"category":6,"id":319},"true",[],{"type":993,"tag":1322,"props":2749,"children":2751},{"id":2750},"️-deleting-by-position-with-del",[2752],{"type":999,"value":2753},"🗂️ Deleting by Position with del",{"type":993,"tag":1002,"props":2755,"children":2756},{},[2757,2758,2763],{"type":999,"value":1332},{"type":993,"tag":1023,"props":2759,"children":2761},{"className":2760},[],[2762],{"type":999,"value":1286},{"type":999,"value":2764}," statement removes an element at a specific index or deletes entire slices of a list. Unlike pop, del doesn't return the removed element.",{"type":993,"tag":1342,"props":2766,"children":2770},{"emoji":2767,"title":2768,"type":2769},"⚡","del Statement Capabilities","warning",[2771,2792,2799,2822,2830,2866],{"type":993,"tag":1002,"props":2772,"children":2773},{},[2774,2778,2779,2785,2786],{"type":993,"tag":1352,"props":2775,"children":2776},{},[2777],{"type":999,"value":1356},{"type":999,"value":1358},{"type":993,"tag":1023,"props":2780,"children":2782},{"className":2781},[],[2783],{"type":999,"value":2784},"del list[index]",{"type":999,"value":2007},{"type":993,"tag":1023,"props":2787,"children":2789},{"className":2788},[],[2790],{"type":999,"value":2791},"del list[start:end]",{"type":993,"tag":1002,"props":2793,"children":2794},{},[2795],{"type":993,"tag":1352,"props":2796,"children":2797},{},[2798],{"type":999,"value":1372},{"type":993,"tag":1374,"props":2800,"children":2801},{},[2802,2807,2812,2817],{"type":993,"tag":1378,"props":2803,"children":2804},{},[2805],{"type":999,"value":2806},"Deletes without returning value",{"type":993,"tag":1378,"props":2808,"children":2809},{},[2810],{"type":999,"value":2811},"Can delete single elements or slices",{"type":993,"tag":1378,"props":2813,"children":2814},{},[2815],{"type":999,"value":2816},"More efficient when you don't need the value",{"type":993,"tag":1378,"props":2818,"children":2819},{},[2820],{"type":999,"value":2821},"Can delete entire variables (not just list elements)",{"type":993,"tag":1002,"props":2823,"children":2824},{},[2825],{"type":993,"tag":1352,"props":2826,"children":2827},{},[2828],{"type":999,"value":2829},"Slice Deletion:",{"type":993,"tag":1374,"props":2831,"children":2832},{},[2833,2844,2855],{"type":993,"tag":1378,"props":2834,"children":2835},{},[2836,2842],{"type":993,"tag":1023,"props":2837,"children":2839},{"className":2838},[],[2840],{"type":999,"value":2841},"del list[1:3]",{"type":999,"value":2843},": Removes elements at indices 1 and 2",{"type":993,"tag":1378,"props":2845,"children":2846},{},[2847,2853],{"type":993,"tag":1023,"props":2848,"children":2850},{"className":2849},[],[2851],{"type":999,"value":2852},"del list[::2]",{"type":999,"value":2854},": Removes every second element",{"type":993,"tag":1378,"props":2856,"children":2857},{},[2858,2864],{"type":993,"tag":1023,"props":2859,"children":2861},{"className":2860},[],[2862],{"type":999,"value":2863},"del list[:]",{"type":999,"value":2865},": Removes all elements (keeps list object)",{"type":993,"tag":1002,"props":2867,"children":2868},{},[2869,2873],{"type":993,"tag":1352,"props":2870,"children":2871},{},[2872],{"type":999,"value":2080},{"type":999,"value":2874}," Generally faster than pop() when value not needed",{"type":993,"tag":1002,"props":2876,"children":2877},{},[2878],{"type":999,"value":2879},"Del is efficient for removing elements when you don't need their values, and it's the only way to delete multiple elements at once using slices.",{"type":993,"tag":1440,"props":2881,"children":2883},{"id":2882},"del-examples",[2884],{"type":999,"value":2885},"Del Examples",{"type":993,"tag":1002,"props":2887,"children":2888},{},[2889],{"type":999,"value":2890},"Direct element deletion and slice removal for efficient list modification:",{"type":993,"tag":1013,"props":2892,"children":2893},{},[2894],{"type":993,"tag":1017,"props":2895,"children":2897},{"className":1019,"code":2896,"language":6,"meta":8,"style":8},"# Using del to delete by position\nanimals = [\"cat\", \"dog\", \"bird\", \"fish\", \"rabbit\"]\nprint(\"Animals:\", animals)\n\n# Delete single element by index\ndel animals[1]  # Remove \"dog\"\nprint(\"After deleting index 1:\", animals)\n\n# Delete multiple elements with slices\nanimals = [\"cat\", \"bird\", \"fish\", \"rabbit\"]\nprint(\"Animals before slice deletion:\", animals)\n\ndel animals[1:3]  # Remove \"bird\" and \"fish\"\nprint(\"After deleting slice [1:3]:\", animals)\n\n# Delete from the end\nnumbers = [10, 20, 30, 40, 50, 60]\nprint(\"Numbers:\", numbers)\ndel numbers[-1]  # Remove last element\nprint(\"After deleting last:\", numbers)\n\n# Advanced slice deletion\nletters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']\nprint(\"Original letters:\", letters)\n\n# Delete every second element\ndel letters[::2]\nprint(\"After deleting every 2nd:\", letters)\n",[2898],{"type":993,"tag":1023,"props":2899,"children":2900},{"__ignoreMap":8},[2901,2909,2970,2991,2998,3006,3032,3052,3059,3067,3114,3134,3141,3174,3194,3201,3209,3278,3297,3327,3347,3354,3362,3450,3471,3478,3486,3506],{"type":993,"tag":1027,"props":2902,"children":2903},{"class":1029,"line":12},[2904],{"type":993,"tag":1027,"props":2905,"children":2906},{"style":1033},[2907],{"type":999,"value":2908},"# Using del to delete by position\n",{"type":993,"tag":1027,"props":2910,"children":2911},{"class":1029,"line":27},[2912,2917,2921,2925,2930,2934,2939,2943,2948,2952,2957,2961,2966],{"type":993,"tag":1027,"props":2913,"children":2914},{"style":1042},[2915],{"type":999,"value":2916},"animals ",{"type":993,"tag":1027,"props":2918,"children":2919},{"style":1048},[2920],{"type":999,"value":1051},{"type":993,"tag":1027,"props":2922,"children":2923},{"style":1042},[2924],{"type":999,"value":1056},{"type":993,"tag":1027,"props":2926,"children":2927},{"style":1059},[2928],{"type":999,"value":2929},"\"cat\"",{"type":993,"tag":1027,"props":2931,"children":2932},{"style":1042},[2933],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2935,"children":2936},{"style":1059},[2937],{"type":999,"value":2938},"\"dog\"",{"type":993,"tag":1027,"props":2940,"children":2941},{"style":1042},[2942],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2944,"children":2945},{"style":1059},[2946],{"type":999,"value":2947},"\"bird\"",{"type":993,"tag":1027,"props":2949,"children":2950},{"style":1042},[2951],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2953,"children":2954},{"style":1059},[2955],{"type":999,"value":2956},"\"fish\"",{"type":993,"tag":1027,"props":2958,"children":2959},{"style":1042},[2960],{"type":999,"value":1067},{"type":993,"tag":1027,"props":2962,"children":2963},{"style":1059},[2964],{"type":999,"value":2965},"\"rabbit\"",{"type":993,"tag":1027,"props":2967,"children":2968},{"style":1042},[2969],{"type":999,"value":1104},{"type":993,"tag":1027,"props":2971,"children":2972},{"class":1029,"line":36},[2973,2977,2981,2986],{"type":993,"tag":1027,"props":2974,"children":2975},{"style":1110},[2976],{"type":999,"value":1113},{"type":993,"tag":1027,"props":2978,"children":2979},{"style":1042},[2980],{"type":999,"value":1118},{"type":993,"tag":1027,"props":2982,"children":2983},{"style":1059},[2984],{"type":999,"value":2985},"\"Animals:\"",{"type":993,"tag":1027,"props":2987,"children":2988},{"style":1042},[2989],{"type":999,"value":2990},", animals)\n",{"type":993,"tag":1027,"props":2992,"children":2993},{"class":1029,"line":45},[2994],{"type":993,"tag":1027,"props":2995,"children":2996},{"emptyLinePlaceholder":13},[2997],{"type":999,"value":1136},{"type":993,"tag":1027,"props":2999,"children":3000},{"class":1029,"line":54},[3001],{"type":993,"tag":1027,"props":3002,"children":3003},{"style":1033},[3004],{"type":999,"value":3005},"# Delete single element by index\n",{"type":993,"tag":1027,"props":3007,"children":3008},{"class":1029,"line":63},[3009,3013,3018,3022,3027],{"type":993,"tag":1027,"props":3010,"children":3011},{"style":1048},[3012],{"type":999,"value":1286},{"type":993,"tag":1027,"props":3014,"children":3015},{"style":1042},[3016],{"type":999,"value":3017}," animals[",{"type":993,"tag":1027,"props":3019,"children":3020},{"style":1110},[3021],{"type":999,"value":1218},{"type":993,"tag":1027,"props":3023,"children":3024},{"style":1042},[3025],{"type":999,"value":3026},"]  ",{"type":993,"tag":1027,"props":3028,"children":3029},{"style":1033},[3030],{"type":999,"value":3031},"# Remove \"dog\"\n",{"type":993,"tag":1027,"props":3033,"children":3034},{"class":1029,"line":72},[3035,3039,3043,3048],{"type":993,"tag":1027,"props":3036,"children":3037},{"style":1110},[3038],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3040,"children":3041},{"style":1042},[3042],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3044,"children":3045},{"style":1059},[3046],{"type":999,"value":3047},"\"After deleting index 1:\"",{"type":993,"tag":1027,"props":3049,"children":3050},{"style":1042},[3051],{"type":999,"value":2990},{"type":993,"tag":1027,"props":3053,"children":3054},{"class":1029,"line":81},[3055],{"type":993,"tag":1027,"props":3056,"children":3057},{"emptyLinePlaceholder":13},[3058],{"type":999,"value":1136},{"type":993,"tag":1027,"props":3060,"children":3061},{"class":1029,"line":91},[3062],{"type":993,"tag":1027,"props":3063,"children":3064},{"style":1033},[3065],{"type":999,"value":3066},"# Delete multiple elements with slices\n",{"type":993,"tag":1027,"props":3068,"children":3069},{"class":1029,"line":100},[3070,3074,3078,3082,3086,3090,3094,3098,3102,3106,3110],{"type":993,"tag":1027,"props":3071,"children":3072},{"style":1042},[3073],{"type":999,"value":2916},{"type":993,"tag":1027,"props":3075,"children":3076},{"style":1048},[3077],{"type":999,"value":1051},{"type":993,"tag":1027,"props":3079,"children":3080},{"style":1042},[3081],{"type":999,"value":1056},{"type":993,"tag":1027,"props":3083,"children":3084},{"style":1059},[3085],{"type":999,"value":2929},{"type":993,"tag":1027,"props":3087,"children":3088},{"style":1042},[3089],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3091,"children":3092},{"style":1059},[3093],{"type":999,"value":2947},{"type":993,"tag":1027,"props":3095,"children":3096},{"style":1042},[3097],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3099,"children":3100},{"style":1059},[3101],{"type":999,"value":2956},{"type":993,"tag":1027,"props":3103,"children":3104},{"style":1042},[3105],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3107,"children":3108},{"style":1059},[3109],{"type":999,"value":2965},{"type":993,"tag":1027,"props":3111,"children":3112},{"style":1042},[3113],{"type":999,"value":1104},{"type":993,"tag":1027,"props":3115,"children":3116},{"class":1029,"line":109},[3117,3121,3125,3130],{"type":993,"tag":1027,"props":3118,"children":3119},{"style":1110},[3120],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3122,"children":3123},{"style":1042},[3124],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3126,"children":3127},{"style":1059},[3128],{"type":999,"value":3129},"\"Animals before slice deletion:\"",{"type":993,"tag":1027,"props":3131,"children":3132},{"style":1042},[3133],{"type":999,"value":2990},{"type":993,"tag":1027,"props":3135,"children":3136},{"class":1029,"line":118},[3137],{"type":993,"tag":1027,"props":3138,"children":3139},{"emptyLinePlaceholder":13},[3140],{"type":999,"value":1136},{"type":993,"tag":1027,"props":3142,"children":3143},{"class":1029,"line":127},[3144,3148,3152,3156,3161,3165,3169],{"type":993,"tag":1027,"props":3145,"children":3146},{"style":1048},[3147],{"type":999,"value":1286},{"type":993,"tag":1027,"props":3149,"children":3150},{"style":1042},[3151],{"type":999,"value":3017},{"type":993,"tag":1027,"props":3153,"children":3154},{"style":1110},[3155],{"type":999,"value":1218},{"type":993,"tag":1027,"props":3157,"children":3158},{"style":1042},[3159],{"type":999,"value":3160},":",{"type":993,"tag":1027,"props":3162,"children":3163},{"style":1110},[3164],{"type":999,"value":1866},{"type":993,"tag":1027,"props":3166,"children":3167},{"style":1042},[3168],{"type":999,"value":3026},{"type":993,"tag":1027,"props":3170,"children":3171},{"style":1033},[3172],{"type":999,"value":3173},"# Remove \"bird\" and \"fish\"\n",{"type":993,"tag":1027,"props":3175,"children":3176},{"class":1029,"line":136},[3177,3181,3185,3190],{"type":993,"tag":1027,"props":3178,"children":3179},{"style":1110},[3180],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3182,"children":3183},{"style":1042},[3184],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3186,"children":3187},{"style":1059},[3188],{"type":999,"value":3189},"\"After deleting slice [1:3]:\"",{"type":993,"tag":1027,"props":3191,"children":3192},{"style":1042},[3193],{"type":999,"value":2990},{"type":993,"tag":1027,"props":3195,"children":3196},{"class":1029,"line":146},[3197],{"type":993,"tag":1027,"props":3198,"children":3199},{"emptyLinePlaceholder":13},[3200],{"type":999,"value":1136},{"type":993,"tag":1027,"props":3202,"children":3203},{"class":1029,"line":155},[3204],{"type":993,"tag":1027,"props":3205,"children":3206},{"style":1033},[3207],{"type":999,"value":3208},"# Delete from the end\n",{"type":993,"tag":1027,"props":3210,"children":3211},{"class":1029,"line":164},[3212,3216,3220,3224,3229,3233,3238,3242,3247,3251,3256,3260,3265,3269,3274],{"type":993,"tag":1027,"props":3213,"children":3214},{"style":1042},[3215],{"type":999,"value":1836},{"type":993,"tag":1027,"props":3217,"children":3218},{"style":1048},[3219],{"type":999,"value":1051},{"type":993,"tag":1027,"props":3221,"children":3222},{"style":1042},[3223],{"type":999,"value":1056},{"type":993,"tag":1027,"props":3225,"children":3226},{"style":1110},[3227],{"type":999,"value":3228},"10",{"type":993,"tag":1027,"props":3230,"children":3231},{"style":1042},[3232],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3234,"children":3235},{"style":1110},[3236],{"type":999,"value":3237},"20",{"type":993,"tag":1027,"props":3239,"children":3240},{"style":1042},[3241],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3243,"children":3244},{"style":1110},[3245],{"type":999,"value":3246},"30",{"type":993,"tag":1027,"props":3248,"children":3249},{"style":1042},[3250],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3252,"children":3253},{"style":1110},[3254],{"type":999,"value":3255},"40",{"type":993,"tag":1027,"props":3257,"children":3258},{"style":1042},[3259],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3261,"children":3262},{"style":1110},[3263],{"type":999,"value":3264},"50",{"type":993,"tag":1027,"props":3266,"children":3267},{"style":1042},[3268],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3270,"children":3271},{"style":1110},[3272],{"type":999,"value":3273},"60",{"type":993,"tag":1027,"props":3275,"children":3276},{"style":1042},[3277],{"type":999,"value":1104},{"type":993,"tag":1027,"props":3279,"children":3280},{"class":1029,"line":173},[3281,3285,3289,3293],{"type":993,"tag":1027,"props":3282,"children":3283},{"style":1110},[3284],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3286,"children":3287},{"style":1042},[3288],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3290,"children":3291},{"style":1059},[3292],{"type":999,"value":1920},{"type":993,"tag":1027,"props":3294,"children":3295},{"style":1042},[3296],{"type":999,"value":1925},{"type":993,"tag":1027,"props":3298,"children":3299},{"class":1029,"line":182},[3300,3304,3309,3314,3318,3322],{"type":993,"tag":1027,"props":3301,"children":3302},{"style":1048},[3303],{"type":999,"value":1286},{"type":993,"tag":1027,"props":3305,"children":3306},{"style":1042},[3307],{"type":999,"value":3308}," numbers[",{"type":993,"tag":1027,"props":3310,"children":3311},{"style":1048},[3312],{"type":999,"value":3313},"-",{"type":993,"tag":1027,"props":3315,"children":3316},{"style":1110},[3317],{"type":999,"value":1218},{"type":993,"tag":1027,"props":3319,"children":3320},{"style":1042},[3321],{"type":999,"value":3026},{"type":993,"tag":1027,"props":3323,"children":3324},{"style":1033},[3325],{"type":999,"value":3326},"# Remove last element\n",{"type":993,"tag":1027,"props":3328,"children":3329},{"class":1029,"line":191},[3330,3334,3338,3343],{"type":993,"tag":1027,"props":3331,"children":3332},{"style":1110},[3333],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3335,"children":3336},{"style":1042},[3337],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3339,"children":3340},{"style":1059},[3341],{"type":999,"value":3342},"\"After deleting last:\"",{"type":993,"tag":1027,"props":3344,"children":3345},{"style":1042},[3346],{"type":999,"value":1925},{"type":993,"tag":1027,"props":3348,"children":3349},{"class":1029,"line":201},[3350],{"type":993,"tag":1027,"props":3351,"children":3352},{"emptyLinePlaceholder":13},[3353],{"type":999,"value":1136},{"type":993,"tag":1027,"props":3355,"children":3356},{"class":1029,"line":210},[3357],{"type":993,"tag":1027,"props":3358,"children":3359},{"style":1033},[3360],{"type":999,"value":3361},"# Advanced slice deletion\n",{"type":993,"tag":1027,"props":3363,"children":3364},{"class":1029,"line":219},[3365,3370,3374,3378,3383,3387,3392,3396,3401,3405,3410,3414,3419,3423,3428,3432,3437,3441,3446],{"type":993,"tag":1027,"props":3366,"children":3367},{"style":1042},[3368],{"type":999,"value":3369},"letters ",{"type":993,"tag":1027,"props":3371,"children":3372},{"style":1048},[3373],{"type":999,"value":1051},{"type":993,"tag":1027,"props":3375,"children":3376},{"style":1042},[3377],{"type":999,"value":1056},{"type":993,"tag":1027,"props":3379,"children":3380},{"style":1059},[3381],{"type":999,"value":3382},"'a'",{"type":993,"tag":1027,"props":3384,"children":3385},{"style":1042},[3386],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3388,"children":3389},{"style":1059},[3390],{"type":999,"value":3391},"'b'",{"type":993,"tag":1027,"props":3393,"children":3394},{"style":1042},[3395],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3397,"children":3398},{"style":1059},[3399],{"type":999,"value":3400},"'c'",{"type":993,"tag":1027,"props":3402,"children":3403},{"style":1042},[3404],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3406,"children":3407},{"style":1059},[3408],{"type":999,"value":3409},"'d'",{"type":993,"tag":1027,"props":3411,"children":3412},{"style":1042},[3413],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3415,"children":3416},{"style":1059},[3417],{"type":999,"value":3418},"'e'",{"type":993,"tag":1027,"props":3420,"children":3421},{"style":1042},[3422],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3424,"children":3425},{"style":1059},[3426],{"type":999,"value":3427},"'f'",{"type":993,"tag":1027,"props":3429,"children":3430},{"style":1042},[3431],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3433,"children":3434},{"style":1059},[3435],{"type":999,"value":3436},"'g'",{"type":993,"tag":1027,"props":3438,"children":3439},{"style":1042},[3440],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3442,"children":3443},{"style":1059},[3444],{"type":999,"value":3445},"'h'",{"type":993,"tag":1027,"props":3447,"children":3448},{"style":1042},[3449],{"type":999,"value":1104},{"type":993,"tag":1027,"props":3451,"children":3452},{"class":1029,"line":228},[3453,3457,3461,3466],{"type":993,"tag":1027,"props":3454,"children":3455},{"style":1110},[3456],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3458,"children":3459},{"style":1042},[3460],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3462,"children":3463},{"style":1059},[3464],{"type":999,"value":3465},"\"Original letters:\"",{"type":993,"tag":1027,"props":3467,"children":3468},{"style":1042},[3469],{"type":999,"value":3470},", letters)\n",{"type":993,"tag":1027,"props":3472,"children":3473},{"class":1029,"line":238},[3474],{"type":993,"tag":1027,"props":3475,"children":3476},{"emptyLinePlaceholder":13},[3477],{"type":999,"value":1136},{"type":993,"tag":1027,"props":3479,"children":3480},{"class":1029,"line":247},[3481],{"type":993,"tag":1027,"props":3482,"children":3483},{"style":1033},[3484],{"type":999,"value":3485},"# Delete every second element\n",{"type":993,"tag":1027,"props":3487,"children":3488},{"class":1029,"line":256},[3489,3493,3498,3502],{"type":993,"tag":1027,"props":3490,"children":3491},{"style":1048},[3492],{"type":999,"value":1286},{"type":993,"tag":1027,"props":3494,"children":3495},{"style":1042},[3496],{"type":999,"value":3497}," letters[::",{"type":993,"tag":1027,"props":3499,"children":3500},{"style":1110},[3501],{"type":999,"value":2385},{"type":993,"tag":1027,"props":3503,"children":3504},{"style":1042},[3505],{"type":999,"value":1104},{"type":993,"tag":1027,"props":3507,"children":3508},{"class":1029,"line":265},[3509,3513,3517,3522],{"type":993,"tag":1027,"props":3510,"children":3511},{"style":1110},[3512],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3514,"children":3515},{"style":1042},[3516],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3518,"children":3519},{"style":1059},[3520],{"type":999,"value":3521},"\"After deleting every 2nd:\"",{"type":993,"tag":1027,"props":3523,"children":3524},{"style":1042},[3525],{"type":999,"value":3470},{"type":993,"tag":1322,"props":3527,"children":3529},{"id":3528},"clearing-entire-lists-with-clear",[3530],{"type":999,"value":3531},"🧹 Clearing Entire Lists with clear()",{"type":993,"tag":1002,"props":3533,"children":3534},{},[3535,3536,3542],{"type":999,"value":1332},{"type":993,"tag":1023,"props":3537,"children":3539},{"className":3538},[],[3540],{"type":999,"value":3541},"clear()",{"type":999,"value":3543}," method removes all elements from a list, leaving you with an empty list. This is more explicit and readable than other methods of emptying lists.",{"type":993,"tag":1342,"props":3545,"children":3548},{"emoji":3546,"title":3547,"type":1346},"✨","List Clearing Methods",[3549,3557,3603,3611,3646],{"type":993,"tag":1002,"props":3550,"children":3551},{},[3552],{"type":993,"tag":1352,"props":3553,"children":3554},{},[3555],{"type":999,"value":3556},"Multiple Approaches:",{"type":993,"tag":1374,"props":3558,"children":3559},{},[3560,3571,3581,3592],{"type":993,"tag":1378,"props":3561,"children":3562},{},[3563,3569],{"type":993,"tag":1023,"props":3564,"children":3566},{"className":3565},[],[3567],{"type":999,"value":3568},"list.clear()",{"type":999,"value":3570},": Most explicit and readable",{"type":993,"tag":1378,"props":3572,"children":3573},{},[3574,3579],{"type":993,"tag":1023,"props":3575,"children":3577},{"className":3576},[],[3578],{"type":999,"value":2863},{"type":999,"value":3580},": Slice deletion approach",{"type":993,"tag":1378,"props":3582,"children":3583},{},[3584,3590],{"type":993,"tag":1023,"props":3585,"children":3587},{"className":3586},[],[3588],{"type":999,"value":3589},"list[:] = []",{"type":999,"value":3591},": Slice assignment approach",{"type":993,"tag":1378,"props":3593,"children":3594},{},[3595,3601],{"type":993,"tag":1023,"props":3596,"children":3598},{"className":3597},[],[3599],{"type":999,"value":3600},"list = []",{"type":999,"value":3602},": Creates new list (different behavior)",{"type":993,"tag":1002,"props":3604,"children":3605},{},[3606],{"type":993,"tag":1352,"props":3607,"children":3608},{},[3609],{"type":999,"value":3610},"Important Difference:",{"type":993,"tag":1374,"props":3612,"children":3613},{},[3614,3636],{"type":993,"tag":1378,"props":3615,"children":3616},{},[3617,3622,3623,3628,3629,3634],{"type":993,"tag":1023,"props":3618,"children":3620},{"className":3619},[],[3621],{"type":999,"value":3541},{"type":999,"value":1067},{"type":993,"tag":1023,"props":3624,"children":3626},{"className":3625},[],[3627],{"type":999,"value":2863},{"type":999,"value":1067},{"type":993,"tag":1023,"props":3630,"children":3632},{"className":3631},[],[3633],{"type":999,"value":3589},{"type":999,"value":3635},": Modify existing list object",{"type":993,"tag":1378,"props":3637,"children":3638},{},[3639,3644],{"type":993,"tag":1023,"props":3640,"children":3642},{"className":3641},[],[3643],{"type":999,"value":3600},{"type":999,"value":3645},": Creates new list, doesn't affect other references",{"type":993,"tag":1002,"props":3647,"children":3648},{},[3649,3654],{"type":993,"tag":1352,"props":3650,"children":3651},{},[3652],{"type":999,"value":3653},"Use clear() for:",{"type":999,"value":3655}," Explicit intent, better readability, consistent behavior",{"type":993,"tag":1440,"props":3657,"children":3659},{"id":3658},"clear-examples",[3660],{"type":999,"value":3661},"Clear Examples",{"type":993,"tag":1002,"props":3663,"children":3664},{},[3665],{"type":999,"value":3666},"Complete list reset and reinitialization for fresh data collection:",{"type":993,"tag":1013,"props":3668,"children":3669},{},[3670],{"type":993,"tag":1017,"props":3671,"children":3673},{"className":1019,"code":3672,"language":6,"meta":8,"style":8},"# Using clear() to empty a list\ntodo_list = [\"task1\", \"task2\", \"task3\", \"task4\"]\nprint(\"Todo list:\", todo_list)\n\n# Clear all tasks\ntodo_list.clear()\nprint(\"After clearing:\", todo_list)\nprint(\"List length:\", len(todo_list))\n\n# Difference between clear and reassignment\noriginal_list = [1, 2, 3, 4, 5]\nreference_list = original_list\n\nprint(\"Original:\", original_list)\nprint(\"Reference:\", reference_list)\n\n# Clear the list\noriginal_list.clear()\nprint(\"After clear - Original:\", original_list)\nprint(\"After clear - Reference:\", reference_list)\n\n# Resetting lists for reuse\nresults = []\nfor round_num in range(3):\n    # Collect data for this round\n    for i in range(3):\n        results.append(f\"round_{round_num}_item_{i}\")\n    \n    print(f\"Round {round_num} results:\", results)\n    results.clear()  # Reset for next round\n",[3674],{"type":993,"tag":1023,"props":3675,"children":3676},{"__ignoreMap":8},[3677,3685,3737,3758,3765,3773,3781,3801,3831,3838,3846,3902,3919,3926,3946,3967,3974,3982,3990,4010,4030,4037,4045,4062,4098,4106,4139,4195,4203,4245],{"type":993,"tag":1027,"props":3678,"children":3679},{"class":1029,"line":12},[3680],{"type":993,"tag":1027,"props":3681,"children":3682},{"style":1033},[3683],{"type":999,"value":3684},"# Using clear() to empty a list\n",{"type":993,"tag":1027,"props":3686,"children":3687},{"class":1029,"line":27},[3688,3693,3697,3701,3706,3710,3715,3719,3724,3728,3733],{"type":993,"tag":1027,"props":3689,"children":3690},{"style":1042},[3691],{"type":999,"value":3692},"todo_list ",{"type":993,"tag":1027,"props":3694,"children":3695},{"style":1048},[3696],{"type":999,"value":1051},{"type":993,"tag":1027,"props":3698,"children":3699},{"style":1042},[3700],{"type":999,"value":1056},{"type":993,"tag":1027,"props":3702,"children":3703},{"style":1059},[3704],{"type":999,"value":3705},"\"task1\"",{"type":993,"tag":1027,"props":3707,"children":3708},{"style":1042},[3709],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3711,"children":3712},{"style":1059},[3713],{"type":999,"value":3714},"\"task2\"",{"type":993,"tag":1027,"props":3716,"children":3717},{"style":1042},[3718],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3720,"children":3721},{"style":1059},[3722],{"type":999,"value":3723},"\"task3\"",{"type":993,"tag":1027,"props":3725,"children":3726},{"style":1042},[3727],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3729,"children":3730},{"style":1059},[3731],{"type":999,"value":3732},"\"task4\"",{"type":993,"tag":1027,"props":3734,"children":3735},{"style":1042},[3736],{"type":999,"value":1104},{"type":993,"tag":1027,"props":3738,"children":3739},{"class":1029,"line":36},[3740,3744,3748,3753],{"type":993,"tag":1027,"props":3741,"children":3742},{"style":1110},[3743],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3745,"children":3746},{"style":1042},[3747],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3749,"children":3750},{"style":1059},[3751],{"type":999,"value":3752},"\"Todo list:\"",{"type":993,"tag":1027,"props":3754,"children":3755},{"style":1042},[3756],{"type":999,"value":3757},", todo_list)\n",{"type":993,"tag":1027,"props":3759,"children":3760},{"class":1029,"line":45},[3761],{"type":993,"tag":1027,"props":3762,"children":3763},{"emptyLinePlaceholder":13},[3764],{"type":999,"value":1136},{"type":993,"tag":1027,"props":3766,"children":3767},{"class":1029,"line":54},[3768],{"type":993,"tag":1027,"props":3769,"children":3770},{"style":1033},[3771],{"type":999,"value":3772},"# Clear all tasks\n",{"type":993,"tag":1027,"props":3774,"children":3775},{"class":1029,"line":63},[3776],{"type":993,"tag":1027,"props":3777,"children":3778},{"style":1042},[3779],{"type":999,"value":3780},"todo_list.clear()\n",{"type":993,"tag":1027,"props":3782,"children":3783},{"class":1029,"line":72},[3784,3788,3792,3797],{"type":993,"tag":1027,"props":3785,"children":3786},{"style":1110},[3787],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3789,"children":3790},{"style":1042},[3791],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3793,"children":3794},{"style":1059},[3795],{"type":999,"value":3796},"\"After clearing:\"",{"type":993,"tag":1027,"props":3798,"children":3799},{"style":1042},[3800],{"type":999,"value":3757},{"type":993,"tag":1027,"props":3802,"children":3803},{"class":1029,"line":81},[3804,3808,3812,3817,3821,3826],{"type":993,"tag":1027,"props":3805,"children":3806},{"style":1110},[3807],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3809,"children":3810},{"style":1042},[3811],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3813,"children":3814},{"style":1059},[3815],{"type":999,"value":3816},"\"List length:\"",{"type":993,"tag":1027,"props":3818,"children":3819},{"style":1042},[3820],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3822,"children":3823},{"style":1110},[3824],{"type":999,"value":3825},"len",{"type":993,"tag":1027,"props":3827,"children":3828},{"style":1042},[3829],{"type":999,"value":3830},"(todo_list))\n",{"type":993,"tag":1027,"props":3832,"children":3833},{"class":1029,"line":91},[3834],{"type":993,"tag":1027,"props":3835,"children":3836},{"emptyLinePlaceholder":13},[3837],{"type":999,"value":1136},{"type":993,"tag":1027,"props":3839,"children":3840},{"class":1029,"line":100},[3841],{"type":993,"tag":1027,"props":3842,"children":3843},{"style":1033},[3844],{"type":999,"value":3845},"# Difference between clear and reassignment\n",{"type":993,"tag":1027,"props":3847,"children":3848},{"class":1029,"line":109},[3849,3854,3858,3862,3866,3870,3874,3878,3882,3886,3890,3894,3898],{"type":993,"tag":1027,"props":3850,"children":3851},{"style":1042},[3852],{"type":999,"value":3853},"original_list ",{"type":993,"tag":1027,"props":3855,"children":3856},{"style":1048},[3857],{"type":999,"value":1051},{"type":993,"tag":1027,"props":3859,"children":3860},{"style":1042},[3861],{"type":999,"value":1056},{"type":993,"tag":1027,"props":3863,"children":3864},{"style":1110},[3865],{"type":999,"value":1218},{"type":993,"tag":1027,"props":3867,"children":3868},{"style":1042},[3869],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3871,"children":3872},{"style":1110},[3873],{"type":999,"value":2385},{"type":993,"tag":1027,"props":3875,"children":3876},{"style":1042},[3877],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3879,"children":3880},{"style":1110},[3881],{"type":999,"value":1866},{"type":993,"tag":1027,"props":3883,"children":3884},{"style":1042},[3885],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3887,"children":3888},{"style":1110},[3889],{"type":999,"value":2402},{"type":993,"tag":1027,"props":3891,"children":3892},{"style":1042},[3893],{"type":999,"value":1067},{"type":993,"tag":1027,"props":3895,"children":3896},{"style":1110},[3897],{"type":999,"value":1857},{"type":993,"tag":1027,"props":3899,"children":3900},{"style":1042},[3901],{"type":999,"value":1104},{"type":993,"tag":1027,"props":3903,"children":3904},{"class":1029,"line":118},[3905,3910,3914],{"type":993,"tag":1027,"props":3906,"children":3907},{"style":1042},[3908],{"type":999,"value":3909},"reference_list ",{"type":993,"tag":1027,"props":3911,"children":3912},{"style":1048},[3913],{"type":999,"value":1051},{"type":993,"tag":1027,"props":3915,"children":3916},{"style":1042},[3917],{"type":999,"value":3918}," original_list\n",{"type":993,"tag":1027,"props":3920,"children":3921},{"class":1029,"line":127},[3922],{"type":993,"tag":1027,"props":3923,"children":3924},{"emptyLinePlaceholder":13},[3925],{"type":999,"value":1136},{"type":993,"tag":1027,"props":3927,"children":3928},{"class":1029,"line":136},[3929,3933,3937,3941],{"type":993,"tag":1027,"props":3930,"children":3931},{"style":1110},[3932],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3934,"children":3935},{"style":1042},[3936],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3938,"children":3939},{"style":1059},[3940],{"type":999,"value":1123},{"type":993,"tag":1027,"props":3942,"children":3943},{"style":1042},[3944],{"type":999,"value":3945},", original_list)\n",{"type":993,"tag":1027,"props":3947,"children":3948},{"class":1029,"line":146},[3949,3953,3957,3962],{"type":993,"tag":1027,"props":3950,"children":3951},{"style":1110},[3952],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3954,"children":3955},{"style":1042},[3956],{"type":999,"value":1118},{"type":993,"tag":1027,"props":3958,"children":3959},{"style":1059},[3960],{"type":999,"value":3961},"\"Reference:\"",{"type":993,"tag":1027,"props":3963,"children":3964},{"style":1042},[3965],{"type":999,"value":3966},", reference_list)\n",{"type":993,"tag":1027,"props":3968,"children":3969},{"class":1029,"line":155},[3970],{"type":993,"tag":1027,"props":3971,"children":3972},{"emptyLinePlaceholder":13},[3973],{"type":999,"value":1136},{"type":993,"tag":1027,"props":3975,"children":3976},{"class":1029,"line":164},[3977],{"type":993,"tag":1027,"props":3978,"children":3979},{"style":1033},[3980],{"type":999,"value":3981},"# Clear the list\n",{"type":993,"tag":1027,"props":3983,"children":3984},{"class":1029,"line":173},[3985],{"type":993,"tag":1027,"props":3986,"children":3987},{"style":1042},[3988],{"type":999,"value":3989},"original_list.clear()\n",{"type":993,"tag":1027,"props":3991,"children":3992},{"class":1029,"line":182},[3993,3997,4001,4006],{"type":993,"tag":1027,"props":3994,"children":3995},{"style":1110},[3996],{"type":999,"value":1113},{"type":993,"tag":1027,"props":3998,"children":3999},{"style":1042},[4000],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4002,"children":4003},{"style":1059},[4004],{"type":999,"value":4005},"\"After clear - Original:\"",{"type":993,"tag":1027,"props":4007,"children":4008},{"style":1042},[4009],{"type":999,"value":3945},{"type":993,"tag":1027,"props":4011,"children":4012},{"class":1029,"line":191},[4013,4017,4021,4026],{"type":993,"tag":1027,"props":4014,"children":4015},{"style":1110},[4016],{"type":999,"value":1113},{"type":993,"tag":1027,"props":4018,"children":4019},{"style":1042},[4020],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4022,"children":4023},{"style":1059},[4024],{"type":999,"value":4025},"\"After clear - Reference:\"",{"type":993,"tag":1027,"props":4027,"children":4028},{"style":1042},[4029],{"type":999,"value":3966},{"type":993,"tag":1027,"props":4031,"children":4032},{"class":1029,"line":201},[4033],{"type":993,"tag":1027,"props":4034,"children":4035},{"emptyLinePlaceholder":13},[4036],{"type":999,"value":1136},{"type":993,"tag":1027,"props":4038,"children":4039},{"class":1029,"line":210},[4040],{"type":993,"tag":1027,"props":4041,"children":4042},{"style":1033},[4043],{"type":999,"value":4044},"# Resetting lists for reuse\n",{"type":993,"tag":1027,"props":4046,"children":4047},{"class":1029,"line":219},[4048,4053,4057],{"type":993,"tag":1027,"props":4049,"children":4050},{"style":1042},[4051],{"type":999,"value":4052},"results ",{"type":993,"tag":1027,"props":4054,"children":4055},{"style":1048},[4056],{"type":999,"value":1051},{"type":993,"tag":1027,"props":4058,"children":4059},{"style":1042},[4060],{"type":999,"value":4061}," []\n",{"type":993,"tag":1027,"props":4063,"children":4064},{"class":1029,"line":228},[4065,4070,4075,4080,4085,4089,4093],{"type":993,"tag":1027,"props":4066,"children":4067},{"style":1048},[4068],{"type":999,"value":4069},"for",{"type":993,"tag":1027,"props":4071,"children":4072},{"style":1042},[4073],{"type":999,"value":4074}," round_num ",{"type":993,"tag":1027,"props":4076,"children":4077},{"style":1048},[4078],{"type":999,"value":4079},"in",{"type":993,"tag":1027,"props":4081,"children":4082},{"style":1110},[4083],{"type":999,"value":4084}," range",{"type":993,"tag":1027,"props":4086,"children":4087},{"style":1042},[4088],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4090,"children":4091},{"style":1110},[4092],{"type":999,"value":1866},{"type":993,"tag":1027,"props":4094,"children":4095},{"style":1042},[4096],{"type":999,"value":4097},"):\n",{"type":993,"tag":1027,"props":4099,"children":4100},{"class":1029,"line":238},[4101],{"type":993,"tag":1027,"props":4102,"children":4103},{"style":1033},[4104],{"type":999,"value":4105},"    # Collect data for this round\n",{"type":993,"tag":1027,"props":4107,"children":4108},{"class":1029,"line":247},[4109,4114,4119,4123,4127,4131,4135],{"type":993,"tag":1027,"props":4110,"children":4111},{"style":1048},[4112],{"type":999,"value":4113},"    for",{"type":993,"tag":1027,"props":4115,"children":4116},{"style":1042},[4117],{"type":999,"value":4118}," i ",{"type":993,"tag":1027,"props":4120,"children":4121},{"style":1048},[4122],{"type":999,"value":4079},{"type":993,"tag":1027,"props":4124,"children":4125},{"style":1110},[4126],{"type":999,"value":4084},{"type":993,"tag":1027,"props":4128,"children":4129},{"style":1042},[4130],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4132,"children":4133},{"style":1110},[4134],{"type":999,"value":1866},{"type":993,"tag":1027,"props":4136,"children":4137},{"style":1042},[4138],{"type":999,"value":4097},{"type":993,"tag":1027,"props":4140,"children":4141},{"class":1029,"line":256},[4142,4147,4151,4156,4160,4165,4169,4174,4178,4183,4187,4191],{"type":993,"tag":1027,"props":4143,"children":4144},{"style":1042},[4145],{"type":999,"value":4146},"        results.append(",{"type":993,"tag":1027,"props":4148,"children":4149},{"style":1048},[4150],{"type":999,"value":2497},{"type":993,"tag":1027,"props":4152,"children":4153},{"style":1059},[4154],{"type":999,"value":4155},"\"round_",{"type":993,"tag":1027,"props":4157,"children":4158},{"style":1110},[4159],{"type":999,"value":2507},{"type":993,"tag":1027,"props":4161,"children":4162},{"style":1042},[4163],{"type":999,"value":4164},"round_num",{"type":993,"tag":1027,"props":4166,"children":4167},{"style":1110},[4168],{"type":999,"value":2517},{"type":993,"tag":1027,"props":4170,"children":4171},{"style":1059},[4172],{"type":999,"value":4173},"_item_",{"type":993,"tag":1027,"props":4175,"children":4176},{"style":1110},[4177],{"type":999,"value":2507},{"type":993,"tag":1027,"props":4179,"children":4180},{"style":1042},[4181],{"type":999,"value":4182},"i",{"type":993,"tag":1027,"props":4184,"children":4185},{"style":1110},[4186],{"type":999,"value":2517},{"type":993,"tag":1027,"props":4188,"children":4189},{"style":1059},[4190],{"type":999,"value":2540},{"type":993,"tag":1027,"props":4192,"children":4193},{"style":1042},[4194],{"type":999,"value":1161},{"type":993,"tag":1027,"props":4196,"children":4197},{"class":1029,"line":265},[4198],{"type":993,"tag":1027,"props":4199,"children":4200},{"style":1042},[4201],{"type":999,"value":4202},"    \n",{"type":993,"tag":1027,"props":4204,"children":4205},{"class":1029,"line":274},[4206,4210,4214,4218,4223,4227,4231,4235,4240],{"type":993,"tag":1027,"props":4207,"children":4208},{"style":1110},[4209],{"type":999,"value":2488},{"type":993,"tag":1027,"props":4211,"children":4212},{"style":1042},[4213],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4215,"children":4216},{"style":1048},[4217],{"type":999,"value":2497},{"type":993,"tag":1027,"props":4219,"children":4220},{"style":1059},[4221],{"type":999,"value":4222},"\"Round ",{"type":993,"tag":1027,"props":4224,"children":4225},{"style":1110},[4226],{"type":999,"value":2507},{"type":993,"tag":1027,"props":4228,"children":4229},{"style":1042},[4230],{"type":999,"value":4164},{"type":993,"tag":1027,"props":4232,"children":4233},{"style":1110},[4234],{"type":999,"value":2517},{"type":993,"tag":1027,"props":4236,"children":4237},{"style":1059},[4238],{"type":999,"value":4239}," results:\"",{"type":993,"tag":1027,"props":4241,"children":4242},{"style":1042},[4243],{"type":999,"value":4244},", results)\n",{"type":993,"tag":1027,"props":4246,"children":4247},{"class":1029,"line":284},[4248,4253],{"type":993,"tag":1027,"props":4249,"children":4250},{"style":1042},[4251],{"type":999,"value":4252},"    results.clear()  ",{"type":993,"tag":1027,"props":4254,"children":4255},{"style":1033},[4256],{"type":999,"value":4257},"# Reset for next round\n",{"type":993,"tag":1322,"props":4259,"children":4261},{"id":4260},"safe-removal-techniques",[4262],{"type":999,"value":4263},"Safe Removal Techniques",{"type":993,"tag":1002,"props":4265,"children":4266},{},[4267],{"type":999,"value":4268},"When removing elements from lists, you need to handle potential errors and edge cases. Python provides ways to remove elements safely without causing your program to crash.",{"type":993,"tag":1440,"props":4270,"children":4272},{"id":4271},"safe-removal-examples",[4273],{"type":999,"value":4274},"Safe Removal Examples",{"type":993,"tag":1002,"props":4276,"children":4277},{},[4278],{"type":999,"value":4279},"Error prevention and validation for robust list operations:",{"type":993,"tag":1013,"props":4281,"children":4282},{},[4283],{"type":993,"tag":1017,"props":4284,"children":4286},{"className":1019,"code":4285,"language":6,"meta":8,"style":8},"# Safe removal with error handling\nfruits = [\"apple\", \"banana\", \"cherry\"]\nprint(\"Fruits:\", fruits)\n\n# Try to remove an item that might not exist\ntry:\n    fruits.remove(\"grape\")\n    print(\"Removed grape\")\nexcept ValueError:\n    print(\"Grape not found in list\")\n\nprint(\"Fruits after attempt:\", fruits)\n\n# Check if item exists before removing\nshopping_list = [\"bread\", \"milk\", \"eggs\"]\nitem_to_remove = \"butter\"\n\nif item_to_remove in shopping_list:\n    shopping_list.remove(item_to_remove)\n    print(f\"Removed {item_to_remove}\")\nelse:\n    print(f\"{item_to_remove} not in shopping list\")\n\nprint(\"Shopping list:\", shopping_list)\n\n# Safe pop with index checking\nnumbers = [10, 20, 30]\nindex_to_pop = 5\n\nif 0 \u003C= index_to_pop \u003C len(numbers):\n    removed = numbers.pop(index_to_pop)\n    print(f\"Removed: {removed}\")\nelse:\n    print(f\"Index {index_to_pop} is out of range\")\n\nprint(\"Numbers:\", numbers)\n",[4287],{"type":993,"tag":1023,"props":4288,"children":4289},{"__ignoreMap":8},[4290,4298,4337,4357,4364,4372,4385,4402,4422,4439,4459,4466,4486,4493,4501,4540,4557,4564,4586,4594,4635,4647,4687,4694,4713,4720,4728,4767,4784,4791,4828,4845,4886,4897,4939,4946],{"type":993,"tag":1027,"props":4291,"children":4292},{"class":1029,"line":12},[4293],{"type":993,"tag":1027,"props":4294,"children":4295},{"style":1033},[4296],{"type":999,"value":4297},"# Safe removal with error handling\n",{"type":993,"tag":1027,"props":4299,"children":4300},{"class":1029,"line":27},[4301,4305,4309,4313,4317,4321,4325,4329,4333],{"type":993,"tag":1027,"props":4302,"children":4303},{"style":1042},[4304],{"type":999,"value":1045},{"type":993,"tag":1027,"props":4306,"children":4307},{"style":1048},[4308],{"type":999,"value":1051},{"type":993,"tag":1027,"props":4310,"children":4311},{"style":1042},[4312],{"type":999,"value":1056},{"type":993,"tag":1027,"props":4314,"children":4315},{"style":1059},[4316],{"type":999,"value":1062},{"type":993,"tag":1027,"props":4318,"children":4319},{"style":1042},[4320],{"type":999,"value":1067},{"type":993,"tag":1027,"props":4322,"children":4323},{"style":1059},[4324],{"type":999,"value":1072},{"type":993,"tag":1027,"props":4326,"children":4327},{"style":1042},[4328],{"type":999,"value":1067},{"type":993,"tag":1027,"props":4330,"children":4331},{"style":1059},[4332],{"type":999,"value":1081},{"type":993,"tag":1027,"props":4334,"children":4335},{"style":1042},[4336],{"type":999,"value":1104},{"type":993,"tag":1027,"props":4338,"children":4339},{"class":1029,"line":36},[4340,4344,4348,4353],{"type":993,"tag":1027,"props":4341,"children":4342},{"style":1110},[4343],{"type":999,"value":1113},{"type":993,"tag":1027,"props":4345,"children":4346},{"style":1042},[4347],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4349,"children":4350},{"style":1059},[4351],{"type":999,"value":4352},"\"Fruits:\"",{"type":993,"tag":1027,"props":4354,"children":4355},{"style":1042},[4356],{"type":999,"value":1128},{"type":993,"tag":1027,"props":4358,"children":4359},{"class":1029,"line":45},[4360],{"type":993,"tag":1027,"props":4361,"children":4362},{"emptyLinePlaceholder":13},[4363],{"type":999,"value":1136},{"type":993,"tag":1027,"props":4365,"children":4366},{"class":1029,"line":54},[4367],{"type":993,"tag":1027,"props":4368,"children":4369},{"style":1033},[4370],{"type":999,"value":4371},"# Try to remove an item that might not exist\n",{"type":993,"tag":1027,"props":4373,"children":4374},{"class":1029,"line":63},[4375,4380],{"type":993,"tag":1027,"props":4376,"children":4377},{"style":1048},[4378],{"type":999,"value":4379},"try",{"type":993,"tag":1027,"props":4381,"children":4382},{"style":1042},[4383],{"type":999,"value":4384},":\n",{"type":993,"tag":1027,"props":4386,"children":4387},{"class":1029,"line":72},[4388,4393,4398],{"type":993,"tag":1027,"props":4389,"children":4390},{"style":1042},[4391],{"type":999,"value":4392},"    fruits.remove(",{"type":993,"tag":1027,"props":4394,"children":4395},{"style":1059},[4396],{"type":999,"value":4397},"\"grape\"",{"type":993,"tag":1027,"props":4399,"children":4400},{"style":1042},[4401],{"type":999,"value":1161},{"type":993,"tag":1027,"props":4403,"children":4404},{"class":1029,"line":81},[4405,4409,4413,4418],{"type":993,"tag":1027,"props":4406,"children":4407},{"style":1110},[4408],{"type":999,"value":2488},{"type":993,"tag":1027,"props":4410,"children":4411},{"style":1042},[4412],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4414,"children":4415},{"style":1059},[4416],{"type":999,"value":4417},"\"Removed grape\"",{"type":993,"tag":1027,"props":4419,"children":4420},{"style":1042},[4421],{"type":999,"value":1161},{"type":993,"tag":1027,"props":4423,"children":4424},{"class":1029,"line":91},[4425,4430,4435],{"type":993,"tag":1027,"props":4426,"children":4427},{"style":1048},[4428],{"type":999,"value":4429},"except",{"type":993,"tag":1027,"props":4431,"children":4432},{"style":1110},[4433],{"type":999,"value":4434}," ValueError",{"type":993,"tag":1027,"props":4436,"children":4437},{"style":1042},[4438],{"type":999,"value":4384},{"type":993,"tag":1027,"props":4440,"children":4441},{"class":1029,"line":100},[4442,4446,4450,4455],{"type":993,"tag":1027,"props":4443,"children":4444},{"style":1110},[4445],{"type":999,"value":2488},{"type":993,"tag":1027,"props":4447,"children":4448},{"style":1042},[4449],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4451,"children":4452},{"style":1059},[4453],{"type":999,"value":4454},"\"Grape not found in list\"",{"type":993,"tag":1027,"props":4456,"children":4457},{"style":1042},[4458],{"type":999,"value":1161},{"type":993,"tag":1027,"props":4460,"children":4461},{"class":1029,"line":109},[4462],{"type":993,"tag":1027,"props":4463,"children":4464},{"emptyLinePlaceholder":13},[4465],{"type":999,"value":1136},{"type":993,"tag":1027,"props":4467,"children":4468},{"class":1029,"line":118},[4469,4473,4477,4482],{"type":993,"tag":1027,"props":4470,"children":4471},{"style":1110},[4472],{"type":999,"value":1113},{"type":993,"tag":1027,"props":4474,"children":4475},{"style":1042},[4476],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4478,"children":4479},{"style":1059},[4480],{"type":999,"value":4481},"\"Fruits after attempt:\"",{"type":993,"tag":1027,"props":4483,"children":4484},{"style":1042},[4485],{"type":999,"value":1128},{"type":993,"tag":1027,"props":4487,"children":4488},{"class":1029,"line":127},[4489],{"type":993,"tag":1027,"props":4490,"children":4491},{"emptyLinePlaceholder":13},[4492],{"type":999,"value":1136},{"type":993,"tag":1027,"props":4494,"children":4495},{"class":1029,"line":136},[4496],{"type":993,"tag":1027,"props":4497,"children":4498},{"style":1033},[4499],{"type":999,"value":4500},"# Check if item exists before removing\n",{"type":993,"tag":1027,"props":4502,"children":4503},{"class":1029,"line":146},[4504,4508,4512,4516,4520,4524,4528,4532,4536],{"type":993,"tag":1027,"props":4505,"children":4506},{"style":1042},[4507],{"type":999,"value":1673},{"type":993,"tag":1027,"props":4509,"children":4510},{"style":1048},[4511],{"type":999,"value":1051},{"type":993,"tag":1027,"props":4513,"children":4514},{"style":1042},[4515],{"type":999,"value":1056},{"type":993,"tag":1027,"props":4517,"children":4518},{"style":1059},[4519],{"type":999,"value":1686},{"type":993,"tag":1027,"props":4521,"children":4522},{"style":1042},[4523],{"type":999,"value":1067},{"type":993,"tag":1027,"props":4525,"children":4526},{"style":1059},[4527],{"type":999,"value":1695},{"type":993,"tag":1027,"props":4529,"children":4530},{"style":1042},[4531],{"type":999,"value":1067},{"type":993,"tag":1027,"props":4533,"children":4534},{"style":1059},[4535],{"type":999,"value":1704},{"type":993,"tag":1027,"props":4537,"children":4538},{"style":1042},[4539],{"type":999,"value":1104},{"type":993,"tag":1027,"props":4541,"children":4542},{"class":1029,"line":155},[4543,4548,4552],{"type":993,"tag":1027,"props":4544,"children":4545},{"style":1042},[4546],{"type":999,"value":4547},"item_to_remove ",{"type":993,"tag":1027,"props":4549,"children":4550},{"style":1048},[4551],{"type":999,"value":1051},{"type":993,"tag":1027,"props":4553,"children":4554},{"style":1059},[4555],{"type":999,"value":4556}," \"butter\"\n",{"type":993,"tag":1027,"props":4558,"children":4559},{"class":1029,"line":164},[4560],{"type":993,"tag":1027,"props":4561,"children":4562},{"emptyLinePlaceholder":13},[4563],{"type":999,"value":1136},{"type":993,"tag":1027,"props":4565,"children":4566},{"class":1029,"line":173},[4567,4572,4577,4581],{"type":993,"tag":1027,"props":4568,"children":4569},{"style":1048},[4570],{"type":999,"value":4571},"if",{"type":993,"tag":1027,"props":4573,"children":4574},{"style":1042},[4575],{"type":999,"value":4576}," item_to_remove ",{"type":993,"tag":1027,"props":4578,"children":4579},{"style":1048},[4580],{"type":999,"value":4079},{"type":993,"tag":1027,"props":4582,"children":4583},{"style":1042},[4584],{"type":999,"value":4585}," shopping_list:\n",{"type":993,"tag":1027,"props":4587,"children":4588},{"class":1029,"line":182},[4589],{"type":993,"tag":1027,"props":4590,"children":4591},{"style":1042},[4592],{"type":999,"value":4593},"    shopping_list.remove(item_to_remove)\n",{"type":993,"tag":1027,"props":4595,"children":4596},{"class":1029,"line":191},[4597,4601,4605,4609,4614,4618,4623,4627,4631],{"type":993,"tag":1027,"props":4598,"children":4599},{"style":1110},[4600],{"type":999,"value":2488},{"type":993,"tag":1027,"props":4602,"children":4603},{"style":1042},[4604],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4606,"children":4607},{"style":1048},[4608],{"type":999,"value":2497},{"type":993,"tag":1027,"props":4610,"children":4611},{"style":1059},[4612],{"type":999,"value":4613},"\"Removed ",{"type":993,"tag":1027,"props":4615,"children":4616},{"style":1110},[4617],{"type":999,"value":2507},{"type":993,"tag":1027,"props":4619,"children":4620},{"style":1042},[4621],{"type":999,"value":4622},"item_to_remove",{"type":993,"tag":1027,"props":4624,"children":4625},{"style":1110},[4626],{"type":999,"value":2517},{"type":993,"tag":1027,"props":4628,"children":4629},{"style":1059},[4630],{"type":999,"value":2540},{"type":993,"tag":1027,"props":4632,"children":4633},{"style":1042},[4634],{"type":999,"value":1161},{"type":993,"tag":1027,"props":4636,"children":4637},{"class":1029,"line":201},[4638,4643],{"type":993,"tag":1027,"props":4639,"children":4640},{"style":1048},[4641],{"type":999,"value":4642},"else",{"type":993,"tag":1027,"props":4644,"children":4645},{"style":1042},[4646],{"type":999,"value":4384},{"type":993,"tag":1027,"props":4648,"children":4649},{"class":1029,"line":210},[4650,4654,4658,4662,4666,4670,4674,4678,4683],{"type":993,"tag":1027,"props":4651,"children":4652},{"style":1110},[4653],{"type":999,"value":2488},{"type":993,"tag":1027,"props":4655,"children":4656},{"style":1042},[4657],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4659,"children":4660},{"style":1048},[4661],{"type":999,"value":2497},{"type":993,"tag":1027,"props":4663,"children":4664},{"style":1059},[4665],{"type":999,"value":2540},{"type":993,"tag":1027,"props":4667,"children":4668},{"style":1110},[4669],{"type":999,"value":2507},{"type":993,"tag":1027,"props":4671,"children":4672},{"style":1042},[4673],{"type":999,"value":4622},{"type":993,"tag":1027,"props":4675,"children":4676},{"style":1110},[4677],{"type":999,"value":2517},{"type":993,"tag":1027,"props":4679,"children":4680},{"style":1059},[4681],{"type":999,"value":4682}," not in shopping list\"",{"type":993,"tag":1027,"props":4684,"children":4685},{"style":1042},[4686],{"type":999,"value":1161},{"type":993,"tag":1027,"props":4688,"children":4689},{"class":1029,"line":219},[4690],{"type":993,"tag":1027,"props":4691,"children":4692},{"emptyLinePlaceholder":13},[4693],{"type":999,"value":1136},{"type":993,"tag":1027,"props":4695,"children":4696},{"class":1029,"line":228},[4697,4701,4705,4709],{"type":993,"tag":1027,"props":4698,"children":4699},{"style":1110},[4700],{"type":999,"value":1113},{"type":993,"tag":1027,"props":4702,"children":4703},{"style":1042},[4704],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4706,"children":4707},{"style":1059},[4708],{"type":999,"value":1742},{"type":993,"tag":1027,"props":4710,"children":4711},{"style":1042},[4712],{"type":999,"value":1747},{"type":993,"tag":1027,"props":4714,"children":4715},{"class":1029,"line":238},[4716],{"type":993,"tag":1027,"props":4717,"children":4718},{"emptyLinePlaceholder":13},[4719],{"type":999,"value":1136},{"type":993,"tag":1027,"props":4721,"children":4722},{"class":1029,"line":247},[4723],{"type":993,"tag":1027,"props":4724,"children":4725},{"style":1033},[4726],{"type":999,"value":4727},"# Safe pop with index checking\n",{"type":993,"tag":1027,"props":4729,"children":4730},{"class":1029,"line":256},[4731,4735,4739,4743,4747,4751,4755,4759,4763],{"type":993,"tag":1027,"props":4732,"children":4733},{"style":1042},[4734],{"type":999,"value":1836},{"type":993,"tag":1027,"props":4736,"children":4737},{"style":1048},[4738],{"type":999,"value":1051},{"type":993,"tag":1027,"props":4740,"children":4741},{"style":1042},[4742],{"type":999,"value":1056},{"type":993,"tag":1027,"props":4744,"children":4745},{"style":1110},[4746],{"type":999,"value":3228},{"type":993,"tag":1027,"props":4748,"children":4749},{"style":1042},[4750],{"type":999,"value":1067},{"type":993,"tag":1027,"props":4752,"children":4753},{"style":1110},[4754],{"type":999,"value":3237},{"type":993,"tag":1027,"props":4756,"children":4757},{"style":1042},[4758],{"type":999,"value":1067},{"type":993,"tag":1027,"props":4760,"children":4761},{"style":1110},[4762],{"type":999,"value":3246},{"type":993,"tag":1027,"props":4764,"children":4765},{"style":1042},[4766],{"type":999,"value":1104},{"type":993,"tag":1027,"props":4768,"children":4769},{"class":1029,"line":265},[4770,4775,4779],{"type":993,"tag":1027,"props":4771,"children":4772},{"style":1042},[4773],{"type":999,"value":4774},"index_to_pop ",{"type":993,"tag":1027,"props":4776,"children":4777},{"style":1048},[4778],{"type":999,"value":1051},{"type":993,"tag":1027,"props":4780,"children":4781},{"style":1110},[4782],{"type":999,"value":4783}," 5\n",{"type":993,"tag":1027,"props":4785,"children":4786},{"class":1029,"line":274},[4787],{"type":993,"tag":1027,"props":4788,"children":4789},{"emptyLinePlaceholder":13},[4790],{"type":999,"value":1136},{"type":993,"tag":1027,"props":4792,"children":4793},{"class":1029,"line":284},[4794,4798,4803,4808,4813,4818,4823],{"type":993,"tag":1027,"props":4795,"children":4796},{"style":1048},[4797],{"type":999,"value":4571},{"type":993,"tag":1027,"props":4799,"children":4800},{"style":1110},[4801],{"type":999,"value":4802}," 0",{"type":993,"tag":1027,"props":4804,"children":4805},{"style":1048},[4806],{"type":999,"value":4807}," \u003C=",{"type":993,"tag":1027,"props":4809,"children":4810},{"style":1042},[4811],{"type":999,"value":4812}," index_to_pop ",{"type":993,"tag":1027,"props":4814,"children":4815},{"style":1048},[4816],{"type":999,"value":4817},"\u003C",{"type":993,"tag":1027,"props":4819,"children":4820},{"style":1110},[4821],{"type":999,"value":4822}," len",{"type":993,"tag":1027,"props":4824,"children":4825},{"style":1042},[4826],{"type":999,"value":4827},"(numbers):\n",{"type":993,"tag":1027,"props":4829,"children":4830},{"class":1029,"line":293},[4831,4836,4840],{"type":993,"tag":1027,"props":4832,"children":4833},{"style":1042},[4834],{"type":999,"value":4835},"    removed ",{"type":993,"tag":1027,"props":4837,"children":4838},{"style":1048},[4839],{"type":999,"value":1051},{"type":993,"tag":1027,"props":4841,"children":4842},{"style":1042},[4843],{"type":999,"value":4844}," numbers.pop(index_to_pop)\n",{"type":993,"tag":1027,"props":4846,"children":4847},{"class":1029,"line":302},[4848,4852,4856,4860,4865,4869,4874,4878,4882],{"type":993,"tag":1027,"props":4849,"children":4850},{"style":1110},[4851],{"type":999,"value":2488},{"type":993,"tag":1027,"props":4853,"children":4854},{"style":1042},[4855],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4857,"children":4858},{"style":1048},[4859],{"type":999,"value":2497},{"type":993,"tag":1027,"props":4861,"children":4862},{"style":1059},[4863],{"type":999,"value":4864},"\"Removed: ",{"type":993,"tag":1027,"props":4866,"children":4867},{"style":1110},[4868],{"type":999,"value":2507},{"type":993,"tag":1027,"props":4870,"children":4871},{"style":1042},[4872],{"type":999,"value":4873},"removed",{"type":993,"tag":1027,"props":4875,"children":4876},{"style":1110},[4877],{"type":999,"value":2517},{"type":993,"tag":1027,"props":4879,"children":4880},{"style":1059},[4881],{"type":999,"value":2540},{"type":993,"tag":1027,"props":4883,"children":4884},{"style":1042},[4885],{"type":999,"value":1161},{"type":993,"tag":1027,"props":4887,"children":4888},{"class":1029,"line":311},[4889,4893],{"type":993,"tag":1027,"props":4890,"children":4891},{"style":1048},[4892],{"type":999,"value":4642},{"type":993,"tag":1027,"props":4894,"children":4895},{"style":1042},[4896],{"type":999,"value":4384},{"type":993,"tag":1027,"props":4898,"children":4899},{"class":1029,"line":320},[4900,4904,4908,4912,4917,4921,4926,4930,4935],{"type":993,"tag":1027,"props":4901,"children":4902},{"style":1110},[4903],{"type":999,"value":2488},{"type":993,"tag":1027,"props":4905,"children":4906},{"style":1042},[4907],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4909,"children":4910},{"style":1048},[4911],{"type":999,"value":2497},{"type":993,"tag":1027,"props":4913,"children":4914},{"style":1059},[4915],{"type":999,"value":4916},"\"Index ",{"type":993,"tag":1027,"props":4918,"children":4919},{"style":1110},[4920],{"type":999,"value":2507},{"type":993,"tag":1027,"props":4922,"children":4923},{"style":1042},[4924],{"type":999,"value":4925},"index_to_pop",{"type":993,"tag":1027,"props":4927,"children":4928},{"style":1110},[4929],{"type":999,"value":2517},{"type":993,"tag":1027,"props":4931,"children":4932},{"style":1059},[4933],{"type":999,"value":4934}," is out of range\"",{"type":993,"tag":1027,"props":4936,"children":4937},{"style":1042},[4938],{"type":999,"value":1161},{"type":993,"tag":1027,"props":4940,"children":4941},{"class":1029,"line":329},[4942],{"type":993,"tag":1027,"props":4943,"children":4944},{"emptyLinePlaceholder":13},[4945],{"type":999,"value":1136},{"type":993,"tag":1027,"props":4947,"children":4948},{"class":1029,"line":338},[4949,4953,4957,4961],{"type":993,"tag":1027,"props":4950,"children":4951},{"style":1110},[4952],{"type":999,"value":1113},{"type":993,"tag":1027,"props":4954,"children":4955},{"style":1042},[4956],{"type":999,"value":1118},{"type":993,"tag":1027,"props":4958,"children":4959},{"style":1059},[4960],{"type":999,"value":1920},{"type":993,"tag":1027,"props":4962,"children":4963},{"style":1042},[4964],{"type":999,"value":1925},{"type":993,"tag":1322,"props":4966,"children":4968},{"id":4967},"removing-multiple-occurrences",[4969],{"type":999,"value":4970},"Removing Multiple Occurrences",{"type":993,"tag":1002,"props":4972,"children":4973},{},[4974],{"type":999,"value":4975},"Sometimes you need to remove all occurrences of a value, not just the first one. Since remove() only removes the first occurrence, you need different approaches for multiple removals.",{"type":993,"tag":1440,"props":4977,"children":4979},{"id":4978},"multiple-removal-examples",[4980],{"type":999,"value":4981},"Multiple Removal Examples",{"type":993,"tag":1002,"props":4983,"children":4984},{},[4985],{"type":999,"value":4986},"Comprehensive techniques for removing all instances of values:",{"type":993,"tag":1013,"props":4988,"children":4989},{},[4990],{"type":993,"tag":1017,"props":4991,"children":4993},{"className":1019,"code":4992,"language":6,"meta":8,"style":8},"# Remove all occurrences of a value\nnumbers = [1, 2, 3, 2, 4, 2, 5]\nprint(\"Original numbers:\", numbers)\n\n# Remove all 2s\nwhile 2 in numbers:\n    numbers.remove(2)\n\nprint(\"After removing all 2s:\", numbers)\n\n# Remove all occurrences using list comprehension\ncolors = [\"red\", \"blue\", \"red\", \"green\", \"red\", \"yellow\"]\nprint(\"Original colors:\", colors)\n\n# Create new list without \"red\"\ncolors_without_red = [color for color in colors if color != \"red\"]\nprint(\"Without red:\", colors_without_red)\n\n# Remove multiple different values\nfruits = [\"apple\", \"banana\", \"cherry\", \"banana\", \"date\", \"apple\"]\nto_remove = [\"apple\", \"banana\"]\n\nprint(\"Original fruits:\", fruits)\n\n# Remove all occurrences of items in to_remove list\nfruits_filtered = [fruit for fruit in fruits if fruit not in to_remove]\nprint(\"Filtered fruits:\", fruits_filtered)\n",[4994],{"type":993,"tag":1023,"props":4995,"children":4996},{"__ignoreMap":8},[4997,5005,5076,5096,5103,5111,5133,5149,5156,5176,5183,5191,5254,5273,5280,5288,5345,5366,5373,5381,5444,5476,5483,5503,5510,5518,5575],{"type":993,"tag":1027,"props":4998,"children":4999},{"class":1029,"line":12},[5000],{"type":993,"tag":1027,"props":5001,"children":5002},{"style":1033},[5003],{"type":999,"value":5004},"# Remove all occurrences of a value\n",{"type":993,"tag":1027,"props":5006,"children":5007},{"class":1029,"line":27},[5008,5012,5016,5020,5024,5028,5032,5036,5040,5044,5048,5052,5056,5060,5064,5068,5072],{"type":993,"tag":1027,"props":5009,"children":5010},{"style":1042},[5011],{"type":999,"value":1836},{"type":993,"tag":1027,"props":5013,"children":5014},{"style":1048},[5015],{"type":999,"value":1051},{"type":993,"tag":1027,"props":5017,"children":5018},{"style":1042},[5019],{"type":999,"value":1056},{"type":993,"tag":1027,"props":5021,"children":5022},{"style":1110},[5023],{"type":999,"value":1218},{"type":993,"tag":1027,"props":5025,"children":5026},{"style":1042},[5027],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5029,"children":5030},{"style":1110},[5031],{"type":999,"value":2385},{"type":993,"tag":1027,"props":5033,"children":5034},{"style":1042},[5035],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5037,"children":5038},{"style":1110},[5039],{"type":999,"value":1866},{"type":993,"tag":1027,"props":5041,"children":5042},{"style":1042},[5043],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5045,"children":5046},{"style":1110},[5047],{"type":999,"value":2385},{"type":993,"tag":1027,"props":5049,"children":5050},{"style":1042},[5051],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5053,"children":5054},{"style":1110},[5055],{"type":999,"value":2402},{"type":993,"tag":1027,"props":5057,"children":5058},{"style":1042},[5059],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5061,"children":5062},{"style":1110},[5063],{"type":999,"value":2385},{"type":993,"tag":1027,"props":5065,"children":5066},{"style":1042},[5067],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5069,"children":5070},{"style":1110},[5071],{"type":999,"value":1857},{"type":993,"tag":1027,"props":5073,"children":5074},{"style":1042},[5075],{"type":999,"value":1104},{"type":993,"tag":1027,"props":5077,"children":5078},{"class":1029,"line":36},[5079,5083,5087,5092],{"type":993,"tag":1027,"props":5080,"children":5081},{"style":1110},[5082],{"type":999,"value":1113},{"type":993,"tag":1027,"props":5084,"children":5085},{"style":1042},[5086],{"type":999,"value":1118},{"type":993,"tag":1027,"props":5088,"children":5089},{"style":1059},[5090],{"type":999,"value":5091},"\"Original numbers:\"",{"type":993,"tag":1027,"props":5093,"children":5094},{"style":1042},[5095],{"type":999,"value":1925},{"type":993,"tag":1027,"props":5097,"children":5098},{"class":1029,"line":45},[5099],{"type":993,"tag":1027,"props":5100,"children":5101},{"emptyLinePlaceholder":13},[5102],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5104,"children":5105},{"class":1029,"line":54},[5106],{"type":993,"tag":1027,"props":5107,"children":5108},{"style":1033},[5109],{"type":999,"value":5110},"# Remove all 2s\n",{"type":993,"tag":1027,"props":5112,"children":5113},{"class":1029,"line":63},[5114,5118,5123,5128],{"type":993,"tag":1027,"props":5115,"children":5116},{"style":1048},[5117],{"type":999,"value":2458},{"type":993,"tag":1027,"props":5119,"children":5120},{"style":1110},[5121],{"type":999,"value":5122}," 2",{"type":993,"tag":1027,"props":5124,"children":5125},{"style":1048},[5126],{"type":999,"value":5127}," in",{"type":993,"tag":1027,"props":5129,"children":5130},{"style":1042},[5131],{"type":999,"value":5132}," numbers:\n",{"type":993,"tag":1027,"props":5134,"children":5135},{"class":1029,"line":72},[5136,5141,5145],{"type":993,"tag":1027,"props":5137,"children":5138},{"style":1042},[5139],{"type":999,"value":5140},"    numbers.remove(",{"type":993,"tag":1027,"props":5142,"children":5143},{"style":1110},[5144],{"type":999,"value":2385},{"type":993,"tag":1027,"props":5146,"children":5147},{"style":1042},[5148],{"type":999,"value":1161},{"type":993,"tag":1027,"props":5150,"children":5151},{"class":1029,"line":81},[5152],{"type":993,"tag":1027,"props":5153,"children":5154},{"emptyLinePlaceholder":13},[5155],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5157,"children":5158},{"class":1029,"line":91},[5159,5163,5167,5172],{"type":993,"tag":1027,"props":5160,"children":5161},{"style":1110},[5162],{"type":999,"value":1113},{"type":993,"tag":1027,"props":5164,"children":5165},{"style":1042},[5166],{"type":999,"value":1118},{"type":993,"tag":1027,"props":5168,"children":5169},{"style":1059},[5170],{"type":999,"value":5171},"\"After removing all 2s:\"",{"type":993,"tag":1027,"props":5173,"children":5174},{"style":1042},[5175],{"type":999,"value":1925},{"type":993,"tag":1027,"props":5177,"children":5178},{"class":1029,"line":100},[5179],{"type":993,"tag":1027,"props":5180,"children":5181},{"emptyLinePlaceholder":13},[5182],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5184,"children":5185},{"class":1029,"line":109},[5186],{"type":993,"tag":1027,"props":5187,"children":5188},{"style":1033},[5189],{"type":999,"value":5190},"# Remove all occurrences using list comprehension\n",{"type":993,"tag":1027,"props":5192,"children":5193},{"class":1029,"line":118},[5194,5198,5202,5206,5210,5214,5218,5222,5226,5230,5234,5238,5242,5246,5250],{"type":993,"tag":1027,"props":5195,"children":5196},{"style":1042},[5197],{"type":999,"value":1476},{"type":993,"tag":1027,"props":5199,"children":5200},{"style":1048},[5201],{"type":999,"value":1051},{"type":993,"tag":1027,"props":5203,"children":5204},{"style":1042},[5205],{"type":999,"value":1056},{"type":993,"tag":1027,"props":5207,"children":5208},{"style":1059},[5209],{"type":999,"value":1489},{"type":993,"tag":1027,"props":5211,"children":5212},{"style":1042},[5213],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5215,"children":5216},{"style":1059},[5217],{"type":999,"value":1498},{"type":993,"tag":1027,"props":5219,"children":5220},{"style":1042},[5221],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5223,"children":5224},{"style":1059},[5225],{"type":999,"value":1489},{"type":993,"tag":1027,"props":5227,"children":5228},{"style":1042},[5229],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5231,"children":5232},{"style":1059},[5233],{"type":999,"value":1507},{"type":993,"tag":1027,"props":5235,"children":5236},{"style":1042},[5237],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5239,"children":5240},{"style":1059},[5241],{"type":999,"value":1489},{"type":993,"tag":1027,"props":5243,"children":5244},{"style":1042},[5245],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5247,"children":5248},{"style":1059},[5249],{"type":999,"value":1524},{"type":993,"tag":1027,"props":5251,"children":5252},{"style":1042},[5253],{"type":999,"value":1104},{"type":993,"tag":1027,"props":5255,"children":5256},{"class":1029,"line":127},[5257,5261,5265,5269],{"type":993,"tag":1027,"props":5258,"children":5259},{"style":1110},[5260],{"type":999,"value":1113},{"type":993,"tag":1027,"props":5262,"children":5263},{"style":1042},[5264],{"type":999,"value":1118},{"type":993,"tag":1027,"props":5266,"children":5267},{"style":1059},[5268],{"type":999,"value":1544},{"type":993,"tag":1027,"props":5270,"children":5271},{"style":1042},[5272],{"type":999,"value":1549},{"type":993,"tag":1027,"props":5274,"children":5275},{"class":1029,"line":136},[5276],{"type":993,"tag":1027,"props":5277,"children":5278},{"emptyLinePlaceholder":13},[5279],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5281,"children":5282},{"class":1029,"line":146},[5283],{"type":993,"tag":1027,"props":5284,"children":5285},{"style":1033},[5286],{"type":999,"value":5287},"# Create new list without \"red\"\n",{"type":993,"tag":1027,"props":5289,"children":5290},{"class":1029,"line":155},[5291,5296,5300,5305,5309,5314,5318,5323,5327,5331,5336,5341],{"type":993,"tag":1027,"props":5292,"children":5293},{"style":1042},[5294],{"type":999,"value":5295},"colors_without_red ",{"type":993,"tag":1027,"props":5297,"children":5298},{"style":1048},[5299],{"type":999,"value":1051},{"type":993,"tag":1027,"props":5301,"children":5302},{"style":1042},[5303],{"type":999,"value":5304}," [color ",{"type":993,"tag":1027,"props":5306,"children":5307},{"style":1048},[5308],{"type":999,"value":4069},{"type":993,"tag":1027,"props":5310,"children":5311},{"style":1042},[5312],{"type":999,"value":5313}," color ",{"type":993,"tag":1027,"props":5315,"children":5316},{"style":1048},[5317],{"type":999,"value":4079},{"type":993,"tag":1027,"props":5319,"children":5320},{"style":1042},[5321],{"type":999,"value":5322}," colors ",{"type":993,"tag":1027,"props":5324,"children":5325},{"style":1048},[5326],{"type":999,"value":4571},{"type":993,"tag":1027,"props":5328,"children":5329},{"style":1042},[5330],{"type":999,"value":5313},{"type":993,"tag":1027,"props":5332,"children":5333},{"style":1048},[5334],{"type":999,"value":5335},"!=",{"type":993,"tag":1027,"props":5337,"children":5338},{"style":1059},[5339],{"type":999,"value":5340}," \"red\"",{"type":993,"tag":1027,"props":5342,"children":5343},{"style":1042},[5344],{"type":999,"value":1104},{"type":993,"tag":1027,"props":5346,"children":5347},{"class":1029,"line":164},[5348,5352,5356,5361],{"type":993,"tag":1027,"props":5349,"children":5350},{"style":1110},[5351],{"type":999,"value":1113},{"type":993,"tag":1027,"props":5353,"children":5354},{"style":1042},[5355],{"type":999,"value":1118},{"type":993,"tag":1027,"props":5357,"children":5358},{"style":1059},[5359],{"type":999,"value":5360},"\"Without red:\"",{"type":993,"tag":1027,"props":5362,"children":5363},{"style":1042},[5364],{"type":999,"value":5365},", colors_without_red)\n",{"type":993,"tag":1027,"props":5367,"children":5368},{"class":1029,"line":173},[5369],{"type":993,"tag":1027,"props":5370,"children":5371},{"emptyLinePlaceholder":13},[5372],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5374,"children":5375},{"class":1029,"line":182},[5376],{"type":993,"tag":1027,"props":5377,"children":5378},{"style":1033},[5379],{"type":999,"value":5380},"# Remove multiple different values\n",{"type":993,"tag":1027,"props":5382,"children":5383},{"class":1029,"line":191},[5384,5388,5392,5396,5400,5404,5408,5412,5416,5420,5424,5428,5432,5436,5440],{"type":993,"tag":1027,"props":5385,"children":5386},{"style":1042},[5387],{"type":999,"value":1045},{"type":993,"tag":1027,"props":5389,"children":5390},{"style":1048},[5391],{"type":999,"value":1051},{"type":993,"tag":1027,"props":5393,"children":5394},{"style":1042},[5395],{"type":999,"value":1056},{"type":993,"tag":1027,"props":5397,"children":5398},{"style":1059},[5399],{"type":999,"value":1062},{"type":993,"tag":1027,"props":5401,"children":5402},{"style":1042},[5403],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5405,"children":5406},{"style":1059},[5407],{"type":999,"value":1072},{"type":993,"tag":1027,"props":5409,"children":5410},{"style":1042},[5411],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5413,"children":5414},{"style":1059},[5415],{"type":999,"value":1081},{"type":993,"tag":1027,"props":5417,"children":5418},{"style":1042},[5419],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5421,"children":5422},{"style":1059},[5423],{"type":999,"value":1072},{"type":993,"tag":1027,"props":5425,"children":5426},{"style":1042},[5427],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5429,"children":5430},{"style":1059},[5431],{"type":999,"value":1090},{"type":993,"tag":1027,"props":5433,"children":5434},{"style":1042},[5435],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5437,"children":5438},{"style":1059},[5439],{"type":999,"value":1062},{"type":993,"tag":1027,"props":5441,"children":5442},{"style":1042},[5443],{"type":999,"value":1104},{"type":993,"tag":1027,"props":5445,"children":5446},{"class":1029,"line":201},[5447,5452,5456,5460,5464,5468,5472],{"type":993,"tag":1027,"props":5448,"children":5449},{"style":1042},[5450],{"type":999,"value":5451},"to_remove ",{"type":993,"tag":1027,"props":5453,"children":5454},{"style":1048},[5455],{"type":999,"value":1051},{"type":993,"tag":1027,"props":5457,"children":5458},{"style":1042},[5459],{"type":999,"value":1056},{"type":993,"tag":1027,"props":5461,"children":5462},{"style":1059},[5463],{"type":999,"value":1062},{"type":993,"tag":1027,"props":5465,"children":5466},{"style":1042},[5467],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5469,"children":5470},{"style":1059},[5471],{"type":999,"value":1072},{"type":993,"tag":1027,"props":5473,"children":5474},{"style":1042},[5475],{"type":999,"value":1104},{"type":993,"tag":1027,"props":5477,"children":5478},{"class":1029,"line":210},[5479],{"type":993,"tag":1027,"props":5480,"children":5481},{"emptyLinePlaceholder":13},[5482],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5484,"children":5485},{"class":1029,"line":219},[5486,5490,5494,5499],{"type":993,"tag":1027,"props":5487,"children":5488},{"style":1110},[5489],{"type":999,"value":1113},{"type":993,"tag":1027,"props":5491,"children":5492},{"style":1042},[5493],{"type":999,"value":1118},{"type":993,"tag":1027,"props":5495,"children":5496},{"style":1059},[5497],{"type":999,"value":5498},"\"Original fruits:\"",{"type":993,"tag":1027,"props":5500,"children":5501},{"style":1042},[5502],{"type":999,"value":1128},{"type":993,"tag":1027,"props":5504,"children":5505},{"class":1029,"line":228},[5506],{"type":993,"tag":1027,"props":5507,"children":5508},{"emptyLinePlaceholder":13},[5509],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5511,"children":5512},{"class":1029,"line":238},[5513],{"type":993,"tag":1027,"props":5514,"children":5515},{"style":1033},[5516],{"type":999,"value":5517},"# Remove all occurrences of items in to_remove list\n",{"type":993,"tag":1027,"props":5519,"children":5520},{"class":1029,"line":247},[5521,5526,5530,5535,5539,5544,5548,5553,5557,5561,5566,5570],{"type":993,"tag":1027,"props":5522,"children":5523},{"style":1042},[5524],{"type":999,"value":5525},"fruits_filtered ",{"type":993,"tag":1027,"props":5527,"children":5528},{"style":1048},[5529],{"type":999,"value":1051},{"type":993,"tag":1027,"props":5531,"children":5532},{"style":1042},[5533],{"type":999,"value":5534}," [fruit ",{"type":993,"tag":1027,"props":5536,"children":5537},{"style":1048},[5538],{"type":999,"value":4069},{"type":993,"tag":1027,"props":5540,"children":5541},{"style":1042},[5542],{"type":999,"value":5543}," fruit ",{"type":993,"tag":1027,"props":5545,"children":5546},{"style":1048},[5547],{"type":999,"value":4079},{"type":993,"tag":1027,"props":5549,"children":5550},{"style":1042},[5551],{"type":999,"value":5552}," fruits ",{"type":993,"tag":1027,"props":5554,"children":5555},{"style":1048},[5556],{"type":999,"value":4571},{"type":993,"tag":1027,"props":5558,"children":5559},{"style":1042},[5560],{"type":999,"value":5543},{"type":993,"tag":1027,"props":5562,"children":5563},{"style":1048},[5564],{"type":999,"value":5565},"not",{"type":993,"tag":1027,"props":5567,"children":5568},{"style":1048},[5569],{"type":999,"value":5127},{"type":993,"tag":1027,"props":5571,"children":5572},{"style":1042},[5573],{"type":999,"value":5574}," to_remove]\n",{"type":993,"tag":1027,"props":5576,"children":5577},{"class":1029,"line":256},[5578,5582,5586,5591],{"type":993,"tag":1027,"props":5579,"children":5580},{"style":1110},[5581],{"type":999,"value":1113},{"type":993,"tag":1027,"props":5583,"children":5584},{"style":1042},[5585],{"type":999,"value":1118},{"type":993,"tag":1027,"props":5587,"children":5588},{"style":1059},[5589],{"type":999,"value":5590},"\"Filtered fruits:\"",{"type":993,"tag":1027,"props":5592,"children":5593},{"style":1042},[5594],{"type":999,"value":5595},", fruits_filtered)\n",{"type":993,"tag":5597,"props":5598,"children":5601},"exercise",{"hint":5599,"prompt":5600},"Use remove() for value, pop(index) for specific position, and pop() for last item!","Remove specific items from different positions in a list: remove by value, remove by index, and remove the last item.",[5602],{"type":993,"tag":1017,"props":5603,"children":5605},{"className":1019,"code":5604,"language":6,"meta":8,"style":8},"items = [\"first\", \"second\", \"third\", \"fourth\", \"fifth\", \"sixth\"]\nprint(\"Original:\", items)\n\n# Part 1: Remove \"third\" by value\n# TODO: Your code here\n\n# Part 2: Remove the item at index 1 (whatever it is now)\n# TODO: Your code here\n\n# Part 3: Remove the last item\n# TODO: Your code here\n\nprint(\"Final list:\", items)\n",[5606],{"type":993,"tag":1023,"props":5607,"children":5608},{"__ignoreMap":8},[5609,5679,5699,5706,5714,5732,5739,5747,5762,5769,5777,5792,5799],{"type":993,"tag":1027,"props":5610,"children":5611},{"class":1029,"line":12},[5612,5617,5621,5625,5630,5634,5639,5643,5648,5652,5657,5661,5666,5670,5675],{"type":993,"tag":1027,"props":5613,"children":5614},{"style":1042},[5615],{"type":999,"value":5616},"items ",{"type":993,"tag":1027,"props":5618,"children":5619},{"style":1048},[5620],{"type":999,"value":1051},{"type":993,"tag":1027,"props":5622,"children":5623},{"style":1042},[5624],{"type":999,"value":1056},{"type":993,"tag":1027,"props":5626,"children":5627},{"style":1059},[5628],{"type":999,"value":5629},"\"first\"",{"type":993,"tag":1027,"props":5631,"children":5632},{"style":1042},[5633],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5635,"children":5636},{"style":1059},[5637],{"type":999,"value":5638},"\"second\"",{"type":993,"tag":1027,"props":5640,"children":5641},{"style":1042},[5642],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5644,"children":5645},{"style":1059},[5646],{"type":999,"value":5647},"\"third\"",{"type":993,"tag":1027,"props":5649,"children":5650},{"style":1042},[5651],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5653,"children":5654},{"style":1059},[5655],{"type":999,"value":5656},"\"fourth\"",{"type":993,"tag":1027,"props":5658,"children":5659},{"style":1042},[5660],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5662,"children":5663},{"style":1059},[5664],{"type":999,"value":5665},"\"fifth\"",{"type":993,"tag":1027,"props":5667,"children":5668},{"style":1042},[5669],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5671,"children":5672},{"style":1059},[5673],{"type":999,"value":5674},"\"sixth\"",{"type":993,"tag":1027,"props":5676,"children":5677},{"style":1042},[5678],{"type":999,"value":1104},{"type":993,"tag":1027,"props":5680,"children":5681},{"class":1029,"line":27},[5682,5686,5690,5694],{"type":993,"tag":1027,"props":5683,"children":5684},{"style":1110},[5685],{"type":999,"value":1113},{"type":993,"tag":1027,"props":5687,"children":5688},{"style":1042},[5689],{"type":999,"value":1118},{"type":993,"tag":1027,"props":5691,"children":5692},{"style":1059},[5693],{"type":999,"value":1123},{"type":993,"tag":1027,"props":5695,"children":5696},{"style":1042},[5697],{"type":999,"value":5698},", items)\n",{"type":993,"tag":1027,"props":5700,"children":5701},{"class":1029,"line":36},[5702],{"type":993,"tag":1027,"props":5703,"children":5704},{"emptyLinePlaceholder":13},[5705],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5707,"children":5708},{"class":1029,"line":45},[5709],{"type":993,"tag":1027,"props":5710,"children":5711},{"style":1033},[5712],{"type":999,"value":5713},"# Part 1: Remove \"third\" by value\n",{"type":993,"tag":1027,"props":5715,"children":5716},{"class":1029,"line":54},[5717,5722,5727],{"type":993,"tag":1027,"props":5718,"children":5719},{"style":1033},[5720],{"type":999,"value":5721},"# ",{"type":993,"tag":1027,"props":5723,"children":5724},{"style":1048},[5725],{"type":999,"value":5726},"TODO",{"type":993,"tag":1027,"props":5728,"children":5729},{"style":1033},[5730],{"type":999,"value":5731},": Your code here\n",{"type":993,"tag":1027,"props":5733,"children":5734},{"class":1029,"line":63},[5735],{"type":993,"tag":1027,"props":5736,"children":5737},{"emptyLinePlaceholder":13},[5738],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5740,"children":5741},{"class":1029,"line":72},[5742],{"type":993,"tag":1027,"props":5743,"children":5744},{"style":1033},[5745],{"type":999,"value":5746},"# Part 2: Remove the item at index 1 (whatever it is now)\n",{"type":993,"tag":1027,"props":5748,"children":5749},{"class":1029,"line":81},[5750,5754,5758],{"type":993,"tag":1027,"props":5751,"children":5752},{"style":1033},[5753],{"type":999,"value":5721},{"type":993,"tag":1027,"props":5755,"children":5756},{"style":1048},[5757],{"type":999,"value":5726},{"type":993,"tag":1027,"props":5759,"children":5760},{"style":1033},[5761],{"type":999,"value":5731},{"type":993,"tag":1027,"props":5763,"children":5764},{"class":1029,"line":91},[5765],{"type":993,"tag":1027,"props":5766,"children":5767},{"emptyLinePlaceholder":13},[5768],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5770,"children":5771},{"class":1029,"line":100},[5772],{"type":993,"tag":1027,"props":5773,"children":5774},{"style":1033},[5775],{"type":999,"value":5776},"# Part 3: Remove the last item\n",{"type":993,"tag":1027,"props":5778,"children":5779},{"class":1029,"line":109},[5780,5784,5788],{"type":993,"tag":1027,"props":5781,"children":5782},{"style":1033},[5783],{"type":999,"value":5721},{"type":993,"tag":1027,"props":5785,"children":5786},{"style":1048},[5787],{"type":999,"value":5726},{"type":993,"tag":1027,"props":5789,"children":5790},{"style":1033},[5791],{"type":999,"value":5731},{"type":993,"tag":1027,"props":5793,"children":5794},{"class":1029,"line":118},[5795],{"type":993,"tag":1027,"props":5796,"children":5797},{"emptyLinePlaceholder":13},[5798],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5800,"children":5801},{"class":1029,"line":127},[5802,5806,5810,5815],{"type":993,"tag":1027,"props":5803,"children":5804},{"style":1110},[5805],{"type":999,"value":1113},{"type":993,"tag":1027,"props":5807,"children":5808},{"style":1042},[5809],{"type":999,"value":1118},{"type":993,"tag":1027,"props":5811,"children":5812},{"style":1059},[5813],{"type":999,"value":5814},"\"Final list:\"",{"type":993,"tag":1027,"props":5816,"children":5817},{"style":1042},[5818],{"type":999,"value":5698},{"type":993,"tag":1440,"props":5820,"children":5822},{"id":5821},"solution-and-explanation",[5823],{"type":999,"value":5824},"Solution and Explanation 💡",{"type":993,"tag":5826,"props":5827,"children":5828},"details",{},[5829,5837,6037,6045],{"type":993,"tag":5830,"props":5831,"children":5834},"summary",{"className":5832},[5833],"cursor-pointer",[5835],{"type":999,"value":5836},"Click to see the complete solution",{"type":993,"tag":1013,"props":5838,"children":5839},{},[5840],{"type":993,"tag":1017,"props":5841,"children":5843},{"className":1019,"code":5842,"language":6,"meta":8,"style":8},"items = [\"first\", \"second\", \"third\", \"fourth\", \"fifth\", \"sixth\"]\nprint(\"Original:\", items)\n\n# Part 1: Remove \"third\" by value\nitems.remove(\"third\")\n\n# Part 2: Remove the item at index 1 (whatever it is now)\nitems.pop(1)\n\n# Part 3: Remove the last item\nitems.pop()\n\nprint(\"Final list:\", items)\n",[5844],{"type":993,"tag":1023,"props":5845,"children":5846},{"__ignoreMap":8},[5847,5910,5929,5936,5943,5959,5966,5973,5989,5996,6003,6011,6018],{"type":993,"tag":1027,"props":5848,"children":5849},{"class":1029,"line":12},[5850,5854,5858,5862,5866,5870,5874,5878,5882,5886,5890,5894,5898,5902,5906],{"type":993,"tag":1027,"props":5851,"children":5852},{"style":1042},[5853],{"type":999,"value":5616},{"type":993,"tag":1027,"props":5855,"children":5856},{"style":1048},[5857],{"type":999,"value":1051},{"type":993,"tag":1027,"props":5859,"children":5860},{"style":1042},[5861],{"type":999,"value":1056},{"type":993,"tag":1027,"props":5863,"children":5864},{"style":1059},[5865],{"type":999,"value":5629},{"type":993,"tag":1027,"props":5867,"children":5868},{"style":1042},[5869],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5871,"children":5872},{"style":1059},[5873],{"type":999,"value":5638},{"type":993,"tag":1027,"props":5875,"children":5876},{"style":1042},[5877],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5879,"children":5880},{"style":1059},[5881],{"type":999,"value":5647},{"type":993,"tag":1027,"props":5883,"children":5884},{"style":1042},[5885],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5887,"children":5888},{"style":1059},[5889],{"type":999,"value":5656},{"type":993,"tag":1027,"props":5891,"children":5892},{"style":1042},[5893],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5895,"children":5896},{"style":1059},[5897],{"type":999,"value":5665},{"type":993,"tag":1027,"props":5899,"children":5900},{"style":1042},[5901],{"type":999,"value":1067},{"type":993,"tag":1027,"props":5903,"children":5904},{"style":1059},[5905],{"type":999,"value":5674},{"type":993,"tag":1027,"props":5907,"children":5908},{"style":1042},[5909],{"type":999,"value":1104},{"type":993,"tag":1027,"props":5911,"children":5912},{"class":1029,"line":27},[5913,5917,5921,5925],{"type":993,"tag":1027,"props":5914,"children":5915},{"style":1110},[5916],{"type":999,"value":1113},{"type":993,"tag":1027,"props":5918,"children":5919},{"style":1042},[5920],{"type":999,"value":1118},{"type":993,"tag":1027,"props":5922,"children":5923},{"style":1059},[5924],{"type":999,"value":1123},{"type":993,"tag":1027,"props":5926,"children":5927},{"style":1042},[5928],{"type":999,"value":5698},{"type":993,"tag":1027,"props":5930,"children":5931},{"class":1029,"line":36},[5932],{"type":993,"tag":1027,"props":5933,"children":5934},{"emptyLinePlaceholder":13},[5935],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5937,"children":5938},{"class":1029,"line":45},[5939],{"type":993,"tag":1027,"props":5940,"children":5941},{"style":1033},[5942],{"type":999,"value":5713},{"type":993,"tag":1027,"props":5944,"children":5945},{"class":1029,"line":54},[5946,5951,5955],{"type":993,"tag":1027,"props":5947,"children":5948},{"style":1042},[5949],{"type":999,"value":5950},"items.remove(",{"type":993,"tag":1027,"props":5952,"children":5953},{"style":1059},[5954],{"type":999,"value":5647},{"type":993,"tag":1027,"props":5956,"children":5957},{"style":1042},[5958],{"type":999,"value":1161},{"type":993,"tag":1027,"props":5960,"children":5961},{"class":1029,"line":63},[5962],{"type":993,"tag":1027,"props":5963,"children":5964},{"emptyLinePlaceholder":13},[5965],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5967,"children":5968},{"class":1029,"line":72},[5969],{"type":993,"tag":1027,"props":5970,"children":5971},{"style":1033},[5972],{"type":999,"value":5746},{"type":993,"tag":1027,"props":5974,"children":5975},{"class":1029,"line":81},[5976,5981,5985],{"type":993,"tag":1027,"props":5977,"children":5978},{"style":1042},[5979],{"type":999,"value":5980},"items.pop(",{"type":993,"tag":1027,"props":5982,"children":5983},{"style":1110},[5984],{"type":999,"value":1218},{"type":993,"tag":1027,"props":5986,"children":5987},{"style":1042},[5988],{"type":999,"value":1161},{"type":993,"tag":1027,"props":5990,"children":5991},{"class":1029,"line":91},[5992],{"type":993,"tag":1027,"props":5993,"children":5994},{"emptyLinePlaceholder":13},[5995],{"type":999,"value":1136},{"type":993,"tag":1027,"props":5997,"children":5998},{"class":1029,"line":100},[5999],{"type":993,"tag":1027,"props":6000,"children":6001},{"style":1033},[6002],{"type":999,"value":5776},{"type":993,"tag":1027,"props":6004,"children":6005},{"class":1029,"line":109},[6006],{"type":993,"tag":1027,"props":6007,"children":6008},{"style":1042},[6009],{"type":999,"value":6010},"items.pop()\n",{"type":993,"tag":1027,"props":6012,"children":6013},{"class":1029,"line":118},[6014],{"type":993,"tag":1027,"props":6015,"children":6016},{"emptyLinePlaceholder":13},[6017],{"type":999,"value":1136},{"type":993,"tag":1027,"props":6019,"children":6020},{"class":1029,"line":127},[6021,6025,6029,6033],{"type":993,"tag":1027,"props":6022,"children":6023},{"style":1110},[6024],{"type":999,"value":1113},{"type":993,"tag":1027,"props":6026,"children":6027},{"style":1042},[6028],{"type":999,"value":1118},{"type":993,"tag":1027,"props":6030,"children":6031},{"style":1059},[6032],{"type":999,"value":5814},{"type":993,"tag":1027,"props":6034,"children":6035},{"style":1042},[6036],{"type":999,"value":5698},{"type":993,"tag":1002,"props":6038,"children":6039},{},[6040],{"type":993,"tag":1352,"props":6041,"children":6042},{},[6043],{"type":999,"value":6044},"Key Learning Points:",{"type":993,"tag":1374,"props":6046,"children":6047},{},[6048,6060,6071,6082],{"type":993,"tag":1378,"props":6049,"children":6050},{},[6051,6053,6058],{"type":999,"value":6052},"📌 ",{"type":993,"tag":1352,"props":6054,"children":6055},{},[6056],{"type":999,"value":6057},"remove() method",{"type":999,"value":6059},": Removes first occurrence of a specific value",{"type":993,"tag":1378,"props":6061,"children":6062},{},[6063,6064,6069],{"type":999,"value":6052},{"type":993,"tag":1352,"props":6065,"children":6066},{},[6067],{"type":999,"value":6068},"pop(index)",{"type":999,"value":6070},": Removes and returns item at specific position",{"type":993,"tag":1378,"props":6072,"children":6073},{},[6074,6075,6080],{"type":999,"value":6052},{"type":993,"tag":1352,"props":6076,"children":6077},{},[6078],{"type":999,"value":6079},"pop() without index",{"type":999,"value":6081},": Removes and returns the last item",{"type":993,"tag":1378,"props":6083,"children":6084},{},[6085,6086,6091],{"type":999,"value":6052},{"type":993,"tag":1352,"props":6087,"children":6088},{},[6089],{"type":999,"value":6090},"Order matters",{"type":999,"value":6092},": Each removal changes the list, affecting subsequent operations",{"type":993,"tag":1322,"props":6094,"children":6096},{"id":6095},"common-removal-patterns",[6097],{"type":999,"value":6098},"Common Removal Patterns",{"type":993,"tag":1002,"props":6100,"children":6101},{},[6102],{"type":999,"value":6103},"Several patterns appear frequently when removing elements from lists in real-world programming:",{"type":993,"tag":1440,"props":6105,"children":6107},{"id":6106},"practical-patterns",[6108],{"type":999,"value":6109},"Practical Patterns",{"type":993,"tag":1002,"props":6111,"children":6112},{},[6113],{"type":999,"value":6114},"Real-world examples of list removal techniques:",{"type":993,"tag":1013,"props":6116,"children":6117},{},[6118],{"type":993,"tag":1017,"props":6119,"children":6121},{"className":1019,"code":6120,"language":6,"meta":8,"style":8},"# Data cleaning pattern - Remove invalid data\nuser_inputs = [\"\", \"valid_data\", None, \"another_valid\", 0, \"final\"]\nprint(\"Raw inputs:\", user_inputs)\n\n# Remove empty, None, and zero values\ncleaned = [item for item in user_inputs if item]\nprint(\"Cleaned inputs:\", cleaned)\n\n# Inventory management pattern\ninventory = [\"item1\", \"item2\", \"item3\", \"item4\", \"item5\"]\nsold_items = []\n\n# Sell items (remove from inventory, add to sold)\nwhile len(inventory) > 2:\n    sold_item = inventory.pop(0)\n    sold_items.append(sold_item)\n\nprint(\"Remaining inventory:\", inventory)\nprint(\"Sold items:\", sold_items)\n\n# Queue processing pattern (FIFO)\nqueue = [\"task1\", \"task2\", \"task3\", \"task4\"]\ncompleted = []\n\nprint(\"Initial queue:\", queue)\nwhile queue:\n    current_task = queue.pop(0)  # Remove from front\n    completed.append(current_task)\n    print(f\"Processed: {current_task}, Queue: {queue}\")\n\nprint(\"All completed:\", completed)\n\n# Filtering pattern - Conditional removal\nscores = [45, 78, 92, 34, 88, 67, 91]\nprint(\"All scores:\", scores)\n\n# Remove failing scores (below 60)\npassing_scores = [score for score in scores if score >= 60]\nprint(\"Passing scores:\", passing_scores)\n",[6122],{"type":993,"tag":1023,"props":6123,"children":6124},{"__ignoreMap":8},[6125,6133,6202,6223,6230,6238,6282,6303,6310,6318,6379,6395,6402,6410,6439,6464,6472,6479,6500,6521,6528,6536,6584,6600,6607,6628,6640,6670,6678,6737,6744,6765,6772,6780,6855,6874,6881,6889,6946],{"type":993,"tag":1027,"props":6126,"children":6127},{"class":1029,"line":12},[6128],{"type":993,"tag":1027,"props":6129,"children":6130},{"style":1033},[6131],{"type":999,"value":6132},"# Data cleaning pattern - Remove invalid data\n",{"type":993,"tag":1027,"props":6134,"children":6135},{"class":1029,"line":27},[6136,6141,6145,6149,6154,6158,6163,6167,6172,6176,6181,6185,6189,6193,6198],{"type":993,"tag":1027,"props":6137,"children":6138},{"style":1042},[6139],{"type":999,"value":6140},"user_inputs ",{"type":993,"tag":1027,"props":6142,"children":6143},{"style":1048},[6144],{"type":999,"value":1051},{"type":993,"tag":1027,"props":6146,"children":6147},{"style":1042},[6148],{"type":999,"value":1056},{"type":993,"tag":1027,"props":6150,"children":6151},{"style":1059},[6152],{"type":999,"value":6153},"\"\"",{"type":993,"tag":1027,"props":6155,"children":6156},{"style":1042},[6157],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6159,"children":6160},{"style":1059},[6161],{"type":999,"value":6162},"\"valid_data\"",{"type":993,"tag":1027,"props":6164,"children":6165},{"style":1042},[6166],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6168,"children":6169},{"style":1110},[6170],{"type":999,"value":6171},"None",{"type":993,"tag":1027,"props":6173,"children":6174},{"style":1042},[6175],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6177,"children":6178},{"style":1059},[6179],{"type":999,"value":6180},"\"another_valid\"",{"type":993,"tag":1027,"props":6182,"children":6183},{"style":1042},[6184],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6186,"children":6187},{"style":1110},[6188],{"type":999,"value":1296},{"type":993,"tag":1027,"props":6190,"children":6191},{"style":1042},[6192],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6194,"children":6195},{"style":1059},[6196],{"type":999,"value":6197},"\"final\"",{"type":993,"tag":1027,"props":6199,"children":6200},{"style":1042},[6201],{"type":999,"value":1104},{"type":993,"tag":1027,"props":6203,"children":6204},{"class":1029,"line":36},[6205,6209,6213,6218],{"type":993,"tag":1027,"props":6206,"children":6207},{"style":1110},[6208],{"type":999,"value":1113},{"type":993,"tag":1027,"props":6210,"children":6211},{"style":1042},[6212],{"type":999,"value":1118},{"type":993,"tag":1027,"props":6214,"children":6215},{"style":1059},[6216],{"type":999,"value":6217},"\"Raw inputs:\"",{"type":993,"tag":1027,"props":6219,"children":6220},{"style":1042},[6221],{"type":999,"value":6222},", user_inputs)\n",{"type":993,"tag":1027,"props":6224,"children":6225},{"class":1029,"line":45},[6226],{"type":993,"tag":1027,"props":6227,"children":6228},{"emptyLinePlaceholder":13},[6229],{"type":999,"value":1136},{"type":993,"tag":1027,"props":6231,"children":6232},{"class":1029,"line":54},[6233],{"type":993,"tag":1027,"props":6234,"children":6235},{"style":1033},[6236],{"type":999,"value":6237},"# Remove empty, None, and zero values\n",{"type":993,"tag":1027,"props":6239,"children":6240},{"class":1029,"line":63},[6241,6246,6250,6255,6259,6264,6268,6273,6277],{"type":993,"tag":1027,"props":6242,"children":6243},{"style":1042},[6244],{"type":999,"value":6245},"cleaned ",{"type":993,"tag":1027,"props":6247,"children":6248},{"style":1048},[6249],{"type":999,"value":1051},{"type":993,"tag":1027,"props":6251,"children":6252},{"style":1042},[6253],{"type":999,"value":6254}," [item ",{"type":993,"tag":1027,"props":6256,"children":6257},{"style":1048},[6258],{"type":999,"value":4069},{"type":993,"tag":1027,"props":6260,"children":6261},{"style":1042},[6262],{"type":999,"value":6263}," item ",{"type":993,"tag":1027,"props":6265,"children":6266},{"style":1048},[6267],{"type":999,"value":4079},{"type":993,"tag":1027,"props":6269,"children":6270},{"style":1042},[6271],{"type":999,"value":6272}," user_inputs ",{"type":993,"tag":1027,"props":6274,"children":6275},{"style":1048},[6276],{"type":999,"value":4571},{"type":993,"tag":1027,"props":6278,"children":6279},{"style":1042},[6280],{"type":999,"value":6281}," item]\n",{"type":993,"tag":1027,"props":6283,"children":6284},{"class":1029,"line":72},[6285,6289,6293,6298],{"type":993,"tag":1027,"props":6286,"children":6287},{"style":1110},[6288],{"type":999,"value":1113},{"type":993,"tag":1027,"props":6290,"children":6291},{"style":1042},[6292],{"type":999,"value":1118},{"type":993,"tag":1027,"props":6294,"children":6295},{"style":1059},[6296],{"type":999,"value":6297},"\"Cleaned inputs:\"",{"type":993,"tag":1027,"props":6299,"children":6300},{"style":1042},[6301],{"type":999,"value":6302},", cleaned)\n",{"type":993,"tag":1027,"props":6304,"children":6305},{"class":1029,"line":81},[6306],{"type":993,"tag":1027,"props":6307,"children":6308},{"emptyLinePlaceholder":13},[6309],{"type":999,"value":1136},{"type":993,"tag":1027,"props":6311,"children":6312},{"class":1029,"line":91},[6313],{"type":993,"tag":1027,"props":6314,"children":6315},{"style":1033},[6316],{"type":999,"value":6317},"# Inventory management pattern\n",{"type":993,"tag":1027,"props":6319,"children":6320},{"class":1029,"line":100},[6321,6326,6330,6334,6339,6343,6348,6352,6357,6361,6366,6370,6375],{"type":993,"tag":1027,"props":6322,"children":6323},{"style":1042},[6324],{"type":999,"value":6325},"inventory ",{"type":993,"tag":1027,"props":6327,"children":6328},{"style":1048},[6329],{"type":999,"value":1051},{"type":993,"tag":1027,"props":6331,"children":6332},{"style":1042},[6333],{"type":999,"value":1056},{"type":993,"tag":1027,"props":6335,"children":6336},{"style":1059},[6337],{"type":999,"value":6338},"\"item1\"",{"type":993,"tag":1027,"props":6340,"children":6341},{"style":1042},[6342],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6344,"children":6345},{"style":1059},[6346],{"type":999,"value":6347},"\"item2\"",{"type":993,"tag":1027,"props":6349,"children":6350},{"style":1042},[6351],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6353,"children":6354},{"style":1059},[6355],{"type":999,"value":6356},"\"item3\"",{"type":993,"tag":1027,"props":6358,"children":6359},{"style":1042},[6360],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6362,"children":6363},{"style":1059},[6364],{"type":999,"value":6365},"\"item4\"",{"type":993,"tag":1027,"props":6367,"children":6368},{"style":1042},[6369],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6371,"children":6372},{"style":1059},[6373],{"type":999,"value":6374},"\"item5\"",{"type":993,"tag":1027,"props":6376,"children":6377},{"style":1042},[6378],{"type":999,"value":1104},{"type":993,"tag":1027,"props":6380,"children":6381},{"class":1029,"line":109},[6382,6387,6391],{"type":993,"tag":1027,"props":6383,"children":6384},{"style":1042},[6385],{"type":999,"value":6386},"sold_items ",{"type":993,"tag":1027,"props":6388,"children":6389},{"style":1048},[6390],{"type":999,"value":1051},{"type":993,"tag":1027,"props":6392,"children":6393},{"style":1042},[6394],{"type":999,"value":4061},{"type":993,"tag":1027,"props":6396,"children":6397},{"class":1029,"line":118},[6398],{"type":993,"tag":1027,"props":6399,"children":6400},{"emptyLinePlaceholder":13},[6401],{"type":999,"value":1136},{"type":993,"tag":1027,"props":6403,"children":6404},{"class":1029,"line":127},[6405],{"type":993,"tag":1027,"props":6406,"children":6407},{"style":1033},[6408],{"type":999,"value":6409},"# Sell items (remove from inventory, add to sold)\n",{"type":993,"tag":1027,"props":6411,"children":6412},{"class":1029,"line":136},[6413,6417,6421,6426,6431,6435],{"type":993,"tag":1027,"props":6414,"children":6415},{"style":1048},[6416],{"type":999,"value":2458},{"type":993,"tag":1027,"props":6418,"children":6419},{"style":1110},[6420],{"type":999,"value":4822},{"type":993,"tag":1027,"props":6422,"children":6423},{"style":1042},[6424],{"type":999,"value":6425},"(inventory) ",{"type":993,"tag":1027,"props":6427,"children":6428},{"style":1048},[6429],{"type":999,"value":6430},">",{"type":993,"tag":1027,"props":6432,"children":6433},{"style":1110},[6434],{"type":999,"value":5122},{"type":993,"tag":1027,"props":6436,"children":6437},{"style":1042},[6438],{"type":999,"value":4384},{"type":993,"tag":1027,"props":6440,"children":6441},{"class":1029,"line":146},[6442,6447,6451,6456,6460],{"type":993,"tag":1027,"props":6443,"children":6444},{"style":1042},[6445],{"type":999,"value":6446},"    sold_item ",{"type":993,"tag":1027,"props":6448,"children":6449},{"style":1048},[6450],{"type":999,"value":1051},{"type":993,"tag":1027,"props":6452,"children":6453},{"style":1042},[6454],{"type":999,"value":6455}," inventory.pop(",{"type":993,"tag":1027,"props":6457,"children":6458},{"style":1110},[6459],{"type":999,"value":1296},{"type":993,"tag":1027,"props":6461,"children":6462},{"style":1042},[6463],{"type":999,"value":1161},{"type":993,"tag":1027,"props":6465,"children":6466},{"class":1029,"line":155},[6467],{"type":993,"tag":1027,"props":6468,"children":6469},{"style":1042},[6470],{"type":999,"value":6471},"    sold_items.append(sold_item)\n",{"type":993,"tag":1027,"props":6473,"children":6474},{"class":1029,"line":164},[6475],{"type":993,"tag":1027,"props":6476,"children":6477},{"emptyLinePlaceholder":13},[6478],{"type":999,"value":1136},{"type":993,"tag":1027,"props":6480,"children":6481},{"class":1029,"line":173},[6482,6486,6490,6495],{"type":993,"tag":1027,"props":6483,"children":6484},{"style":1110},[6485],{"type":999,"value":1113},{"type":993,"tag":1027,"props":6487,"children":6488},{"style":1042},[6489],{"type":999,"value":1118},{"type":993,"tag":1027,"props":6491,"children":6492},{"style":1059},[6493],{"type":999,"value":6494},"\"Remaining inventory:\"",{"type":993,"tag":1027,"props":6496,"children":6497},{"style":1042},[6498],{"type":999,"value":6499},", inventory)\n",{"type":993,"tag":1027,"props":6501,"children":6502},{"class":1029,"line":182},[6503,6507,6511,6516],{"type":993,"tag":1027,"props":6504,"children":6505},{"style":1110},[6506],{"type":999,"value":1113},{"type":993,"tag":1027,"props":6508,"children":6509},{"style":1042},[6510],{"type":999,"value":1118},{"type":993,"tag":1027,"props":6512,"children":6513},{"style":1059},[6514],{"type":999,"value":6515},"\"Sold items:\"",{"type":993,"tag":1027,"props":6517,"children":6518},{"style":1042},[6519],{"type":999,"value":6520},", sold_items)\n",{"type":993,"tag":1027,"props":6522,"children":6523},{"class":1029,"line":191},[6524],{"type":993,"tag":1027,"props":6525,"children":6526},{"emptyLinePlaceholder":13},[6527],{"type":999,"value":1136},{"type":993,"tag":1027,"props":6529,"children":6530},{"class":1029,"line":201},[6531],{"type":993,"tag":1027,"props":6532,"children":6533},{"style":1033},[6534],{"type":999,"value":6535},"# Queue processing pattern (FIFO)\n",{"type":993,"tag":1027,"props":6537,"children":6538},{"class":1029,"line":210},[6539,6544,6548,6552,6556,6560,6564,6568,6572,6576,6580],{"type":993,"tag":1027,"props":6540,"children":6541},{"style":1042},[6542],{"type":999,"value":6543},"queue ",{"type":993,"tag":1027,"props":6545,"children":6546},{"style":1048},[6547],{"type":999,"value":1051},{"type":993,"tag":1027,"props":6549,"children":6550},{"style":1042},[6551],{"type":999,"value":1056},{"type":993,"tag":1027,"props":6553,"children":6554},{"style":1059},[6555],{"type":999,"value":3705},{"type":993,"tag":1027,"props":6557,"children":6558},{"style":1042},[6559],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6561,"children":6562},{"style":1059},[6563],{"type":999,"value":3714},{"type":993,"tag":1027,"props":6565,"children":6566},{"style":1042},[6567],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6569,"children":6570},{"style":1059},[6571],{"type":999,"value":3723},{"type":993,"tag":1027,"props":6573,"children":6574},{"style":1042},[6575],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6577,"children":6578},{"style":1059},[6579],{"type":999,"value":3732},{"type":993,"tag":1027,"props":6581,"children":6582},{"style":1042},[6583],{"type":999,"value":1104},{"type":993,"tag":1027,"props":6585,"children":6586},{"class":1029,"line":219},[6587,6592,6596],{"type":993,"tag":1027,"props":6588,"children":6589},{"style":1042},[6590],{"type":999,"value":6591},"completed ",{"type":993,"tag":1027,"props":6593,"children":6594},{"style":1048},[6595],{"type":999,"value":1051},{"type":993,"tag":1027,"props":6597,"children":6598},{"style":1042},[6599],{"type":999,"value":4061},{"type":993,"tag":1027,"props":6601,"children":6602},{"class":1029,"line":228},[6603],{"type":993,"tag":1027,"props":6604,"children":6605},{"emptyLinePlaceholder":13},[6606],{"type":999,"value":1136},{"type":993,"tag":1027,"props":6608,"children":6609},{"class":1029,"line":238},[6610,6614,6618,6623],{"type":993,"tag":1027,"props":6611,"children":6612},{"style":1110},[6613],{"type":999,"value":1113},{"type":993,"tag":1027,"props":6615,"children":6616},{"style":1042},[6617],{"type":999,"value":1118},{"type":993,"tag":1027,"props":6619,"children":6620},{"style":1059},[6621],{"type":999,"value":6622},"\"Initial queue:\"",{"type":993,"tag":1027,"props":6624,"children":6625},{"style":1042},[6626],{"type":999,"value":6627},", queue)\n",{"type":993,"tag":1027,"props":6629,"children":6630},{"class":1029,"line":247},[6631,6635],{"type":993,"tag":1027,"props":6632,"children":6633},{"style":1048},[6634],{"type":999,"value":2458},{"type":993,"tag":1027,"props":6636,"children":6637},{"style":1042},[6638],{"type":999,"value":6639}," queue:\n",{"type":993,"tag":1027,"props":6641,"children":6642},{"class":1029,"line":256},[6643,6648,6652,6657,6661,6665],{"type":993,"tag":1027,"props":6644,"children":6645},{"style":1042},[6646],{"type":999,"value":6647},"    current_task ",{"type":993,"tag":1027,"props":6649,"children":6650},{"style":1048},[6651],{"type":999,"value":1051},{"type":993,"tag":1027,"props":6653,"children":6654},{"style":1042},[6655],{"type":999,"value":6656}," queue.pop(",{"type":993,"tag":1027,"props":6658,"children":6659},{"style":1110},[6660],{"type":999,"value":1296},{"type":993,"tag":1027,"props":6662,"children":6663},{"style":1042},[6664],{"type":999,"value":1942},{"type":993,"tag":1027,"props":6666,"children":6667},{"style":1033},[6668],{"type":999,"value":6669},"# Remove from front\n",{"type":993,"tag":1027,"props":6671,"children":6672},{"class":1029,"line":265},[6673],{"type":993,"tag":1027,"props":6674,"children":6675},{"style":1042},[6676],{"type":999,"value":6677},"    completed.append(current_task)\n",{"type":993,"tag":1027,"props":6679,"children":6680},{"class":1029,"line":274},[6681,6685,6689,6693,6698,6702,6707,6711,6716,6720,6725,6729,6733],{"type":993,"tag":1027,"props":6682,"children":6683},{"style":1110},[6684],{"type":999,"value":2488},{"type":993,"tag":1027,"props":6686,"children":6687},{"style":1042},[6688],{"type":999,"value":1118},{"type":993,"tag":1027,"props":6690,"children":6691},{"style":1048},[6692],{"type":999,"value":2497},{"type":993,"tag":1027,"props":6694,"children":6695},{"style":1059},[6696],{"type":999,"value":6697},"\"Processed: ",{"type":993,"tag":1027,"props":6699,"children":6700},{"style":1110},[6701],{"type":999,"value":2507},{"type":993,"tag":1027,"props":6703,"children":6704},{"style":1042},[6705],{"type":999,"value":6706},"current_task",{"type":993,"tag":1027,"props":6708,"children":6709},{"style":1110},[6710],{"type":999,"value":2517},{"type":993,"tag":1027,"props":6712,"children":6713},{"style":1059},[6714],{"type":999,"value":6715},", Queue: ",{"type":993,"tag":1027,"props":6717,"children":6718},{"style":1110},[6719],{"type":999,"value":2507},{"type":993,"tag":1027,"props":6721,"children":6722},{"style":1042},[6723],{"type":999,"value":6724},"queue",{"type":993,"tag":1027,"props":6726,"children":6727},{"style":1110},[6728],{"type":999,"value":2517},{"type":993,"tag":1027,"props":6730,"children":6731},{"style":1059},[6732],{"type":999,"value":2540},{"type":993,"tag":1027,"props":6734,"children":6735},{"style":1042},[6736],{"type":999,"value":1161},{"type":993,"tag":1027,"props":6738,"children":6739},{"class":1029,"line":284},[6740],{"type":993,"tag":1027,"props":6741,"children":6742},{"emptyLinePlaceholder":13},[6743],{"type":999,"value":1136},{"type":993,"tag":1027,"props":6745,"children":6746},{"class":1029,"line":293},[6747,6751,6755,6760],{"type":993,"tag":1027,"props":6748,"children":6749},{"style":1110},[6750],{"type":999,"value":1113},{"type":993,"tag":1027,"props":6752,"children":6753},{"style":1042},[6754],{"type":999,"value":1118},{"type":993,"tag":1027,"props":6756,"children":6757},{"style":1059},[6758],{"type":999,"value":6759},"\"All completed:\"",{"type":993,"tag":1027,"props":6761,"children":6762},{"style":1042},[6763],{"type":999,"value":6764},", completed)\n",{"type":993,"tag":1027,"props":6766,"children":6767},{"class":1029,"line":302},[6768],{"type":993,"tag":1027,"props":6769,"children":6770},{"emptyLinePlaceholder":13},[6771],{"type":999,"value":1136},{"type":993,"tag":1027,"props":6773,"children":6774},{"class":1029,"line":311},[6775],{"type":993,"tag":1027,"props":6776,"children":6777},{"style":1033},[6778],{"type":999,"value":6779},"# Filtering pattern - Conditional removal\n",{"type":993,"tag":1027,"props":6781,"children":6782},{"class":1029,"line":320},[6783,6787,6791,6795,6800,6804,6808,6812,6816,6820,6825,6829,6833,6837,6842,6846,6851],{"type":993,"tag":1027,"props":6784,"children":6785},{"style":1042},[6786],{"type":999,"value":2567},{"type":993,"tag":1027,"props":6788,"children":6789},{"style":1048},[6790],{"type":999,"value":1051},{"type":993,"tag":1027,"props":6792,"children":6793},{"style":1042},[6794],{"type":999,"value":1056},{"type":993,"tag":1027,"props":6796,"children":6797},{"style":1110},[6798],{"type":999,"value":6799},"45",{"type":993,"tag":1027,"props":6801,"children":6802},{"style":1042},[6803],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6805,"children":6806},{"style":1110},[6807],{"type":999,"value":2598},{"type":993,"tag":1027,"props":6809,"children":6810},{"style":1042},[6811],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6813,"children":6814},{"style":1110},[6815],{"type":999,"value":2589},{"type":993,"tag":1027,"props":6817,"children":6818},{"style":1042},[6819],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6821,"children":6822},{"style":1110},[6823],{"type":999,"value":6824},"34",{"type":993,"tag":1027,"props":6826,"children":6827},{"style":1042},[6828],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6830,"children":6831},{"style":1110},[6832],{"type":999,"value":2616},{"type":993,"tag":1027,"props":6834,"children":6835},{"style":1042},[6836],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6838,"children":6839},{"style":1110},[6840],{"type":999,"value":6841},"67",{"type":993,"tag":1027,"props":6843,"children":6844},{"style":1042},[6845],{"type":999,"value":1067},{"type":993,"tag":1027,"props":6847,"children":6848},{"style":1110},[6849],{"type":999,"value":6850},"91",{"type":993,"tag":1027,"props":6852,"children":6853},{"style":1042},[6854],{"type":999,"value":1104},{"type":993,"tag":1027,"props":6856,"children":6857},{"class":1029,"line":329},[6858,6862,6866,6870],{"type":993,"tag":1027,"props":6859,"children":6860},{"style":1110},[6861],{"type":999,"value":1113},{"type":993,"tag":1027,"props":6863,"children":6864},{"style":1042},[6865],{"type":999,"value":1118},{"type":993,"tag":1027,"props":6867,"children":6868},{"style":1059},[6869],{"type":999,"value":2636},{"type":993,"tag":1027,"props":6871,"children":6872},{"style":1042},[6873],{"type":999,"value":2641},{"type":993,"tag":1027,"props":6875,"children":6876},{"class":1029,"line":338},[6877],{"type":993,"tag":1027,"props":6878,"children":6879},{"emptyLinePlaceholder":13},[6880],{"type":999,"value":1136},{"type":993,"tag":1027,"props":6882,"children":6883},{"class":1029,"line":347},[6884],{"type":993,"tag":1027,"props":6885,"children":6886},{"style":1033},[6887],{"type":999,"value":6888},"# Remove failing scores (below 60)\n",{"type":993,"tag":1027,"props":6890,"children":6891},{"class":1029,"line":356},[6892,6897,6901,6906,6910,6915,6919,6924,6928,6932,6937,6942],{"type":993,"tag":1027,"props":6893,"children":6894},{"style":1042},[6895],{"type":999,"value":6896},"passing_scores ",{"type":993,"tag":1027,"props":6898,"children":6899},{"style":1048},[6900],{"type":999,"value":1051},{"type":993,"tag":1027,"props":6902,"children":6903},{"style":1042},[6904],{"type":999,"value":6905}," [score ",{"type":993,"tag":1027,"props":6907,"children":6908},{"style":1048},[6909],{"type":999,"value":4069},{"type":993,"tag":1027,"props":6911,"children":6912},{"style":1042},[6913],{"type":999,"value":6914}," score ",{"type":993,"tag":1027,"props":6916,"children":6917},{"style":1048},[6918],{"type":999,"value":4079},{"type":993,"tag":1027,"props":6920,"children":6921},{"style":1042},[6922],{"type":999,"value":6923}," scores ",{"type":993,"tag":1027,"props":6925,"children":6926},{"style":1048},[6927],{"type":999,"value":4571},{"type":993,"tag":1027,"props":6929,"children":6930},{"style":1042},[6931],{"type":999,"value":6914},{"type":993,"tag":1027,"props":6933,"children":6934},{"style":1048},[6935],{"type":999,"value":6936},">=",{"type":993,"tag":1027,"props":6938,"children":6939},{"style":1110},[6940],{"type":999,"value":6941}," 60",{"type":993,"tag":1027,"props":6943,"children":6944},{"style":1042},[6945],{"type":999,"value":1104},{"type":993,"tag":1027,"props":6947,"children":6948},{"class":1029,"line":365},[6949,6953,6957,6962],{"type":993,"tag":1027,"props":6950,"children":6951},{"style":1110},[6952],{"type":999,"value":1113},{"type":993,"tag":1027,"props":6954,"children":6955},{"style":1042},[6956],{"type":999,"value":1118},{"type":993,"tag":1027,"props":6958,"children":6959},{"style":1059},[6960],{"type":999,"value":6961},"\"Passing scores:\"",{"type":993,"tag":1027,"props":6963,"children":6964},{"style":1042},[6965],{"type":999,"value":6966},", passing_scores)\n",{"type":993,"tag":1322,"props":6968,"children":6970},{"id":6969},"list-removal-reference",[6971],{"type":999,"value":6972},"List Removal Reference",{"type":993,"tag":1002,"props":6974,"children":6975},{},[6976],{"type":999,"value":6977},"Python provides various methods for removing elements from lists:",{"type":993,"tag":6979,"props":6980,"children":6981},"table",{},[6982,7016],{"type":993,"tag":6983,"props":6984,"children":6985},"thead",{},[6986],{"type":993,"tag":6987,"props":6988,"children":6989},"tr",{},[6990,6996,7001,7006,7011],{"type":993,"tag":6991,"props":6992,"children":6993},"th",{},[6994],{"type":999,"value":6995},"Method",{"type":993,"tag":6991,"props":6997,"children":6998},{},[6999],{"type":999,"value":7000},"Purpose",{"type":993,"tag":6991,"props":7002,"children":7003},{},[7004],{"type":999,"value":7005},"Syntax",{"type":993,"tag":6991,"props":7007,"children":7008},{},[7009],{"type":999,"value":7010},"Returns",{"type":993,"tag":6991,"props":7012,"children":7013},{},[7014],{"type":999,"value":7015},"Handles Missing",{"type":993,"tag":7017,"props":7018,"children":7019},"tbody",{},[7020,7056,7091,7123,7156,7189,7221],{"type":993,"tag":6987,"props":7021,"children":7022},{},[7023,7033,7038,7047,7051],{"type":993,"tag":7024,"props":7025,"children":7026},"td",{},[7027],{"type":993,"tag":1023,"props":7028,"children":7030},{"className":7029},[],[7031],{"type":999,"value":7032},"remove(value)",{"type":993,"tag":7024,"props":7034,"children":7035},{},[7036],{"type":999,"value":7037},"Remove first occurrence",{"type":993,"tag":7024,"props":7039,"children":7040},{},[7041],{"type":993,"tag":1023,"props":7042,"children":7044},{"className":7043},[],[7045],{"type":999,"value":7046},"list.remove(x)",{"type":993,"tag":7024,"props":7048,"children":7049},{},[7050],{"type":999,"value":6171},{"type":993,"tag":7024,"props":7052,"children":7053},{},[7054],{"type":999,"value":7055},"Raises ValueError",{"type":993,"tag":6987,"props":7057,"children":7058},{},[7059,7067,7072,7081,7086],{"type":993,"tag":7024,"props":7060,"children":7061},{},[7062],{"type":993,"tag":1023,"props":7063,"children":7065},{"className":7064},[],[7066],{"type":999,"value":6068},{"type":993,"tag":7024,"props":7068,"children":7069},{},[7070],{"type":999,"value":7071},"Remove by position",{"type":993,"tag":7024,"props":7073,"children":7074},{},[7075],{"type":993,"tag":1023,"props":7076,"children":7078},{"className":7077},[],[7079],{"type":999,"value":7080},"list.pop(i)",{"type":993,"tag":7024,"props":7082,"children":7083},{},[7084],{"type":999,"value":7085},"Removed element",{"type":993,"tag":7024,"props":7087,"children":7088},{},[7089],{"type":999,"value":7090},"Raises IndexError",{"type":993,"tag":6987,"props":7092,"children":7093},{},[7094,7102,7107,7115,7119],{"type":993,"tag":7024,"props":7095,"children":7096},{},[7097],{"type":993,"tag":1023,"props":7098,"children":7100},{"className":7099},[],[7101],{"type":999,"value":1983},{"type":993,"tag":7024,"props":7103,"children":7104},{},[7105],{"type":999,"value":7106},"Remove last element",{"type":993,"tag":7024,"props":7108,"children":7109},{},[7110],{"type":993,"tag":1023,"props":7111,"children":7113},{"className":7112},[],[7114],{"type":999,"value":2013},{"type":993,"tag":7024,"props":7116,"children":7117},{},[7118],{"type":999,"value":7085},{"type":993,"tag":7024,"props":7120,"children":7121},{},[7122],{"type":999,"value":7090},{"type":993,"tag":6987,"props":7124,"children":7125},{},[7126,7134,7139,7148,7152],{"type":993,"tag":7024,"props":7127,"children":7128},{},[7129],{"type":993,"tag":1023,"props":7130,"children":7132},{"className":7131},[],[7133],{"type":999,"value":2784},{"type":993,"tag":7024,"props":7135,"children":7136},{},[7137],{"type":999,"value":7138},"Delete by position",{"type":993,"tag":7024,"props":7140,"children":7141},{},[7142],{"type":993,"tag":1023,"props":7143,"children":7145},{"className":7144},[],[7146],{"type":999,"value":7147},"del list[i]",{"type":993,"tag":7024,"props":7149,"children":7150},{},[7151],{"type":999,"value":6171},{"type":993,"tag":7024,"props":7153,"children":7154},{},[7155],{"type":999,"value":7090},{"type":993,"tag":6987,"props":7157,"children":7158},{},[7159,7167,7172,7180,7184],{"type":993,"tag":7024,"props":7160,"children":7161},{},[7162],{"type":993,"tag":1023,"props":7163,"children":7165},{"className":7164},[],[7166],{"type":999,"value":2791},{"type":993,"tag":7024,"props":7168,"children":7169},{},[7170],{"type":999,"value":7171},"Delete slice",{"type":993,"tag":7024,"props":7173,"children":7174},{},[7175],{"type":993,"tag":1023,"props":7176,"children":7178},{"className":7177},[],[7179],{"type":999,"value":2841},{"type":993,"tag":7024,"props":7181,"children":7182},{},[7183],{"type":999,"value":6171},{"type":993,"tag":7024,"props":7185,"children":7186},{},[7187],{"type":999,"value":7188},"No error",{"type":993,"tag":6987,"props":7190,"children":7191},{},[7192,7200,7205,7213,7217],{"type":993,"tag":7024,"props":7193,"children":7194},{},[7195],{"type":993,"tag":1023,"props":7196,"children":7198},{"className":7197},[],[7199],{"type":999,"value":3541},{"type":993,"tag":7024,"props":7201,"children":7202},{},[7203],{"type":999,"value":7204},"Remove all elements",{"type":993,"tag":7024,"props":7206,"children":7207},{},[7208],{"type":993,"tag":1023,"props":7209,"children":7211},{"className":7210},[],[7212],{"type":999,"value":3568},{"type":993,"tag":7024,"props":7214,"children":7215},{},[7216],{"type":999,"value":6171},{"type":993,"tag":7024,"props":7218,"children":7219},{},[7220],{"type":999,"value":7188},{"type":993,"tag":6987,"props":7222,"children":7223},{},[7224,7229,7234,7243,7248],{"type":993,"tag":7024,"props":7225,"children":7226},{},[7227],{"type":999,"value":7228},"List comprehension",{"type":993,"tag":7024,"props":7230,"children":7231},{},[7232],{"type":999,"value":7233},"Filter elements",{"type":993,"tag":7024,"props":7235,"children":7236},{},[7237],{"type":993,"tag":1023,"props":7238,"children":7240},{"className":7239},[],[7241],{"type":999,"value":7242},"[x for x in list if condition]",{"type":993,"tag":7024,"props":7244,"children":7245},{},[7246],{"type":999,"value":7247},"New list",{"type":993,"tag":7024,"props":7249,"children":7250},{},[7251],{"type":999,"value":7188},{"type":993,"tag":1002,"props":7253,"children":7254},{},[7255],{"type":999,"value":7256},"Choose the method that best fits your specific removal needs and error handling requirements.",{"type":993,"tag":1342,"props":7258,"children":7261},{"emoji":7259,"title":7260,"type":1990},"🎯","Removal Best Practices",[7262,7270,7293,7301,7324,7332],{"type":993,"tag":1002,"props":7263,"children":7264},{},[7265],{"type":993,"tag":1352,"props":7266,"children":7267},{},[7268],{"type":999,"value":7269},"Safety Guidelines:",{"type":993,"tag":1374,"props":7271,"children":7272},{},[7273,7278,7283,7288],{"type":993,"tag":1378,"props":7274,"children":7275},{},[7276],{"type":999,"value":7277},"Always check if elements exist before using remove()",{"type":993,"tag":1378,"props":7279,"children":7280},{},[7281],{"type":999,"value":7282},"Use try/except blocks for error handling",{"type":993,"tag":1378,"props":7284,"children":7285},{},[7286],{"type":999,"value":7287},"Validate indices before using pop() or del",{"type":993,"tag":1378,"props":7289,"children":7290},{},[7291],{"type":999,"value":7292},"Consider list comprehensions for multiple removals",{"type":993,"tag":1002,"props":7294,"children":7295},{},[7296],{"type":993,"tag":1352,"props":7297,"children":7298},{},[7299],{"type":999,"value":7300},"Performance Tips:",{"type":993,"tag":1374,"props":7302,"children":7303},{},[7304,7309,7314,7319],{"type":993,"tag":1378,"props":7305,"children":7306},{},[7307],{"type":999,"value":7308},"Use del for simple deletion without return value",{"type":993,"tag":1378,"props":7310,"children":7311},{},[7312],{"type":999,"value":7313},"Use pop() when you need the removed value",{"type":993,"tag":1378,"props":7315,"children":7316},{},[7317],{"type":999,"value":7318},"Use list comprehensions for filtering multiple items",{"type":993,"tag":1378,"props":7320,"children":7321},{},[7322],{"type":999,"value":7323},"Avoid removing from beginning of large lists (use collections.deque)",{"type":993,"tag":1002,"props":7325,"children":7326},{},[7327],{"type":993,"tag":1352,"props":7328,"children":7329},{},[7330],{"type":999,"value":7331},"Code Clarity:",{"type":993,"tag":1374,"props":7333,"children":7334},{},[7335,7340,7351],{"type":993,"tag":1378,"props":7336,"children":7337},{},[7338],{"type":999,"value":7339},"Choose method that clearly expresses intent",{"type":993,"tag":1378,"props":7341,"children":7342},{},[7343,7345,7349],{"type":999,"value":7344},"Use clear() instead of del list",{"type":993,"tag":1027,"props":7346,"children":7347},{},[7348],{"type":999,"value":3160},{"type":999,"value":7350}," for emptying",{"type":993,"tag":1378,"props":7352,"children":7353},{},[7354],{"type":999,"value":7355},"Document why specific removal method was chosen",{"type":993,"tag":1322,"props":7357,"children":7359},{"id":7358},"take-quiz",[7360],{"type":999,"value":7361},"Take Quiz",{"type":993,"tag":1002,"props":7363,"children":7364},{},[7365],{"type":999,"value":7366},"Test your understanding of removing from lists:",{"type":993,"tag":7368,"props":7369,"children":7371},"redirect-button",{"label":7361,"url":7370},"/tutorial-quiz/python/removing-from-lists",[],{"type":993,"tag":1322,"props":7373,"children":7375},{"id":7374},"whats-next",[7376],{"type":999,"value":7377},"What's Next?",{"type":993,"tag":1002,"props":7379,"children":7380},{},[7381,7383,7388,7390,7396],{"type":999,"value":7382},"Now that you know how to remove elements from lists, you're ready to learn about ",{"type":993,"tag":1352,"props":7384,"children":7385},{},[7386],{"type":999,"value":7387},"looping through lists",{"type":999,"value":7389},". This includes various ways to iterate over list elements and process them efficiently using ",{"type":993,"tag":7391,"props":7392,"children":7393},"a",{"href":243},[7394],{"type":999,"value":7395},"for loops",{"type":999,"value":7397}," and other techniques.",{"type":993,"tag":1002,"props":7399,"children":7400},{},[7401,7403,7407],{"type":999,"value":7402},"Ready to continue? Check out our lesson on ",{"type":993,"tag":7391,"props":7404,"children":7405},{"href":325},[7406],{"type":999,"value":326},{"type":999,"value":7408}," to master list iteration! 🔄",{"type":993,"tag":7410,"props":7411,"children":7412},"style",{},[7413],{"type":999,"value":7414},"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":7416},[7417,7420,7423,7426,7429,7432,7436,7439,7440,7441],{"id":1324,"depth":27,"text":1327,"children":7418},[7419],{"id":1442,"depth":36,"text":1445},{"id":1970,"depth":27,"text":1973,"children":7421},[7422],{"id":2090,"depth":36,"text":2093},{"id":2750,"depth":27,"text":2753,"children":7424},[7425],{"id":2882,"depth":36,"text":2885},{"id":3528,"depth":27,"text":3531,"children":7427},[7428],{"id":3658,"depth":36,"text":3661},{"id":4260,"depth":27,"text":4263,"children":7430},[7431],{"id":4271,"depth":36,"text":4274},{"id":4967,"depth":27,"text":4970,"children":7433},[7434,7435],{"id":4978,"depth":36,"text":4981},{"id":5821,"depth":36,"text":5824},{"id":6095,"depth":27,"text":6098,"children":7437},[7438],{"id":6106,"depth":36,"text":6109},{"id":6969,"depth":27,"text":6972},{"id":7358,"depth":27,"text":7361},{"id":7374,"depth":27,"text":7377},1782373736839]