[{"data":1,"prerenderedAt":5723},["ShallowReactive",2],{"tutorials-python":3,"category-items-python":987,"content-/python/deleting-dictionary-items":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,"expanded":13},"/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,"expanded":13},"/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,"expanded":13},"/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",[561],{"_path":562,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":563,"description":564,"slug":565,"parentId":516,"order":566,"body":989,"_type":15,"_id":567,"_source":17,"_file":568,"_stem":569,"_extension":20},{"type":990,"children":991,"toc":5702},"root",[992,1000,1006,1305,1312,1324,1525,1573,1579,1591,1598,1603,1900,1906,1911,2175,2181,2351,2357,2369,2703,2749,2755,2767,3058,3064,3069,3075,3080,3537,3543,3548,4090,4096,4101,4107,4112,4484,4490,4495,4876,4922,4927,5251,5257,5643,5656,5662,5667,5674,5680,5685,5696],{"type":993,"tag":994,"props":995,"children":996},"element","h1",{"id":565},[997],{"type":998,"value":999},"text","➖ Deleting Dictionary Items",{"type":993,"tag":1001,"props":1002,"children":1003},"p",{},[1004],{"type":998,"value":1005},"Removing items from dictionaries is just as important as adding them. Whether you're cleaning up temporary data, implementing user logout functionality, or managing memory usage, knowing how to delete dictionary items safely prevents errors and keeps your applications running smoothly.",{"type":993,"tag":1007,"props":1008,"children":1009},"code-try",{},[1010],{"type":993,"tag":1011,"props":1012,"children":1015},"pre",{"className":1013,"code":1014,"language":6,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Managing user sessions\nactive_sessions = {\n    'user123': 'session_abc',\n    'user456': 'session_def', \n    'user789': 'session_ghi'\n}\n\nprint(\"Active sessions:\", active_sessions)\n\n# Remove expired session\ndel active_sessions['user456']\nprint(\"After logout:\", active_sessions)\n\n# Safe removal with pop()\nremoved = active_sessions.pop('user789', 'Not found')\nprint(\"Removed session:\", removed)\nprint(\"Final sessions:\", active_sessions)\n",[1016],{"type":993,"tag":1017,"props":1018,"children":1019},"code",{"__ignoreMap":8},[1020,1031,1051,1075,1097,1114,1122,1130,1154,1161,1169,1192,1212,1219,1227,1264,1285],{"type":993,"tag":1021,"props":1022,"children":1024},"span",{"class":1023,"line":12},"line",[1025],{"type":993,"tag":1021,"props":1026,"children":1028},{"style":1027},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[1029],{"type":998,"value":1030},"# Managing user sessions\n",{"type":993,"tag":1021,"props":1032,"children":1033},{"class":1023,"line":27},[1034,1040,1046],{"type":993,"tag":1021,"props":1035,"children":1037},{"style":1036},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[1038],{"type":998,"value":1039},"active_sessions ",{"type":993,"tag":1021,"props":1041,"children":1043},{"style":1042},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[1044],{"type":998,"value":1045},"=",{"type":993,"tag":1021,"props":1047,"children":1048},{"style":1036},[1049],{"type":998,"value":1050}," {\n",{"type":993,"tag":1021,"props":1052,"children":1053},{"class":1023,"line":36},[1054,1060,1065,1070],{"type":993,"tag":1021,"props":1055,"children":1057},{"style":1056},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[1058],{"type":998,"value":1059},"    'user123'",{"type":993,"tag":1021,"props":1061,"children":1062},{"style":1036},[1063],{"type":998,"value":1064},": ",{"type":993,"tag":1021,"props":1066,"children":1067},{"style":1056},[1068],{"type":998,"value":1069},"'session_abc'",{"type":993,"tag":1021,"props":1071,"children":1072},{"style":1036},[1073],{"type":998,"value":1074},",\n",{"type":993,"tag":1021,"props":1076,"children":1077},{"class":1023,"line":45},[1078,1083,1087,1092],{"type":993,"tag":1021,"props":1079,"children":1080},{"style":1056},[1081],{"type":998,"value":1082},"    'user456'",{"type":993,"tag":1021,"props":1084,"children":1085},{"style":1036},[1086],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1088,"children":1089},{"style":1056},[1090],{"type":998,"value":1091},"'session_def'",{"type":993,"tag":1021,"props":1093,"children":1094},{"style":1036},[1095],{"type":998,"value":1096},", \n",{"type":993,"tag":1021,"props":1098,"children":1099},{"class":1023,"line":54},[1100,1105,1109],{"type":993,"tag":1021,"props":1101,"children":1102},{"style":1056},[1103],{"type":998,"value":1104},"    'user789'",{"type":993,"tag":1021,"props":1106,"children":1107},{"style":1036},[1108],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1110,"children":1111},{"style":1056},[1112],{"type":998,"value":1113},"'session_ghi'\n",{"type":993,"tag":1021,"props":1115,"children":1116},{"class":1023,"line":63},[1117],{"type":993,"tag":1021,"props":1118,"children":1119},{"style":1036},[1120],{"type":998,"value":1121},"}\n",{"type":993,"tag":1021,"props":1123,"children":1124},{"class":1023,"line":72},[1125],{"type":993,"tag":1021,"props":1126,"children":1127},{"emptyLinePlaceholder":13},[1128],{"type":998,"value":1129},"\n",{"type":993,"tag":1021,"props":1131,"children":1132},{"class":1023,"line":81},[1133,1139,1144,1149],{"type":993,"tag":1021,"props":1134,"children":1136},{"style":1135},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[1137],{"type":998,"value":1138},"print",{"type":993,"tag":1021,"props":1140,"children":1141},{"style":1036},[1142],{"type":998,"value":1143},"(",{"type":993,"tag":1021,"props":1145,"children":1146},{"style":1056},[1147],{"type":998,"value":1148},"\"Active sessions:\"",{"type":993,"tag":1021,"props":1150,"children":1151},{"style":1036},[1152],{"type":998,"value":1153},", active_sessions)\n",{"type":993,"tag":1021,"props":1155,"children":1156},{"class":1023,"line":91},[1157],{"type":993,"tag":1021,"props":1158,"children":1159},{"emptyLinePlaceholder":13},[1160],{"type":998,"value":1129},{"type":993,"tag":1021,"props":1162,"children":1163},{"class":1023,"line":100},[1164],{"type":993,"tag":1021,"props":1165,"children":1166},{"style":1027},[1167],{"type":998,"value":1168},"# Remove expired session\n",{"type":993,"tag":1021,"props":1170,"children":1171},{"class":1023,"line":109},[1172,1177,1182,1187],{"type":993,"tag":1021,"props":1173,"children":1174},{"style":1042},[1175],{"type":998,"value":1176},"del",{"type":993,"tag":1021,"props":1178,"children":1179},{"style":1036},[1180],{"type":998,"value":1181}," active_sessions[",{"type":993,"tag":1021,"props":1183,"children":1184},{"style":1056},[1185],{"type":998,"value":1186},"'user456'",{"type":993,"tag":1021,"props":1188,"children":1189},{"style":1036},[1190],{"type":998,"value":1191},"]\n",{"type":993,"tag":1021,"props":1193,"children":1194},{"class":1023,"line":118},[1195,1199,1203,1208],{"type":993,"tag":1021,"props":1196,"children":1197},{"style":1135},[1198],{"type":998,"value":1138},{"type":993,"tag":1021,"props":1200,"children":1201},{"style":1036},[1202],{"type":998,"value":1143},{"type":993,"tag":1021,"props":1204,"children":1205},{"style":1056},[1206],{"type":998,"value":1207},"\"After logout:\"",{"type":993,"tag":1021,"props":1209,"children":1210},{"style":1036},[1211],{"type":998,"value":1153},{"type":993,"tag":1021,"props":1213,"children":1214},{"class":1023,"line":127},[1215],{"type":993,"tag":1021,"props":1216,"children":1217},{"emptyLinePlaceholder":13},[1218],{"type":998,"value":1129},{"type":993,"tag":1021,"props":1220,"children":1221},{"class":1023,"line":136},[1222],{"type":993,"tag":1021,"props":1223,"children":1224},{"style":1027},[1225],{"type":998,"value":1226},"# Safe removal with pop()\n",{"type":993,"tag":1021,"props":1228,"children":1229},{"class":1023,"line":146},[1230,1235,1239,1244,1249,1254,1259],{"type":993,"tag":1021,"props":1231,"children":1232},{"style":1036},[1233],{"type":998,"value":1234},"removed ",{"type":993,"tag":1021,"props":1236,"children":1237},{"style":1042},[1238],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1240,"children":1241},{"style":1036},[1242],{"type":998,"value":1243}," active_sessions.pop(",{"type":993,"tag":1021,"props":1245,"children":1246},{"style":1056},[1247],{"type":998,"value":1248},"'user789'",{"type":993,"tag":1021,"props":1250,"children":1251},{"style":1036},[1252],{"type":998,"value":1253},", ",{"type":993,"tag":1021,"props":1255,"children":1256},{"style":1056},[1257],{"type":998,"value":1258},"'Not found'",{"type":993,"tag":1021,"props":1260,"children":1261},{"style":1036},[1262],{"type":998,"value":1263},")\n",{"type":993,"tag":1021,"props":1265,"children":1266},{"class":1023,"line":155},[1267,1271,1275,1280],{"type":993,"tag":1021,"props":1268,"children":1269},{"style":1135},[1270],{"type":998,"value":1138},{"type":993,"tag":1021,"props":1272,"children":1273},{"style":1036},[1274],{"type":998,"value":1143},{"type":993,"tag":1021,"props":1276,"children":1277},{"style":1056},[1278],{"type":998,"value":1279},"\"Removed session:\"",{"type":993,"tag":1021,"props":1281,"children":1282},{"style":1036},[1283],{"type":998,"value":1284},", removed)\n",{"type":993,"tag":1021,"props":1286,"children":1287},{"class":1023,"line":164},[1288,1292,1296,1301],{"type":993,"tag":1021,"props":1289,"children":1290},{"style":1135},[1291],{"type":998,"value":1138},{"type":993,"tag":1021,"props":1293,"children":1294},{"style":1036},[1295],{"type":998,"value":1143},{"type":993,"tag":1021,"props":1297,"children":1298},{"style":1056},[1299],{"type":998,"value":1300},"\"Final sessions:\"",{"type":993,"tag":1021,"props":1302,"children":1303},{"style":1036},[1304],{"type":998,"value":1153},{"type":993,"tag":1306,"props":1307,"children":1309},"h2",{"id":1308},"the-del-statement",[1310],{"type":998,"value":1311},"🎯 The del Statement",{"type":993,"tag":1001,"props":1313,"children":1314},{},[1315,1317,1322],{"type":998,"value":1316},"The ",{"type":993,"tag":1017,"props":1318,"children":1320},{"className":1319},[],[1321],{"type":998,"value":1176},{"type":998,"value":1323}," statement provides direct deletion of dictionary items using familiar square bracket syntax. When you know a key exists, this approach offers the most straightforward way to remove data.",{"type":993,"tag":1007,"props":1325,"children":1326},{},[1327],{"type":993,"tag":1011,"props":1328,"children":1330},{"className":1013,"code":1329,"language":6,"meta":8,"style":8},"inventory = {'apples': 50, 'bananas': 30, 'oranges': 25, 'grapes': 15}\nprint(\"Full inventory:\", inventory)\n\n# Remove items that are out of stock\ndel inventory['grapes']\ndel inventory['oranges']\n\nprint(\"Updated inventory:\", inventory)\n",[1331],{"type":993,"tag":1017,"props":1332,"children":1333},{"__ignoreMap":8},[1334,1423,1444,1451,1459,1479,1498,1505],{"type":993,"tag":1021,"props":1335,"children":1336},{"class":1023,"line":12},[1337,1342,1346,1351,1356,1360,1365,1369,1374,1378,1383,1387,1392,1396,1401,1405,1410,1414,1419],{"type":993,"tag":1021,"props":1338,"children":1339},{"style":1036},[1340],{"type":998,"value":1341},"inventory ",{"type":993,"tag":1021,"props":1343,"children":1344},{"style":1042},[1345],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1347,"children":1348},{"style":1036},[1349],{"type":998,"value":1350}," {",{"type":993,"tag":1021,"props":1352,"children":1353},{"style":1056},[1354],{"type":998,"value":1355},"'apples'",{"type":993,"tag":1021,"props":1357,"children":1358},{"style":1036},[1359],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1361,"children":1362},{"style":1135},[1363],{"type":998,"value":1364},"50",{"type":993,"tag":1021,"props":1366,"children":1367},{"style":1036},[1368],{"type":998,"value":1253},{"type":993,"tag":1021,"props":1370,"children":1371},{"style":1056},[1372],{"type":998,"value":1373},"'bananas'",{"type":993,"tag":1021,"props":1375,"children":1376},{"style":1036},[1377],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1379,"children":1380},{"style":1135},[1381],{"type":998,"value":1382},"30",{"type":993,"tag":1021,"props":1384,"children":1385},{"style":1036},[1386],{"type":998,"value":1253},{"type":993,"tag":1021,"props":1388,"children":1389},{"style":1056},[1390],{"type":998,"value":1391},"'oranges'",{"type":993,"tag":1021,"props":1393,"children":1394},{"style":1036},[1395],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1397,"children":1398},{"style":1135},[1399],{"type":998,"value":1400},"25",{"type":993,"tag":1021,"props":1402,"children":1403},{"style":1036},[1404],{"type":998,"value":1253},{"type":993,"tag":1021,"props":1406,"children":1407},{"style":1056},[1408],{"type":998,"value":1409},"'grapes'",{"type":993,"tag":1021,"props":1411,"children":1412},{"style":1036},[1413],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1415,"children":1416},{"style":1135},[1417],{"type":998,"value":1418},"15",{"type":993,"tag":1021,"props":1420,"children":1421},{"style":1036},[1422],{"type":998,"value":1121},{"type":993,"tag":1021,"props":1424,"children":1425},{"class":1023,"line":27},[1426,1430,1434,1439],{"type":993,"tag":1021,"props":1427,"children":1428},{"style":1135},[1429],{"type":998,"value":1138},{"type":993,"tag":1021,"props":1431,"children":1432},{"style":1036},[1433],{"type":998,"value":1143},{"type":993,"tag":1021,"props":1435,"children":1436},{"style":1056},[1437],{"type":998,"value":1438},"\"Full inventory:\"",{"type":993,"tag":1021,"props":1440,"children":1441},{"style":1036},[1442],{"type":998,"value":1443},", inventory)\n",{"type":993,"tag":1021,"props":1445,"children":1446},{"class":1023,"line":36},[1447],{"type":993,"tag":1021,"props":1448,"children":1449},{"emptyLinePlaceholder":13},[1450],{"type":998,"value":1129},{"type":993,"tag":1021,"props":1452,"children":1453},{"class":1023,"line":45},[1454],{"type":993,"tag":1021,"props":1455,"children":1456},{"style":1027},[1457],{"type":998,"value":1458},"# Remove items that are out of stock\n",{"type":993,"tag":1021,"props":1460,"children":1461},{"class":1023,"line":54},[1462,1466,1471,1475],{"type":993,"tag":1021,"props":1463,"children":1464},{"style":1042},[1465],{"type":998,"value":1176},{"type":993,"tag":1021,"props":1467,"children":1468},{"style":1036},[1469],{"type":998,"value":1470}," inventory[",{"type":993,"tag":1021,"props":1472,"children":1473},{"style":1056},[1474],{"type":998,"value":1409},{"type":993,"tag":1021,"props":1476,"children":1477},{"style":1036},[1478],{"type":998,"value":1191},{"type":993,"tag":1021,"props":1480,"children":1481},{"class":1023,"line":63},[1482,1486,1490,1494],{"type":993,"tag":1021,"props":1483,"children":1484},{"style":1042},[1485],{"type":998,"value":1176},{"type":993,"tag":1021,"props":1487,"children":1488},{"style":1036},[1489],{"type":998,"value":1470},{"type":993,"tag":1021,"props":1491,"children":1492},{"style":1056},[1493],{"type":998,"value":1391},{"type":993,"tag":1021,"props":1495,"children":1496},{"style":1036},[1497],{"type":998,"value":1191},{"type":993,"tag":1021,"props":1499,"children":1500},{"class":1023,"line":72},[1501],{"type":993,"tag":1021,"props":1502,"children":1503},{"emptyLinePlaceholder":13},[1504],{"type":998,"value":1129},{"type":993,"tag":1021,"props":1506,"children":1507},{"class":1023,"line":81},[1508,1512,1516,1521],{"type":993,"tag":1021,"props":1509,"children":1510},{"style":1135},[1511],{"type":998,"value":1138},{"type":993,"tag":1021,"props":1513,"children":1514},{"style":1036},[1515],{"type":998,"value":1143},{"type":993,"tag":1021,"props":1517,"children":1518},{"style":1056},[1519],{"type":998,"value":1520},"\"Updated inventory:\"",{"type":993,"tag":1021,"props":1522,"children":1523},{"style":1036},[1524],{"type":998,"value":1443},{"type":993,"tag":1526,"props":1527,"children":1531},"info-box",{"emoji":1528,"title":1529,"type":1530},"⚠️","del Statement Behavior","warning",[1532,1543,1553,1563],{"type":993,"tag":1001,"props":1533,"children":1534},{},[1535,1541],{"type":993,"tag":1536,"props":1537,"children":1538},"strong",{},[1539],{"type":998,"value":1540},"KeyError Risk:",{"type":998,"value":1542}," Raises KeyError if the specified key doesn't exist in the dictionary.",{"type":993,"tag":1001,"props":1544,"children":1545},{},[1546,1551],{"type":993,"tag":1536,"props":1547,"children":1548},{},[1549],{"type":998,"value":1550},"No Return Value:",{"type":998,"value":1552}," del doesn't return the deleted value; it simply removes the key-value pair.",{"type":993,"tag":1001,"props":1554,"children":1555},{},[1556,1561],{"type":993,"tag":1536,"props":1557,"children":1558},{},[1559],{"type":998,"value":1560},"Immediate Deletion:",{"type":998,"value":1562}," The item is removed immediately with no way to recover it.",{"type":993,"tag":1001,"props":1564,"children":1565},{},[1566,1571],{"type":993,"tag":1536,"props":1567,"children":1568},{},[1569],{"type":998,"value":1570},"Best Practice:",{"type":998,"value":1572}," Use only when you're certain the key exists or within try-catch blocks.",{"type":993,"tag":1306,"props":1574,"children":1576},{"id":1575},"safe-removal-with-pop",[1577],{"type":998,"value":1578},"⚡ Safe Removal with pop()",{"type":993,"tag":1001,"props":1580,"children":1581},{},[1582,1583,1589],{"type":998,"value":1316},{"type":993,"tag":1017,"props":1584,"children":1586},{"className":1585},[],[1587],{"type":998,"value":1588},"pop()",{"type":998,"value":1590}," method offers controlled deletion that returns the removed value and handles missing keys gracefully. This approach combines removal with value retrieval in a single operation.",{"type":993,"tag":1592,"props":1593,"children":1595},"h3",{"id":1594},"basic-pop-usage",[1596],{"type":998,"value":1597},"Basic pop() Usage",{"type":993,"tag":1001,"props":1599,"children":1600},{},[1601],{"type":998,"value":1602},"Retrieving values during deletion enables logging, validation, or other processing before the data disappears.",{"type":993,"tag":1007,"props":1604,"children":1605},{},[1606],{"type":993,"tag":1011,"props":1607,"children":1609},{"className":1013,"code":1608,"language":6,"meta":8,"style":8},"user_settings = {\n    'theme': 'dark',\n    'notifications': True,\n    'auto_save': False,\n    'language': 'English'\n}\n\nprint(\"Original settings:\", user_settings)\n\n# Remove and get the value\ntheme = user_settings.pop('theme')\nlanguage = user_settings.pop('language')\n\nprint(f\"Removed theme: {theme}, language: {language}\")\nprint(\"Remaining settings:\", user_settings)\n",[1610],{"type":993,"tag":1017,"props":1611,"children":1612},{"__ignoreMap":8},[1613,1629,1650,1671,1692,1709,1716,1723,1744,1751,1759,1785,1810,1817,1880],{"type":993,"tag":1021,"props":1614,"children":1615},{"class":1023,"line":12},[1616,1621,1625],{"type":993,"tag":1021,"props":1617,"children":1618},{"style":1036},[1619],{"type":998,"value":1620},"user_settings ",{"type":993,"tag":1021,"props":1622,"children":1623},{"style":1042},[1624],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1626,"children":1627},{"style":1036},[1628],{"type":998,"value":1050},{"type":993,"tag":1021,"props":1630,"children":1631},{"class":1023,"line":27},[1632,1637,1641,1646],{"type":993,"tag":1021,"props":1633,"children":1634},{"style":1056},[1635],{"type":998,"value":1636},"    'theme'",{"type":993,"tag":1021,"props":1638,"children":1639},{"style":1036},[1640],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1642,"children":1643},{"style":1056},[1644],{"type":998,"value":1645},"'dark'",{"type":993,"tag":1021,"props":1647,"children":1648},{"style":1036},[1649],{"type":998,"value":1074},{"type":993,"tag":1021,"props":1651,"children":1652},{"class":1023,"line":36},[1653,1658,1662,1667],{"type":993,"tag":1021,"props":1654,"children":1655},{"style":1056},[1656],{"type":998,"value":1657},"    'notifications'",{"type":993,"tag":1021,"props":1659,"children":1660},{"style":1036},[1661],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1663,"children":1664},{"style":1135},[1665],{"type":998,"value":1666},"True",{"type":993,"tag":1021,"props":1668,"children":1669},{"style":1036},[1670],{"type":998,"value":1074},{"type":993,"tag":1021,"props":1672,"children":1673},{"class":1023,"line":45},[1674,1679,1683,1688],{"type":993,"tag":1021,"props":1675,"children":1676},{"style":1056},[1677],{"type":998,"value":1678},"    'auto_save'",{"type":993,"tag":1021,"props":1680,"children":1681},{"style":1036},[1682],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1684,"children":1685},{"style":1135},[1686],{"type":998,"value":1687},"False",{"type":993,"tag":1021,"props":1689,"children":1690},{"style":1036},[1691],{"type":998,"value":1074},{"type":993,"tag":1021,"props":1693,"children":1694},{"class":1023,"line":54},[1695,1700,1704],{"type":993,"tag":1021,"props":1696,"children":1697},{"style":1056},[1698],{"type":998,"value":1699},"    'language'",{"type":993,"tag":1021,"props":1701,"children":1702},{"style":1036},[1703],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1705,"children":1706},{"style":1056},[1707],{"type":998,"value":1708},"'English'\n",{"type":993,"tag":1021,"props":1710,"children":1711},{"class":1023,"line":63},[1712],{"type":993,"tag":1021,"props":1713,"children":1714},{"style":1036},[1715],{"type":998,"value":1121},{"type":993,"tag":1021,"props":1717,"children":1718},{"class":1023,"line":72},[1719],{"type":993,"tag":1021,"props":1720,"children":1721},{"emptyLinePlaceholder":13},[1722],{"type":998,"value":1129},{"type":993,"tag":1021,"props":1724,"children":1725},{"class":1023,"line":81},[1726,1730,1734,1739],{"type":993,"tag":1021,"props":1727,"children":1728},{"style":1135},[1729],{"type":998,"value":1138},{"type":993,"tag":1021,"props":1731,"children":1732},{"style":1036},[1733],{"type":998,"value":1143},{"type":993,"tag":1021,"props":1735,"children":1736},{"style":1056},[1737],{"type":998,"value":1738},"\"Original settings:\"",{"type":993,"tag":1021,"props":1740,"children":1741},{"style":1036},[1742],{"type":998,"value":1743},", user_settings)\n",{"type":993,"tag":1021,"props":1745,"children":1746},{"class":1023,"line":91},[1747],{"type":993,"tag":1021,"props":1748,"children":1749},{"emptyLinePlaceholder":13},[1750],{"type":998,"value":1129},{"type":993,"tag":1021,"props":1752,"children":1753},{"class":1023,"line":100},[1754],{"type":993,"tag":1021,"props":1755,"children":1756},{"style":1027},[1757],{"type":998,"value":1758},"# Remove and get the value\n",{"type":993,"tag":1021,"props":1760,"children":1761},{"class":1023,"line":109},[1762,1767,1771,1776,1781],{"type":993,"tag":1021,"props":1763,"children":1764},{"style":1036},[1765],{"type":998,"value":1766},"theme ",{"type":993,"tag":1021,"props":1768,"children":1769},{"style":1042},[1770],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1772,"children":1773},{"style":1036},[1774],{"type":998,"value":1775}," user_settings.pop(",{"type":993,"tag":1021,"props":1777,"children":1778},{"style":1056},[1779],{"type":998,"value":1780},"'theme'",{"type":993,"tag":1021,"props":1782,"children":1783},{"style":1036},[1784],{"type":998,"value":1263},{"type":993,"tag":1021,"props":1786,"children":1787},{"class":1023,"line":118},[1788,1793,1797,1801,1806],{"type":993,"tag":1021,"props":1789,"children":1790},{"style":1036},[1791],{"type":998,"value":1792},"language ",{"type":993,"tag":1021,"props":1794,"children":1795},{"style":1042},[1796],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1798,"children":1799},{"style":1036},[1800],{"type":998,"value":1775},{"type":993,"tag":1021,"props":1802,"children":1803},{"style":1056},[1804],{"type":998,"value":1805},"'language'",{"type":993,"tag":1021,"props":1807,"children":1808},{"style":1036},[1809],{"type":998,"value":1263},{"type":993,"tag":1021,"props":1811,"children":1812},{"class":1023,"line":127},[1813],{"type":993,"tag":1021,"props":1814,"children":1815},{"emptyLinePlaceholder":13},[1816],{"type":998,"value":1129},{"type":993,"tag":1021,"props":1818,"children":1819},{"class":1023,"line":136},[1820,1824,1828,1833,1838,1843,1848,1853,1858,1862,1867,1871,1876],{"type":993,"tag":1021,"props":1821,"children":1822},{"style":1135},[1823],{"type":998,"value":1138},{"type":993,"tag":1021,"props":1825,"children":1826},{"style":1036},[1827],{"type":998,"value":1143},{"type":993,"tag":1021,"props":1829,"children":1830},{"style":1042},[1831],{"type":998,"value":1832},"f",{"type":993,"tag":1021,"props":1834,"children":1835},{"style":1056},[1836],{"type":998,"value":1837},"\"Removed theme: ",{"type":993,"tag":1021,"props":1839,"children":1840},{"style":1135},[1841],{"type":998,"value":1842},"{",{"type":993,"tag":1021,"props":1844,"children":1845},{"style":1036},[1846],{"type":998,"value":1847},"theme",{"type":993,"tag":1021,"props":1849,"children":1850},{"style":1135},[1851],{"type":998,"value":1852},"}",{"type":993,"tag":1021,"props":1854,"children":1855},{"style":1056},[1856],{"type":998,"value":1857},", language: ",{"type":993,"tag":1021,"props":1859,"children":1860},{"style":1135},[1861],{"type":998,"value":1842},{"type":993,"tag":1021,"props":1863,"children":1864},{"style":1036},[1865],{"type":998,"value":1866},"language",{"type":993,"tag":1021,"props":1868,"children":1869},{"style":1135},[1870],{"type":998,"value":1852},{"type":993,"tag":1021,"props":1872,"children":1873},{"style":1056},[1874],{"type":998,"value":1875},"\"",{"type":993,"tag":1021,"props":1877,"children":1878},{"style":1036},[1879],{"type":998,"value":1263},{"type":993,"tag":1021,"props":1881,"children":1882},{"class":1023,"line":146},[1883,1887,1891,1896],{"type":993,"tag":1021,"props":1884,"children":1885},{"style":1135},[1886],{"type":998,"value":1138},{"type":993,"tag":1021,"props":1888,"children":1889},{"style":1036},[1890],{"type":998,"value":1143},{"type":993,"tag":1021,"props":1892,"children":1893},{"style":1056},[1894],{"type":998,"value":1895},"\"Remaining settings:\"",{"type":993,"tag":1021,"props":1897,"children":1898},{"style":1036},[1899],{"type":998,"value":1743},{"type":993,"tag":1592,"props":1901,"children":1903},{"id":1902},"pop-with-default-values",[1904],{"type":998,"value":1905},"pop() with Default Values",{"type":993,"tag":1001,"props":1907,"children":1908},{},[1909],{"type":998,"value":1910},"Providing default values prevents KeyError exceptions when attempting to remove non-existent keys.",{"type":993,"tag":1007,"props":1912,"children":1913},{},[1914],{"type":993,"tag":1011,"props":1915,"children":1917},{"className":1013,"code":1916,"language":6,"meta":8,"style":8},"cache_data = {'page1': 'content1', 'page2': 'content2'}\n\n# Safe removal with defaults\nremoved_page = cache_data.pop('page3', 'Page not cached')\nremoved_user = cache_data.pop('user_data', 'No user data')\n\nprint(\"Removal results:\", removed_page, removed_user)\nprint(\"Cache after cleanup:\", cache_data)\n\n# Remove existing item\nactual_content = cache_data.pop('page1', 'Default content')\nprint(\"Retrieved content:\", actual_content)\n",[1918],{"type":993,"tag":1017,"props":1919,"children":1920},{"__ignoreMap":8},[1921,1973,1980,1988,2023,2057,2064,2085,2106,2113,2121,2154],{"type":993,"tag":1021,"props":1922,"children":1923},{"class":1023,"line":12},[1924,1929,1933,1937,1942,1946,1951,1955,1960,1964,1969],{"type":993,"tag":1021,"props":1925,"children":1926},{"style":1036},[1927],{"type":998,"value":1928},"cache_data ",{"type":993,"tag":1021,"props":1930,"children":1931},{"style":1042},[1932],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1934,"children":1935},{"style":1036},[1936],{"type":998,"value":1350},{"type":993,"tag":1021,"props":1938,"children":1939},{"style":1056},[1940],{"type":998,"value":1941},"'page1'",{"type":993,"tag":1021,"props":1943,"children":1944},{"style":1036},[1945],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1947,"children":1948},{"style":1056},[1949],{"type":998,"value":1950},"'content1'",{"type":993,"tag":1021,"props":1952,"children":1953},{"style":1036},[1954],{"type":998,"value":1253},{"type":993,"tag":1021,"props":1956,"children":1957},{"style":1056},[1958],{"type":998,"value":1959},"'page2'",{"type":993,"tag":1021,"props":1961,"children":1962},{"style":1036},[1963],{"type":998,"value":1064},{"type":993,"tag":1021,"props":1965,"children":1966},{"style":1056},[1967],{"type":998,"value":1968},"'content2'",{"type":993,"tag":1021,"props":1970,"children":1971},{"style":1036},[1972],{"type":998,"value":1121},{"type":993,"tag":1021,"props":1974,"children":1975},{"class":1023,"line":27},[1976],{"type":993,"tag":1021,"props":1977,"children":1978},{"emptyLinePlaceholder":13},[1979],{"type":998,"value":1129},{"type":993,"tag":1021,"props":1981,"children":1982},{"class":1023,"line":36},[1983],{"type":993,"tag":1021,"props":1984,"children":1985},{"style":1027},[1986],{"type":998,"value":1987},"# Safe removal with defaults\n",{"type":993,"tag":1021,"props":1989,"children":1990},{"class":1023,"line":45},[1991,1996,2000,2005,2010,2014,2019],{"type":993,"tag":1021,"props":1992,"children":1993},{"style":1036},[1994],{"type":998,"value":1995},"removed_page ",{"type":993,"tag":1021,"props":1997,"children":1998},{"style":1042},[1999],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2001,"children":2002},{"style":1036},[2003],{"type":998,"value":2004}," cache_data.pop(",{"type":993,"tag":1021,"props":2006,"children":2007},{"style":1056},[2008],{"type":998,"value":2009},"'page3'",{"type":993,"tag":1021,"props":2011,"children":2012},{"style":1036},[2013],{"type":998,"value":1253},{"type":993,"tag":1021,"props":2015,"children":2016},{"style":1056},[2017],{"type":998,"value":2018},"'Page not cached'",{"type":993,"tag":1021,"props":2020,"children":2021},{"style":1036},[2022],{"type":998,"value":1263},{"type":993,"tag":1021,"props":2024,"children":2025},{"class":1023,"line":54},[2026,2031,2035,2039,2044,2048,2053],{"type":993,"tag":1021,"props":2027,"children":2028},{"style":1036},[2029],{"type":998,"value":2030},"removed_user ",{"type":993,"tag":1021,"props":2032,"children":2033},{"style":1042},[2034],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2036,"children":2037},{"style":1036},[2038],{"type":998,"value":2004},{"type":993,"tag":1021,"props":2040,"children":2041},{"style":1056},[2042],{"type":998,"value":2043},"'user_data'",{"type":993,"tag":1021,"props":2045,"children":2046},{"style":1036},[2047],{"type":998,"value":1253},{"type":993,"tag":1021,"props":2049,"children":2050},{"style":1056},[2051],{"type":998,"value":2052},"'No user data'",{"type":993,"tag":1021,"props":2054,"children":2055},{"style":1036},[2056],{"type":998,"value":1263},{"type":993,"tag":1021,"props":2058,"children":2059},{"class":1023,"line":63},[2060],{"type":993,"tag":1021,"props":2061,"children":2062},{"emptyLinePlaceholder":13},[2063],{"type":998,"value":1129},{"type":993,"tag":1021,"props":2065,"children":2066},{"class":1023,"line":72},[2067,2071,2075,2080],{"type":993,"tag":1021,"props":2068,"children":2069},{"style":1135},[2070],{"type":998,"value":1138},{"type":993,"tag":1021,"props":2072,"children":2073},{"style":1036},[2074],{"type":998,"value":1143},{"type":993,"tag":1021,"props":2076,"children":2077},{"style":1056},[2078],{"type":998,"value":2079},"\"Removal results:\"",{"type":993,"tag":1021,"props":2081,"children":2082},{"style":1036},[2083],{"type":998,"value":2084},", removed_page, removed_user)\n",{"type":993,"tag":1021,"props":2086,"children":2087},{"class":1023,"line":81},[2088,2092,2096,2101],{"type":993,"tag":1021,"props":2089,"children":2090},{"style":1135},[2091],{"type":998,"value":1138},{"type":993,"tag":1021,"props":2093,"children":2094},{"style":1036},[2095],{"type":998,"value":1143},{"type":993,"tag":1021,"props":2097,"children":2098},{"style":1056},[2099],{"type":998,"value":2100},"\"Cache after cleanup:\"",{"type":993,"tag":1021,"props":2102,"children":2103},{"style":1036},[2104],{"type":998,"value":2105},", cache_data)\n",{"type":993,"tag":1021,"props":2107,"children":2108},{"class":1023,"line":91},[2109],{"type":993,"tag":1021,"props":2110,"children":2111},{"emptyLinePlaceholder":13},[2112],{"type":998,"value":1129},{"type":993,"tag":1021,"props":2114,"children":2115},{"class":1023,"line":100},[2116],{"type":993,"tag":1021,"props":2117,"children":2118},{"style":1027},[2119],{"type":998,"value":2120},"# Remove existing item\n",{"type":993,"tag":1021,"props":2122,"children":2123},{"class":1023,"line":109},[2124,2129,2133,2137,2141,2145,2150],{"type":993,"tag":1021,"props":2125,"children":2126},{"style":1036},[2127],{"type":998,"value":2128},"actual_content ",{"type":993,"tag":1021,"props":2130,"children":2131},{"style":1042},[2132],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2134,"children":2135},{"style":1036},[2136],{"type":998,"value":2004},{"type":993,"tag":1021,"props":2138,"children":2139},{"style":1056},[2140],{"type":998,"value":1941},{"type":993,"tag":1021,"props":2142,"children":2143},{"style":1036},[2144],{"type":998,"value":1253},{"type":993,"tag":1021,"props":2146,"children":2147},{"style":1056},[2148],{"type":998,"value":2149},"'Default content'",{"type":993,"tag":1021,"props":2151,"children":2152},{"style":1036},[2153],{"type":998,"value":1263},{"type":993,"tag":1021,"props":2155,"children":2156},{"class":1023,"line":118},[2157,2161,2165,2170],{"type":993,"tag":1021,"props":2158,"children":2159},{"style":1135},[2160],{"type":998,"value":1138},{"type":993,"tag":1021,"props":2162,"children":2163},{"style":1036},[2164],{"type":998,"value":1143},{"type":993,"tag":1021,"props":2166,"children":2167},{"style":1056},[2168],{"type":998,"value":2169},"\"Retrieved content:\"",{"type":993,"tag":1021,"props":2171,"children":2172},{"style":1036},[2173],{"type":998,"value":2174},", actual_content)\n",{"type":993,"tag":1306,"props":2176,"children":2178},{"id":2177},"dictionary-deletion-methods-comparison",[2179],{"type":998,"value":2180},"📚 Dictionary Deletion Methods Comparison",{"type":993,"tag":2182,"props":2183,"children":2184},"table",{},[2185,2214],{"type":993,"tag":2186,"props":2187,"children":2188},"thead",{},[2189],{"type":993,"tag":2190,"props":2191,"children":2192},"tr",{},[2193,2199,2204,2209],{"type":993,"tag":2194,"props":2195,"children":2196},"th",{},[2197],{"type":998,"value":2198},"Method",{"type":993,"tag":2194,"props":2200,"children":2201},{},[2202],{"type":998,"value":2203},"Missing Key Behavior",{"type":993,"tag":2194,"props":2205,"children":2206},{},[2207],{"type":998,"value":2208},"Returns Value",{"type":993,"tag":2194,"props":2210,"children":2211},{},[2212],{"type":998,"value":2213},"Use Case",{"type":993,"tag":2215,"props":2216,"children":2217},"tbody",{},[2218,2246,2272,2298,2325],{"type":993,"tag":2190,"props":2219,"children":2220},{},[2221,2231,2236,2241],{"type":993,"tag":2222,"props":2223,"children":2224},"td",{},[2225],{"type":993,"tag":1017,"props":2226,"children":2228},{"className":2227},[],[2229],{"type":998,"value":2230},"del dict[key]",{"type":993,"tag":2222,"props":2232,"children":2233},{},[2234],{"type":998,"value":2235},"Raises KeyError",{"type":993,"tag":2222,"props":2237,"children":2238},{},[2239],{"type":998,"value":2240},"No",{"type":993,"tag":2222,"props":2242,"children":2243},{},[2244],{"type":998,"value":2245},"Known existing keys",{"type":993,"tag":2190,"props":2247,"children":2248},{},[2249,2258,2262,2267],{"type":993,"tag":2222,"props":2250,"children":2251},{},[2252],{"type":993,"tag":1017,"props":2253,"children":2255},{"className":2254},[],[2256],{"type":998,"value":2257},"dict.pop(key)",{"type":993,"tag":2222,"props":2259,"children":2260},{},[2261],{"type":998,"value":2235},{"type":993,"tag":2222,"props":2263,"children":2264},{},[2265],{"type":998,"value":2266},"Yes",{"type":993,"tag":2222,"props":2268,"children":2269},{},[2270],{"type":998,"value":2271},"Retrieve while removing",{"type":993,"tag":2190,"props":2273,"children":2274},{},[2275,2284,2289,2293],{"type":993,"tag":2222,"props":2276,"children":2277},{},[2278],{"type":993,"tag":1017,"props":2279,"children":2281},{"className":2280},[],[2282],{"type":998,"value":2283},"dict.pop(key, default)",{"type":993,"tag":2222,"props":2285,"children":2286},{},[2287],{"type":998,"value":2288},"Returns default",{"type":993,"tag":2222,"props":2290,"children":2291},{},[2292],{"type":998,"value":2266},{"type":993,"tag":2222,"props":2294,"children":2295},{},[2296],{"type":998,"value":2297},"Safe removal with fallback",{"type":993,"tag":2190,"props":2299,"children":2300},{},[2301,2310,2315,2320],{"type":993,"tag":2222,"props":2302,"children":2303},{},[2304],{"type":993,"tag":1017,"props":2305,"children":2307},{"className":2306},[],[2308],{"type":998,"value":2309},"dict.popitem()",{"type":993,"tag":2222,"props":2311,"children":2312},{},[2313],{"type":998,"value":2314},"Raises KeyError if empty",{"type":993,"tag":2222,"props":2316,"children":2317},{},[2318],{"type":998,"value":2319},"Yes (key, value)",{"type":993,"tag":2222,"props":2321,"children":2322},{},[2323],{"type":998,"value":2324},"Remove arbitrary item",{"type":993,"tag":2190,"props":2326,"children":2327},{},[2328,2337,2342,2346],{"type":993,"tag":2222,"props":2329,"children":2330},{},[2331],{"type":993,"tag":1017,"props":2332,"children":2334},{"className":2333},[],[2335],{"type":998,"value":2336},"dict.clear()",{"type":993,"tag":2222,"props":2338,"children":2339},{},[2340],{"type":998,"value":2341},"No error",{"type":993,"tag":2222,"props":2343,"children":2344},{},[2345],{"type":998,"value":2240},{"type":993,"tag":2222,"props":2347,"children":2348},{},[2349],{"type":998,"value":2350},"Remove all items",{"type":993,"tag":1306,"props":2352,"children":2354},{"id":2353},"removing-random-items-with-popitem",[2355],{"type":998,"value":2356},"🚀 Removing Random Items with popitem()",{"type":993,"tag":1001,"props":2358,"children":2359},{},[2360,2361,2367],{"type":998,"value":1316},{"type":993,"tag":1017,"props":2362,"children":2364},{"className":2363},[],[2365],{"type":998,"value":2366},"popitem()",{"type":998,"value":2368}," method removes and returns an arbitrary key-value pair from the dictionary. In Python 3.7+, it removes the last inserted item, making it useful for stack-like operations.",{"type":993,"tag":1007,"props":2370,"children":2371},{},[2372],{"type":993,"tag":1011,"props":2373,"children":2375},{"className":1013,"code":2374,"language":6,"meta":8,"style":8},"task_queue = {\n    'task1': 'process_data',\n    'task2': 'send_email', \n    'task3': 'update_database',\n    'task4': 'generate_report'\n}\n\nprint(\"Task queue:\", task_queue)\n\n# Process tasks in LIFO order (last in, first out)\nwhile task_queue:\n    task_id, task_action = task_queue.popitem()\n    print(f\"Processing {task_id}: {task_action}\")\n    \n    # Simulate task completion\n    if len(task_queue) == 2:  # Stop early for demo\n        break\n\nprint(\"Remaining tasks:\", task_queue)\n",[2376],{"type":993,"tag":1017,"props":2377,"children":2378},{"__ignoreMap":8},[2379,2395,2416,2437,2458,2475,2482,2489,2510,2517,2525,2538,2555,2614,2622,2630,2668,2676,2683],{"type":993,"tag":1021,"props":2380,"children":2381},{"class":1023,"line":12},[2382,2387,2391],{"type":993,"tag":1021,"props":2383,"children":2384},{"style":1036},[2385],{"type":998,"value":2386},"task_queue ",{"type":993,"tag":1021,"props":2388,"children":2389},{"style":1042},[2390],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2392,"children":2393},{"style":1036},[2394],{"type":998,"value":1050},{"type":993,"tag":1021,"props":2396,"children":2397},{"class":1023,"line":27},[2398,2403,2407,2412],{"type":993,"tag":1021,"props":2399,"children":2400},{"style":1056},[2401],{"type":998,"value":2402},"    'task1'",{"type":993,"tag":1021,"props":2404,"children":2405},{"style":1036},[2406],{"type":998,"value":1064},{"type":993,"tag":1021,"props":2408,"children":2409},{"style":1056},[2410],{"type":998,"value":2411},"'process_data'",{"type":993,"tag":1021,"props":2413,"children":2414},{"style":1036},[2415],{"type":998,"value":1074},{"type":993,"tag":1021,"props":2417,"children":2418},{"class":1023,"line":36},[2419,2424,2428,2433],{"type":993,"tag":1021,"props":2420,"children":2421},{"style":1056},[2422],{"type":998,"value":2423},"    'task2'",{"type":993,"tag":1021,"props":2425,"children":2426},{"style":1036},[2427],{"type":998,"value":1064},{"type":993,"tag":1021,"props":2429,"children":2430},{"style":1056},[2431],{"type":998,"value":2432},"'send_email'",{"type":993,"tag":1021,"props":2434,"children":2435},{"style":1036},[2436],{"type":998,"value":1096},{"type":993,"tag":1021,"props":2438,"children":2439},{"class":1023,"line":45},[2440,2445,2449,2454],{"type":993,"tag":1021,"props":2441,"children":2442},{"style":1056},[2443],{"type":998,"value":2444},"    'task3'",{"type":993,"tag":1021,"props":2446,"children":2447},{"style":1036},[2448],{"type":998,"value":1064},{"type":993,"tag":1021,"props":2450,"children":2451},{"style":1056},[2452],{"type":998,"value":2453},"'update_database'",{"type":993,"tag":1021,"props":2455,"children":2456},{"style":1036},[2457],{"type":998,"value":1074},{"type":993,"tag":1021,"props":2459,"children":2460},{"class":1023,"line":54},[2461,2466,2470],{"type":993,"tag":1021,"props":2462,"children":2463},{"style":1056},[2464],{"type":998,"value":2465},"    'task4'",{"type":993,"tag":1021,"props":2467,"children":2468},{"style":1036},[2469],{"type":998,"value":1064},{"type":993,"tag":1021,"props":2471,"children":2472},{"style":1056},[2473],{"type":998,"value":2474},"'generate_report'\n",{"type":993,"tag":1021,"props":2476,"children":2477},{"class":1023,"line":63},[2478],{"type":993,"tag":1021,"props":2479,"children":2480},{"style":1036},[2481],{"type":998,"value":1121},{"type":993,"tag":1021,"props":2483,"children":2484},{"class":1023,"line":72},[2485],{"type":993,"tag":1021,"props":2486,"children":2487},{"emptyLinePlaceholder":13},[2488],{"type":998,"value":1129},{"type":993,"tag":1021,"props":2490,"children":2491},{"class":1023,"line":81},[2492,2496,2500,2505],{"type":993,"tag":1021,"props":2493,"children":2494},{"style":1135},[2495],{"type":998,"value":1138},{"type":993,"tag":1021,"props":2497,"children":2498},{"style":1036},[2499],{"type":998,"value":1143},{"type":993,"tag":1021,"props":2501,"children":2502},{"style":1056},[2503],{"type":998,"value":2504},"\"Task queue:\"",{"type":993,"tag":1021,"props":2506,"children":2507},{"style":1036},[2508],{"type":998,"value":2509},", task_queue)\n",{"type":993,"tag":1021,"props":2511,"children":2512},{"class":1023,"line":91},[2513],{"type":993,"tag":1021,"props":2514,"children":2515},{"emptyLinePlaceholder":13},[2516],{"type":998,"value":1129},{"type":993,"tag":1021,"props":2518,"children":2519},{"class":1023,"line":100},[2520],{"type":993,"tag":1021,"props":2521,"children":2522},{"style":1027},[2523],{"type":998,"value":2524},"# Process tasks in LIFO order (last in, first out)\n",{"type":993,"tag":1021,"props":2526,"children":2527},{"class":1023,"line":109},[2528,2533],{"type":993,"tag":1021,"props":2529,"children":2530},{"style":1042},[2531],{"type":998,"value":2532},"while",{"type":993,"tag":1021,"props":2534,"children":2535},{"style":1036},[2536],{"type":998,"value":2537}," task_queue:\n",{"type":993,"tag":1021,"props":2539,"children":2540},{"class":1023,"line":118},[2541,2546,2550],{"type":993,"tag":1021,"props":2542,"children":2543},{"style":1036},[2544],{"type":998,"value":2545},"    task_id, task_action ",{"type":993,"tag":1021,"props":2547,"children":2548},{"style":1042},[2549],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2551,"children":2552},{"style":1036},[2553],{"type":998,"value":2554}," task_queue.popitem()\n",{"type":993,"tag":1021,"props":2556,"children":2557},{"class":1023,"line":127},[2558,2563,2567,2571,2576,2580,2585,2589,2593,2597,2602,2606,2610],{"type":993,"tag":1021,"props":2559,"children":2560},{"style":1135},[2561],{"type":998,"value":2562},"    print",{"type":993,"tag":1021,"props":2564,"children":2565},{"style":1036},[2566],{"type":998,"value":1143},{"type":993,"tag":1021,"props":2568,"children":2569},{"style":1042},[2570],{"type":998,"value":1832},{"type":993,"tag":1021,"props":2572,"children":2573},{"style":1056},[2574],{"type":998,"value":2575},"\"Processing ",{"type":993,"tag":1021,"props":2577,"children":2578},{"style":1135},[2579],{"type":998,"value":1842},{"type":993,"tag":1021,"props":2581,"children":2582},{"style":1036},[2583],{"type":998,"value":2584},"task_id",{"type":993,"tag":1021,"props":2586,"children":2587},{"style":1135},[2588],{"type":998,"value":1852},{"type":993,"tag":1021,"props":2590,"children":2591},{"style":1056},[2592],{"type":998,"value":1064},{"type":993,"tag":1021,"props":2594,"children":2595},{"style":1135},[2596],{"type":998,"value":1842},{"type":993,"tag":1021,"props":2598,"children":2599},{"style":1036},[2600],{"type":998,"value":2601},"task_action",{"type":993,"tag":1021,"props":2603,"children":2604},{"style":1135},[2605],{"type":998,"value":1852},{"type":993,"tag":1021,"props":2607,"children":2608},{"style":1056},[2609],{"type":998,"value":1875},{"type":993,"tag":1021,"props":2611,"children":2612},{"style":1036},[2613],{"type":998,"value":1263},{"type":993,"tag":1021,"props":2615,"children":2616},{"class":1023,"line":136},[2617],{"type":993,"tag":1021,"props":2618,"children":2619},{"style":1036},[2620],{"type":998,"value":2621},"    \n",{"type":993,"tag":1021,"props":2623,"children":2624},{"class":1023,"line":146},[2625],{"type":993,"tag":1021,"props":2626,"children":2627},{"style":1027},[2628],{"type":998,"value":2629},"    # Simulate task completion\n",{"type":993,"tag":1021,"props":2631,"children":2632},{"class":1023,"line":155},[2633,2638,2643,2648,2653,2658,2663],{"type":993,"tag":1021,"props":2634,"children":2635},{"style":1042},[2636],{"type":998,"value":2637},"    if",{"type":993,"tag":1021,"props":2639,"children":2640},{"style":1135},[2641],{"type":998,"value":2642}," len",{"type":993,"tag":1021,"props":2644,"children":2645},{"style":1036},[2646],{"type":998,"value":2647},"(task_queue) ",{"type":993,"tag":1021,"props":2649,"children":2650},{"style":1042},[2651],{"type":998,"value":2652},"==",{"type":993,"tag":1021,"props":2654,"children":2655},{"style":1135},[2656],{"type":998,"value":2657}," 2",{"type":993,"tag":1021,"props":2659,"children":2660},{"style":1036},[2661],{"type":998,"value":2662},":  ",{"type":993,"tag":1021,"props":2664,"children":2665},{"style":1027},[2666],{"type":998,"value":2667},"# Stop early for demo\n",{"type":993,"tag":1021,"props":2669,"children":2670},{"class":1023,"line":164},[2671],{"type":993,"tag":1021,"props":2672,"children":2673},{"style":1042},[2674],{"type":998,"value":2675},"        break\n",{"type":993,"tag":1021,"props":2677,"children":2678},{"class":1023,"line":173},[2679],{"type":993,"tag":1021,"props":2680,"children":2681},{"emptyLinePlaceholder":13},[2682],{"type":998,"value":1129},{"type":993,"tag":1021,"props":2684,"children":2685},{"class":1023,"line":182},[2686,2690,2694,2699],{"type":993,"tag":1021,"props":2687,"children":2688},{"style":1135},[2689],{"type":998,"value":1138},{"type":993,"tag":1021,"props":2691,"children":2692},{"style":1036},[2693],{"type":998,"value":1143},{"type":993,"tag":1021,"props":2695,"children":2696},{"style":1056},[2697],{"type":998,"value":2698},"\"Remaining tasks:\"",{"type":993,"tag":1021,"props":2700,"children":2701},{"style":1036},[2702],{"type":998,"value":2509},{"type":993,"tag":1526,"props":2704,"children":2708},{"emoji":2705,"title":2706,"type":2707},"🎲","popitem() Behavior","info",[2709,2719,2729,2739],{"type":993,"tag":1001,"props":2710,"children":2711},{},[2712,2717],{"type":993,"tag":1536,"props":2713,"children":2714},{},[2715],{"type":998,"value":2716},"LIFO Order:",{"type":998,"value":2718}," In Python 3.7+, removes the last inserted item (stack behavior).",{"type":993,"tag":1001,"props":2720,"children":2721},{},[2722,2727],{"type":993,"tag":1536,"props":2723,"children":2724},{},[2725],{"type":998,"value":2726},"Returns Tuple:",{"type":998,"value":2728}," Returns (key, value) tuple of the removed item.",{"type":993,"tag":1001,"props":2730,"children":2731},{},[2732,2737],{"type":993,"tag":1536,"props":2733,"children":2734},{},[2735],{"type":998,"value":2736},"Empty Dictionary:",{"type":998,"value":2738}," Raises KeyError if called on an empty dictionary.",{"type":993,"tag":1001,"props":2740,"children":2741},{},[2742,2747],{"type":993,"tag":1536,"props":2743,"children":2744},{},[2745],{"type":998,"value":2746},"Use Cases:",{"type":998,"value":2748}," Task queues, undo functionality, or removing arbitrary items.",{"type":993,"tag":1306,"props":2750,"children":2752},{"id":2751},"clearing-all-items",[2753],{"type":998,"value":2754},"🧹 Clearing All Items",{"type":993,"tag":1001,"props":2756,"children":2757},{},[2758,2759,2765],{"type":998,"value":1316},{"type":993,"tag":1017,"props":2760,"children":2762},{"className":2761},[],[2763],{"type":998,"value":2764},"clear()",{"type":998,"value":2766}," method efficiently removes all items from a dictionary, leaving an empty container. This approach is much faster than deleting items individually when you need to reset a dictionary.",{"type":993,"tag":1007,"props":2768,"children":2769},{},[2770],{"type":993,"tag":1011,"props":2771,"children":2773},{"className":1013,"code":2772,"language":6,"meta":8,"style":8},"temporary_data = {\n    'temp1': 'value1',\n    'temp2': 'value2', \n    'temp3': 'value3',\n    'cache': ['item1', 'item2']\n}\n\nprint(\"Before clearing:\", temporary_data)\nprint(\"Dictionary size:\", len(temporary_data))\n\n# Remove everything\ntemporary_data.clear()\n\nprint(\"After clearing:\", temporary_data)\nprint(\"Dictionary size:\", len(temporary_data))\nprint(\"Dictionary still exists:\", type(temporary_data))\n",[2774],{"type":993,"tag":1017,"props":2775,"children":2776},{"__ignoreMap":8},[2777,2793,2814,2835,2856,2887,2894,2901,2922,2952,2959,2967,2975,2982,3002,3029],{"type":993,"tag":1021,"props":2778,"children":2779},{"class":1023,"line":12},[2780,2785,2789],{"type":993,"tag":1021,"props":2781,"children":2782},{"style":1036},[2783],{"type":998,"value":2784},"temporary_data ",{"type":993,"tag":1021,"props":2786,"children":2787},{"style":1042},[2788],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2790,"children":2791},{"style":1036},[2792],{"type":998,"value":1050},{"type":993,"tag":1021,"props":2794,"children":2795},{"class":1023,"line":27},[2796,2801,2805,2810],{"type":993,"tag":1021,"props":2797,"children":2798},{"style":1056},[2799],{"type":998,"value":2800},"    'temp1'",{"type":993,"tag":1021,"props":2802,"children":2803},{"style":1036},[2804],{"type":998,"value":1064},{"type":993,"tag":1021,"props":2806,"children":2807},{"style":1056},[2808],{"type":998,"value":2809},"'value1'",{"type":993,"tag":1021,"props":2811,"children":2812},{"style":1036},[2813],{"type":998,"value":1074},{"type":993,"tag":1021,"props":2815,"children":2816},{"class":1023,"line":36},[2817,2822,2826,2831],{"type":993,"tag":1021,"props":2818,"children":2819},{"style":1056},[2820],{"type":998,"value":2821},"    'temp2'",{"type":993,"tag":1021,"props":2823,"children":2824},{"style":1036},[2825],{"type":998,"value":1064},{"type":993,"tag":1021,"props":2827,"children":2828},{"style":1056},[2829],{"type":998,"value":2830},"'value2'",{"type":993,"tag":1021,"props":2832,"children":2833},{"style":1036},[2834],{"type":998,"value":1096},{"type":993,"tag":1021,"props":2836,"children":2837},{"class":1023,"line":45},[2838,2843,2847,2852],{"type":993,"tag":1021,"props":2839,"children":2840},{"style":1056},[2841],{"type":998,"value":2842},"    'temp3'",{"type":993,"tag":1021,"props":2844,"children":2845},{"style":1036},[2846],{"type":998,"value":1064},{"type":993,"tag":1021,"props":2848,"children":2849},{"style":1056},[2850],{"type":998,"value":2851},"'value3'",{"type":993,"tag":1021,"props":2853,"children":2854},{"style":1036},[2855],{"type":998,"value":1074},{"type":993,"tag":1021,"props":2857,"children":2858},{"class":1023,"line":54},[2859,2864,2869,2874,2878,2883],{"type":993,"tag":1021,"props":2860,"children":2861},{"style":1056},[2862],{"type":998,"value":2863},"    'cache'",{"type":993,"tag":1021,"props":2865,"children":2866},{"style":1036},[2867],{"type":998,"value":2868},": [",{"type":993,"tag":1021,"props":2870,"children":2871},{"style":1056},[2872],{"type":998,"value":2873},"'item1'",{"type":993,"tag":1021,"props":2875,"children":2876},{"style":1036},[2877],{"type":998,"value":1253},{"type":993,"tag":1021,"props":2879,"children":2880},{"style":1056},[2881],{"type":998,"value":2882},"'item2'",{"type":993,"tag":1021,"props":2884,"children":2885},{"style":1036},[2886],{"type":998,"value":1191},{"type":993,"tag":1021,"props":2888,"children":2889},{"class":1023,"line":63},[2890],{"type":993,"tag":1021,"props":2891,"children":2892},{"style":1036},[2893],{"type":998,"value":1121},{"type":993,"tag":1021,"props":2895,"children":2896},{"class":1023,"line":72},[2897],{"type":993,"tag":1021,"props":2898,"children":2899},{"emptyLinePlaceholder":13},[2900],{"type":998,"value":1129},{"type":993,"tag":1021,"props":2902,"children":2903},{"class":1023,"line":81},[2904,2908,2912,2917],{"type":993,"tag":1021,"props":2905,"children":2906},{"style":1135},[2907],{"type":998,"value":1138},{"type":993,"tag":1021,"props":2909,"children":2910},{"style":1036},[2911],{"type":998,"value":1143},{"type":993,"tag":1021,"props":2913,"children":2914},{"style":1056},[2915],{"type":998,"value":2916},"\"Before clearing:\"",{"type":993,"tag":1021,"props":2918,"children":2919},{"style":1036},[2920],{"type":998,"value":2921},", temporary_data)\n",{"type":993,"tag":1021,"props":2923,"children":2924},{"class":1023,"line":91},[2925,2929,2933,2938,2942,2947],{"type":993,"tag":1021,"props":2926,"children":2927},{"style":1135},[2928],{"type":998,"value":1138},{"type":993,"tag":1021,"props":2930,"children":2931},{"style":1036},[2932],{"type":998,"value":1143},{"type":993,"tag":1021,"props":2934,"children":2935},{"style":1056},[2936],{"type":998,"value":2937},"\"Dictionary size:\"",{"type":993,"tag":1021,"props":2939,"children":2940},{"style":1036},[2941],{"type":998,"value":1253},{"type":993,"tag":1021,"props":2943,"children":2944},{"style":1135},[2945],{"type":998,"value":2946},"len",{"type":993,"tag":1021,"props":2948,"children":2949},{"style":1036},[2950],{"type":998,"value":2951},"(temporary_data))\n",{"type":993,"tag":1021,"props":2953,"children":2954},{"class":1023,"line":100},[2955],{"type":993,"tag":1021,"props":2956,"children":2957},{"emptyLinePlaceholder":13},[2958],{"type":998,"value":1129},{"type":993,"tag":1021,"props":2960,"children":2961},{"class":1023,"line":109},[2962],{"type":993,"tag":1021,"props":2963,"children":2964},{"style":1027},[2965],{"type":998,"value":2966},"# Remove everything\n",{"type":993,"tag":1021,"props":2968,"children":2969},{"class":1023,"line":118},[2970],{"type":993,"tag":1021,"props":2971,"children":2972},{"style":1036},[2973],{"type":998,"value":2974},"temporary_data.clear()\n",{"type":993,"tag":1021,"props":2976,"children":2977},{"class":1023,"line":127},[2978],{"type":993,"tag":1021,"props":2979,"children":2980},{"emptyLinePlaceholder":13},[2981],{"type":998,"value":1129},{"type":993,"tag":1021,"props":2983,"children":2984},{"class":1023,"line":136},[2985,2989,2993,2998],{"type":993,"tag":1021,"props":2986,"children":2987},{"style":1135},[2988],{"type":998,"value":1138},{"type":993,"tag":1021,"props":2990,"children":2991},{"style":1036},[2992],{"type":998,"value":1143},{"type":993,"tag":1021,"props":2994,"children":2995},{"style":1056},[2996],{"type":998,"value":2997},"\"After clearing:\"",{"type":993,"tag":1021,"props":2999,"children":3000},{"style":1036},[3001],{"type":998,"value":2921},{"type":993,"tag":1021,"props":3003,"children":3004},{"class":1023,"line":146},[3005,3009,3013,3017,3021,3025],{"type":993,"tag":1021,"props":3006,"children":3007},{"style":1135},[3008],{"type":998,"value":1138},{"type":993,"tag":1021,"props":3010,"children":3011},{"style":1036},[3012],{"type":998,"value":1143},{"type":993,"tag":1021,"props":3014,"children":3015},{"style":1056},[3016],{"type":998,"value":2937},{"type":993,"tag":1021,"props":3018,"children":3019},{"style":1036},[3020],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3022,"children":3023},{"style":1135},[3024],{"type":998,"value":2946},{"type":993,"tag":1021,"props":3026,"children":3027},{"style":1036},[3028],{"type":998,"value":2951},{"type":993,"tag":1021,"props":3030,"children":3031},{"class":1023,"line":155},[3032,3036,3040,3045,3049,3054],{"type":993,"tag":1021,"props":3033,"children":3034},{"style":1135},[3035],{"type":998,"value":1138},{"type":993,"tag":1021,"props":3037,"children":3038},{"style":1036},[3039],{"type":998,"value":1143},{"type":993,"tag":1021,"props":3041,"children":3042},{"style":1056},[3043],{"type":998,"value":3044},"\"Dictionary still exists:\"",{"type":993,"tag":1021,"props":3046,"children":3047},{"style":1036},[3048],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3050,"children":3051},{"style":1135},[3052],{"type":998,"value":3053},"type",{"type":993,"tag":1021,"props":3055,"children":3056},{"style":1036},[3057],{"type":998,"value":2951},{"type":993,"tag":1306,"props":3059,"children":3061},{"id":3060},"conditional-deletion-patterns",[3062],{"type":998,"value":3063},"🌟 Conditional Deletion Patterns",{"type":993,"tag":1001,"props":3065,"children":3066},{},[3067],{"type":998,"value":3068},"Smart deletion strategies handle complex scenarios where removal depends on specific conditions or data validation requirements.",{"type":993,"tag":1592,"props":3070,"children":3072},{"id":3071},"deleting-based-on-values",[3073],{"type":998,"value":3074},"Deleting Based on Values",{"type":993,"tag":1001,"props":3076,"children":3077},{},[3078],{"type":998,"value":3079},"Removing items based on their values rather than keys enables data cleanup and filtering operations.",{"type":993,"tag":1007,"props":3081,"children":3082},{},[3083],{"type":993,"tag":1011,"props":3084,"children":3086},{"className":1013,"code":3085,"language":6,"meta":8,"style":8},"user_sessions = {\n    'user1': {'status': 'active', 'login_time': '10:00'},\n    'user2': {'status': 'expired', 'login_time': '08:00'},\n    'user3': {'status': 'active', 'login_time': '11:30'},\n    'user4': {'status': 'expired', 'login_time': '07:45'}\n}\n\nprint(\"All sessions:\", user_sessions)\n\n# Remove expired sessions\nexpired_users = []\nfor user_id, session_data in user_sessions.items():\n    if session_data['status'] == 'expired':\n        expired_users.append(user_id)\n\nfor user_id in expired_users:\n    removed_session = user_sessions.pop(user_id)\n    print(f\"Removed expired session for {user_id}\")\n\nprint(\"Active sessions:\", user_sessions)\n",[3087],{"type":993,"tag":1017,"props":3088,"children":3089},{"__ignoreMap":8},[3090,3106,3156,3202,3247,3292,3299,3306,3327,3334,3342,3359,3382,3417,3425,3432,3453,3470,3511,3518],{"type":993,"tag":1021,"props":3091,"children":3092},{"class":1023,"line":12},[3093,3098,3102],{"type":993,"tag":1021,"props":3094,"children":3095},{"style":1036},[3096],{"type":998,"value":3097},"user_sessions ",{"type":993,"tag":1021,"props":3099,"children":3100},{"style":1042},[3101],{"type":998,"value":1045},{"type":993,"tag":1021,"props":3103,"children":3104},{"style":1036},[3105],{"type":998,"value":1050},{"type":993,"tag":1021,"props":3107,"children":3108},{"class":1023,"line":27},[3109,3114,3119,3124,3128,3133,3137,3142,3146,3151],{"type":993,"tag":1021,"props":3110,"children":3111},{"style":1056},[3112],{"type":998,"value":3113},"    'user1'",{"type":993,"tag":1021,"props":3115,"children":3116},{"style":1036},[3117],{"type":998,"value":3118},": {",{"type":993,"tag":1021,"props":3120,"children":3121},{"style":1056},[3122],{"type":998,"value":3123},"'status'",{"type":993,"tag":1021,"props":3125,"children":3126},{"style":1036},[3127],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3129,"children":3130},{"style":1056},[3131],{"type":998,"value":3132},"'active'",{"type":993,"tag":1021,"props":3134,"children":3135},{"style":1036},[3136],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3138,"children":3139},{"style":1056},[3140],{"type":998,"value":3141},"'login_time'",{"type":993,"tag":1021,"props":3143,"children":3144},{"style":1036},[3145],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3147,"children":3148},{"style":1056},[3149],{"type":998,"value":3150},"'10:00'",{"type":993,"tag":1021,"props":3152,"children":3153},{"style":1036},[3154],{"type":998,"value":3155},"},\n",{"type":993,"tag":1021,"props":3157,"children":3158},{"class":1023,"line":36},[3159,3164,3168,3172,3176,3181,3185,3189,3193,3198],{"type":993,"tag":1021,"props":3160,"children":3161},{"style":1056},[3162],{"type":998,"value":3163},"    'user2'",{"type":993,"tag":1021,"props":3165,"children":3166},{"style":1036},[3167],{"type":998,"value":3118},{"type":993,"tag":1021,"props":3169,"children":3170},{"style":1056},[3171],{"type":998,"value":3123},{"type":993,"tag":1021,"props":3173,"children":3174},{"style":1036},[3175],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3177,"children":3178},{"style":1056},[3179],{"type":998,"value":3180},"'expired'",{"type":993,"tag":1021,"props":3182,"children":3183},{"style":1036},[3184],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3186,"children":3187},{"style":1056},[3188],{"type":998,"value":3141},{"type":993,"tag":1021,"props":3190,"children":3191},{"style":1036},[3192],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3194,"children":3195},{"style":1056},[3196],{"type":998,"value":3197},"'08:00'",{"type":993,"tag":1021,"props":3199,"children":3200},{"style":1036},[3201],{"type":998,"value":3155},{"type":993,"tag":1021,"props":3203,"children":3204},{"class":1023,"line":45},[3205,3210,3214,3218,3222,3226,3230,3234,3238,3243],{"type":993,"tag":1021,"props":3206,"children":3207},{"style":1056},[3208],{"type":998,"value":3209},"    'user3'",{"type":993,"tag":1021,"props":3211,"children":3212},{"style":1036},[3213],{"type":998,"value":3118},{"type":993,"tag":1021,"props":3215,"children":3216},{"style":1056},[3217],{"type":998,"value":3123},{"type":993,"tag":1021,"props":3219,"children":3220},{"style":1036},[3221],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3223,"children":3224},{"style":1056},[3225],{"type":998,"value":3132},{"type":993,"tag":1021,"props":3227,"children":3228},{"style":1036},[3229],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3231,"children":3232},{"style":1056},[3233],{"type":998,"value":3141},{"type":993,"tag":1021,"props":3235,"children":3236},{"style":1036},[3237],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3239,"children":3240},{"style":1056},[3241],{"type":998,"value":3242},"'11:30'",{"type":993,"tag":1021,"props":3244,"children":3245},{"style":1036},[3246],{"type":998,"value":3155},{"type":993,"tag":1021,"props":3248,"children":3249},{"class":1023,"line":54},[3250,3255,3259,3263,3267,3271,3275,3279,3283,3288],{"type":993,"tag":1021,"props":3251,"children":3252},{"style":1056},[3253],{"type":998,"value":3254},"    'user4'",{"type":993,"tag":1021,"props":3256,"children":3257},{"style":1036},[3258],{"type":998,"value":3118},{"type":993,"tag":1021,"props":3260,"children":3261},{"style":1056},[3262],{"type":998,"value":3123},{"type":993,"tag":1021,"props":3264,"children":3265},{"style":1036},[3266],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3268,"children":3269},{"style":1056},[3270],{"type":998,"value":3180},{"type":993,"tag":1021,"props":3272,"children":3273},{"style":1036},[3274],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3276,"children":3277},{"style":1056},[3278],{"type":998,"value":3141},{"type":993,"tag":1021,"props":3280,"children":3281},{"style":1036},[3282],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3284,"children":3285},{"style":1056},[3286],{"type":998,"value":3287},"'07:45'",{"type":993,"tag":1021,"props":3289,"children":3290},{"style":1036},[3291],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3293,"children":3294},{"class":1023,"line":63},[3295],{"type":993,"tag":1021,"props":3296,"children":3297},{"style":1036},[3298],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3300,"children":3301},{"class":1023,"line":72},[3302],{"type":993,"tag":1021,"props":3303,"children":3304},{"emptyLinePlaceholder":13},[3305],{"type":998,"value":1129},{"type":993,"tag":1021,"props":3307,"children":3308},{"class":1023,"line":81},[3309,3313,3317,3322],{"type":993,"tag":1021,"props":3310,"children":3311},{"style":1135},[3312],{"type":998,"value":1138},{"type":993,"tag":1021,"props":3314,"children":3315},{"style":1036},[3316],{"type":998,"value":1143},{"type":993,"tag":1021,"props":3318,"children":3319},{"style":1056},[3320],{"type":998,"value":3321},"\"All sessions:\"",{"type":993,"tag":1021,"props":3323,"children":3324},{"style":1036},[3325],{"type":998,"value":3326},", user_sessions)\n",{"type":993,"tag":1021,"props":3328,"children":3329},{"class":1023,"line":91},[3330],{"type":993,"tag":1021,"props":3331,"children":3332},{"emptyLinePlaceholder":13},[3333],{"type":998,"value":1129},{"type":993,"tag":1021,"props":3335,"children":3336},{"class":1023,"line":100},[3337],{"type":993,"tag":1021,"props":3338,"children":3339},{"style":1027},[3340],{"type":998,"value":3341},"# Remove expired sessions\n",{"type":993,"tag":1021,"props":3343,"children":3344},{"class":1023,"line":109},[3345,3350,3354],{"type":993,"tag":1021,"props":3346,"children":3347},{"style":1036},[3348],{"type":998,"value":3349},"expired_users ",{"type":993,"tag":1021,"props":3351,"children":3352},{"style":1042},[3353],{"type":998,"value":1045},{"type":993,"tag":1021,"props":3355,"children":3356},{"style":1036},[3357],{"type":998,"value":3358}," []\n",{"type":993,"tag":1021,"props":3360,"children":3361},{"class":1023,"line":118},[3362,3367,3372,3377],{"type":993,"tag":1021,"props":3363,"children":3364},{"style":1042},[3365],{"type":998,"value":3366},"for",{"type":993,"tag":1021,"props":3368,"children":3369},{"style":1036},[3370],{"type":998,"value":3371}," user_id, session_data ",{"type":993,"tag":1021,"props":3373,"children":3374},{"style":1042},[3375],{"type":998,"value":3376},"in",{"type":993,"tag":1021,"props":3378,"children":3379},{"style":1036},[3380],{"type":998,"value":3381}," user_sessions.items():\n",{"type":993,"tag":1021,"props":3383,"children":3384},{"class":1023,"line":127},[3385,3389,3394,3398,3403,3407,3412],{"type":993,"tag":1021,"props":3386,"children":3387},{"style":1042},[3388],{"type":998,"value":2637},{"type":993,"tag":1021,"props":3390,"children":3391},{"style":1036},[3392],{"type":998,"value":3393}," session_data[",{"type":993,"tag":1021,"props":3395,"children":3396},{"style":1056},[3397],{"type":998,"value":3123},{"type":993,"tag":1021,"props":3399,"children":3400},{"style":1036},[3401],{"type":998,"value":3402},"] ",{"type":993,"tag":1021,"props":3404,"children":3405},{"style":1042},[3406],{"type":998,"value":2652},{"type":993,"tag":1021,"props":3408,"children":3409},{"style":1056},[3410],{"type":998,"value":3411}," 'expired'",{"type":993,"tag":1021,"props":3413,"children":3414},{"style":1036},[3415],{"type":998,"value":3416},":\n",{"type":993,"tag":1021,"props":3418,"children":3419},{"class":1023,"line":136},[3420],{"type":993,"tag":1021,"props":3421,"children":3422},{"style":1036},[3423],{"type":998,"value":3424},"        expired_users.append(user_id)\n",{"type":993,"tag":1021,"props":3426,"children":3427},{"class":1023,"line":146},[3428],{"type":993,"tag":1021,"props":3429,"children":3430},{"emptyLinePlaceholder":13},[3431],{"type":998,"value":1129},{"type":993,"tag":1021,"props":3433,"children":3434},{"class":1023,"line":155},[3435,3439,3444,3448],{"type":993,"tag":1021,"props":3436,"children":3437},{"style":1042},[3438],{"type":998,"value":3366},{"type":993,"tag":1021,"props":3440,"children":3441},{"style":1036},[3442],{"type":998,"value":3443}," user_id ",{"type":993,"tag":1021,"props":3445,"children":3446},{"style":1042},[3447],{"type":998,"value":3376},{"type":993,"tag":1021,"props":3449,"children":3450},{"style":1036},[3451],{"type":998,"value":3452}," expired_users:\n",{"type":993,"tag":1021,"props":3454,"children":3455},{"class":1023,"line":164},[3456,3461,3465],{"type":993,"tag":1021,"props":3457,"children":3458},{"style":1036},[3459],{"type":998,"value":3460},"    removed_session ",{"type":993,"tag":1021,"props":3462,"children":3463},{"style":1042},[3464],{"type":998,"value":1045},{"type":993,"tag":1021,"props":3466,"children":3467},{"style":1036},[3468],{"type":998,"value":3469}," user_sessions.pop(user_id)\n",{"type":993,"tag":1021,"props":3471,"children":3472},{"class":1023,"line":173},[3473,3477,3481,3485,3490,3494,3499,3503,3507],{"type":993,"tag":1021,"props":3474,"children":3475},{"style":1135},[3476],{"type":998,"value":2562},{"type":993,"tag":1021,"props":3478,"children":3479},{"style":1036},[3480],{"type":998,"value":1143},{"type":993,"tag":1021,"props":3482,"children":3483},{"style":1042},[3484],{"type":998,"value":1832},{"type":993,"tag":1021,"props":3486,"children":3487},{"style":1056},[3488],{"type":998,"value":3489},"\"Removed expired session for ",{"type":993,"tag":1021,"props":3491,"children":3492},{"style":1135},[3493],{"type":998,"value":1842},{"type":993,"tag":1021,"props":3495,"children":3496},{"style":1036},[3497],{"type":998,"value":3498},"user_id",{"type":993,"tag":1021,"props":3500,"children":3501},{"style":1135},[3502],{"type":998,"value":1852},{"type":993,"tag":1021,"props":3504,"children":3505},{"style":1056},[3506],{"type":998,"value":1875},{"type":993,"tag":1021,"props":3508,"children":3509},{"style":1036},[3510],{"type":998,"value":1263},{"type":993,"tag":1021,"props":3512,"children":3513},{"class":1023,"line":182},[3514],{"type":993,"tag":1021,"props":3515,"children":3516},{"emptyLinePlaceholder":13},[3517],{"type":998,"value":1129},{"type":993,"tag":1021,"props":3519,"children":3520},{"class":1023,"line":191},[3521,3525,3529,3533],{"type":993,"tag":1021,"props":3522,"children":3523},{"style":1135},[3524],{"type":998,"value":1138},{"type":993,"tag":1021,"props":3526,"children":3527},{"style":1036},[3528],{"type":998,"value":1143},{"type":993,"tag":1021,"props":3530,"children":3531},{"style":1056},[3532],{"type":998,"value":1148},{"type":993,"tag":1021,"props":3534,"children":3535},{"style":1036},[3536],{"type":998,"value":3326},{"type":993,"tag":1592,"props":3538,"children":3540},{"id":3539},"batch-deletion-with-filtering",[3541],{"type":998,"value":3542},"Batch Deletion with Filtering",{"type":993,"tag":1001,"props":3544,"children":3545},{},[3546],{"type":998,"value":3547},"Removing multiple items based on complex criteria requires careful iteration and collection strategies.",{"type":993,"tag":1007,"props":3549,"children":3550},{},[3551],{"type":993,"tag":1011,"props":3552,"children":3554},{"className":1013,"code":3553,"language":6,"meta":8,"style":8},"product_inventory = {\n    'laptop1': {'stock': 0, 'price': 999},\n    'mouse1': {'stock': 25, 'price': 29},\n    'keyboard1': {'stock': 0, 'price': 79},\n    'monitor1': {'stock': 5, 'price': 299},\n    'headset1': {'stock': 0, 'price': 159}\n}\n\nprint(\"Full inventory:\", len(product_inventory), \"items\")\n\n# Remove out-of-stock items\nto_remove = [\n    product_id for product_id, details in product_inventory.items()\n    if details['stock'] == 0\n]\n\nremoved_items = {}\nfor product_id in to_remove:\n    removed_items[product_id] = product_inventory.pop(product_id)\n\nprint(f\"Removed {len(removed_items)} out-of-stock items\")\nprint(\"Remaining inventory:\", list(product_inventory.keys()))\n",[3555],{"type":993,"tag":1017,"props":3556,"children":3557},{"__ignoreMap":8},[3558,3574,3622,3667,3712,3758,3803,3810,3817,3854,3861,3869,3886,3912,3941,3948,3955,3972,3993,4010,4017,4060],{"type":993,"tag":1021,"props":3559,"children":3560},{"class":1023,"line":12},[3561,3566,3570],{"type":993,"tag":1021,"props":3562,"children":3563},{"style":1036},[3564],{"type":998,"value":3565},"product_inventory ",{"type":993,"tag":1021,"props":3567,"children":3568},{"style":1042},[3569],{"type":998,"value":1045},{"type":993,"tag":1021,"props":3571,"children":3572},{"style":1036},[3573],{"type":998,"value":1050},{"type":993,"tag":1021,"props":3575,"children":3576},{"class":1023,"line":27},[3577,3582,3586,3591,3595,3600,3604,3609,3613,3618],{"type":993,"tag":1021,"props":3578,"children":3579},{"style":1056},[3580],{"type":998,"value":3581},"    'laptop1'",{"type":993,"tag":1021,"props":3583,"children":3584},{"style":1036},[3585],{"type":998,"value":3118},{"type":993,"tag":1021,"props":3587,"children":3588},{"style":1056},[3589],{"type":998,"value":3590},"'stock'",{"type":993,"tag":1021,"props":3592,"children":3593},{"style":1036},[3594],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3596,"children":3597},{"style":1135},[3598],{"type":998,"value":3599},"0",{"type":993,"tag":1021,"props":3601,"children":3602},{"style":1036},[3603],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3605,"children":3606},{"style":1056},[3607],{"type":998,"value":3608},"'price'",{"type":993,"tag":1021,"props":3610,"children":3611},{"style":1036},[3612],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3614,"children":3615},{"style":1135},[3616],{"type":998,"value":3617},"999",{"type":993,"tag":1021,"props":3619,"children":3620},{"style":1036},[3621],{"type":998,"value":3155},{"type":993,"tag":1021,"props":3623,"children":3624},{"class":1023,"line":36},[3625,3630,3634,3638,3642,3646,3650,3654,3658,3663],{"type":993,"tag":1021,"props":3626,"children":3627},{"style":1056},[3628],{"type":998,"value":3629},"    'mouse1'",{"type":993,"tag":1021,"props":3631,"children":3632},{"style":1036},[3633],{"type":998,"value":3118},{"type":993,"tag":1021,"props":3635,"children":3636},{"style":1056},[3637],{"type":998,"value":3590},{"type":993,"tag":1021,"props":3639,"children":3640},{"style":1036},[3641],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3643,"children":3644},{"style":1135},[3645],{"type":998,"value":1400},{"type":993,"tag":1021,"props":3647,"children":3648},{"style":1036},[3649],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3651,"children":3652},{"style":1056},[3653],{"type":998,"value":3608},{"type":993,"tag":1021,"props":3655,"children":3656},{"style":1036},[3657],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3659,"children":3660},{"style":1135},[3661],{"type":998,"value":3662},"29",{"type":993,"tag":1021,"props":3664,"children":3665},{"style":1036},[3666],{"type":998,"value":3155},{"type":993,"tag":1021,"props":3668,"children":3669},{"class":1023,"line":45},[3670,3675,3679,3683,3687,3691,3695,3699,3703,3708],{"type":993,"tag":1021,"props":3671,"children":3672},{"style":1056},[3673],{"type":998,"value":3674},"    'keyboard1'",{"type":993,"tag":1021,"props":3676,"children":3677},{"style":1036},[3678],{"type":998,"value":3118},{"type":993,"tag":1021,"props":3680,"children":3681},{"style":1056},[3682],{"type":998,"value":3590},{"type":993,"tag":1021,"props":3684,"children":3685},{"style":1036},[3686],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3688,"children":3689},{"style":1135},[3690],{"type":998,"value":3599},{"type":993,"tag":1021,"props":3692,"children":3693},{"style":1036},[3694],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3696,"children":3697},{"style":1056},[3698],{"type":998,"value":3608},{"type":993,"tag":1021,"props":3700,"children":3701},{"style":1036},[3702],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3704,"children":3705},{"style":1135},[3706],{"type":998,"value":3707},"79",{"type":993,"tag":1021,"props":3709,"children":3710},{"style":1036},[3711],{"type":998,"value":3155},{"type":993,"tag":1021,"props":3713,"children":3714},{"class":1023,"line":54},[3715,3720,3724,3728,3732,3737,3741,3745,3749,3754],{"type":993,"tag":1021,"props":3716,"children":3717},{"style":1056},[3718],{"type":998,"value":3719},"    'monitor1'",{"type":993,"tag":1021,"props":3721,"children":3722},{"style":1036},[3723],{"type":998,"value":3118},{"type":993,"tag":1021,"props":3725,"children":3726},{"style":1056},[3727],{"type":998,"value":3590},{"type":993,"tag":1021,"props":3729,"children":3730},{"style":1036},[3731],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3733,"children":3734},{"style":1135},[3735],{"type":998,"value":3736},"5",{"type":993,"tag":1021,"props":3738,"children":3739},{"style":1036},[3740],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3742,"children":3743},{"style":1056},[3744],{"type":998,"value":3608},{"type":993,"tag":1021,"props":3746,"children":3747},{"style":1036},[3748],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3750,"children":3751},{"style":1135},[3752],{"type":998,"value":3753},"299",{"type":993,"tag":1021,"props":3755,"children":3756},{"style":1036},[3757],{"type":998,"value":3155},{"type":993,"tag":1021,"props":3759,"children":3760},{"class":1023,"line":63},[3761,3766,3770,3774,3778,3782,3786,3790,3794,3799],{"type":993,"tag":1021,"props":3762,"children":3763},{"style":1056},[3764],{"type":998,"value":3765},"    'headset1'",{"type":993,"tag":1021,"props":3767,"children":3768},{"style":1036},[3769],{"type":998,"value":3118},{"type":993,"tag":1021,"props":3771,"children":3772},{"style":1056},[3773],{"type":998,"value":3590},{"type":993,"tag":1021,"props":3775,"children":3776},{"style":1036},[3777],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3779,"children":3780},{"style":1135},[3781],{"type":998,"value":3599},{"type":993,"tag":1021,"props":3783,"children":3784},{"style":1036},[3785],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3787,"children":3788},{"style":1056},[3789],{"type":998,"value":3608},{"type":993,"tag":1021,"props":3791,"children":3792},{"style":1036},[3793],{"type":998,"value":1064},{"type":993,"tag":1021,"props":3795,"children":3796},{"style":1135},[3797],{"type":998,"value":3798},"159",{"type":993,"tag":1021,"props":3800,"children":3801},{"style":1036},[3802],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3804,"children":3805},{"class":1023,"line":72},[3806],{"type":993,"tag":1021,"props":3807,"children":3808},{"style":1036},[3809],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3811,"children":3812},{"class":1023,"line":81},[3813],{"type":993,"tag":1021,"props":3814,"children":3815},{"emptyLinePlaceholder":13},[3816],{"type":998,"value":1129},{"type":993,"tag":1021,"props":3818,"children":3819},{"class":1023,"line":91},[3820,3824,3828,3832,3836,3840,3845,3850],{"type":993,"tag":1021,"props":3821,"children":3822},{"style":1135},[3823],{"type":998,"value":1138},{"type":993,"tag":1021,"props":3825,"children":3826},{"style":1036},[3827],{"type":998,"value":1143},{"type":993,"tag":1021,"props":3829,"children":3830},{"style":1056},[3831],{"type":998,"value":1438},{"type":993,"tag":1021,"props":3833,"children":3834},{"style":1036},[3835],{"type":998,"value":1253},{"type":993,"tag":1021,"props":3837,"children":3838},{"style":1135},[3839],{"type":998,"value":2946},{"type":993,"tag":1021,"props":3841,"children":3842},{"style":1036},[3843],{"type":998,"value":3844},"(product_inventory), ",{"type":993,"tag":1021,"props":3846,"children":3847},{"style":1056},[3848],{"type":998,"value":3849},"\"items\"",{"type":993,"tag":1021,"props":3851,"children":3852},{"style":1036},[3853],{"type":998,"value":1263},{"type":993,"tag":1021,"props":3855,"children":3856},{"class":1023,"line":100},[3857],{"type":993,"tag":1021,"props":3858,"children":3859},{"emptyLinePlaceholder":13},[3860],{"type":998,"value":1129},{"type":993,"tag":1021,"props":3862,"children":3863},{"class":1023,"line":109},[3864],{"type":993,"tag":1021,"props":3865,"children":3866},{"style":1027},[3867],{"type":998,"value":3868},"# Remove out-of-stock items\n",{"type":993,"tag":1021,"props":3870,"children":3871},{"class":1023,"line":118},[3872,3877,3881],{"type":993,"tag":1021,"props":3873,"children":3874},{"style":1036},[3875],{"type":998,"value":3876},"to_remove ",{"type":993,"tag":1021,"props":3878,"children":3879},{"style":1042},[3880],{"type":998,"value":1045},{"type":993,"tag":1021,"props":3882,"children":3883},{"style":1036},[3884],{"type":998,"value":3885}," [\n",{"type":993,"tag":1021,"props":3887,"children":3888},{"class":1023,"line":127},[3889,3894,3898,3903,3907],{"type":993,"tag":1021,"props":3890,"children":3891},{"style":1036},[3892],{"type":998,"value":3893},"    product_id ",{"type":993,"tag":1021,"props":3895,"children":3896},{"style":1042},[3897],{"type":998,"value":3366},{"type":993,"tag":1021,"props":3899,"children":3900},{"style":1036},[3901],{"type":998,"value":3902}," product_id, details ",{"type":993,"tag":1021,"props":3904,"children":3905},{"style":1042},[3906],{"type":998,"value":3376},{"type":993,"tag":1021,"props":3908,"children":3909},{"style":1036},[3910],{"type":998,"value":3911}," product_inventory.items()\n",{"type":993,"tag":1021,"props":3913,"children":3914},{"class":1023,"line":136},[3915,3919,3924,3928,3932,3936],{"type":993,"tag":1021,"props":3916,"children":3917},{"style":1042},[3918],{"type":998,"value":2637},{"type":993,"tag":1021,"props":3920,"children":3921},{"style":1036},[3922],{"type":998,"value":3923}," details[",{"type":993,"tag":1021,"props":3925,"children":3926},{"style":1056},[3927],{"type":998,"value":3590},{"type":993,"tag":1021,"props":3929,"children":3930},{"style":1036},[3931],{"type":998,"value":3402},{"type":993,"tag":1021,"props":3933,"children":3934},{"style":1042},[3935],{"type":998,"value":2652},{"type":993,"tag":1021,"props":3937,"children":3938},{"style":1135},[3939],{"type":998,"value":3940}," 0\n",{"type":993,"tag":1021,"props":3942,"children":3943},{"class":1023,"line":146},[3944],{"type":993,"tag":1021,"props":3945,"children":3946},{"style":1036},[3947],{"type":998,"value":1191},{"type":993,"tag":1021,"props":3949,"children":3950},{"class":1023,"line":155},[3951],{"type":993,"tag":1021,"props":3952,"children":3953},{"emptyLinePlaceholder":13},[3954],{"type":998,"value":1129},{"type":993,"tag":1021,"props":3956,"children":3957},{"class":1023,"line":164},[3958,3963,3967],{"type":993,"tag":1021,"props":3959,"children":3960},{"style":1036},[3961],{"type":998,"value":3962},"removed_items ",{"type":993,"tag":1021,"props":3964,"children":3965},{"style":1042},[3966],{"type":998,"value":1045},{"type":993,"tag":1021,"props":3968,"children":3969},{"style":1036},[3970],{"type":998,"value":3971}," {}\n",{"type":993,"tag":1021,"props":3973,"children":3974},{"class":1023,"line":173},[3975,3979,3984,3988],{"type":993,"tag":1021,"props":3976,"children":3977},{"style":1042},[3978],{"type":998,"value":3366},{"type":993,"tag":1021,"props":3980,"children":3981},{"style":1036},[3982],{"type":998,"value":3983}," product_id ",{"type":993,"tag":1021,"props":3985,"children":3986},{"style":1042},[3987],{"type":998,"value":3376},{"type":993,"tag":1021,"props":3989,"children":3990},{"style":1036},[3991],{"type":998,"value":3992}," to_remove:\n",{"type":993,"tag":1021,"props":3994,"children":3995},{"class":1023,"line":182},[3996,4001,4005],{"type":993,"tag":1021,"props":3997,"children":3998},{"style":1036},[3999],{"type":998,"value":4000},"    removed_items[product_id] ",{"type":993,"tag":1021,"props":4002,"children":4003},{"style":1042},[4004],{"type":998,"value":1045},{"type":993,"tag":1021,"props":4006,"children":4007},{"style":1036},[4008],{"type":998,"value":4009}," product_inventory.pop(product_id)\n",{"type":993,"tag":1021,"props":4011,"children":4012},{"class":1023,"line":191},[4013],{"type":993,"tag":1021,"props":4014,"children":4015},{"emptyLinePlaceholder":13},[4016],{"type":998,"value":1129},{"type":993,"tag":1021,"props":4018,"children":4019},{"class":1023,"line":201},[4020,4024,4028,4032,4037,4042,4047,4051,4056],{"type":993,"tag":1021,"props":4021,"children":4022},{"style":1135},[4023],{"type":998,"value":1138},{"type":993,"tag":1021,"props":4025,"children":4026},{"style":1036},[4027],{"type":998,"value":1143},{"type":993,"tag":1021,"props":4029,"children":4030},{"style":1042},[4031],{"type":998,"value":1832},{"type":993,"tag":1021,"props":4033,"children":4034},{"style":1056},[4035],{"type":998,"value":4036},"\"Removed ",{"type":993,"tag":1021,"props":4038,"children":4039},{"style":1135},[4040],{"type":998,"value":4041},"{len",{"type":993,"tag":1021,"props":4043,"children":4044},{"style":1036},[4045],{"type":998,"value":4046},"(removed_items)",{"type":993,"tag":1021,"props":4048,"children":4049},{"style":1135},[4050],{"type":998,"value":1852},{"type":993,"tag":1021,"props":4052,"children":4053},{"style":1056},[4054],{"type":998,"value":4055}," out-of-stock items\"",{"type":993,"tag":1021,"props":4057,"children":4058},{"style":1036},[4059],{"type":998,"value":1263},{"type":993,"tag":1021,"props":4061,"children":4062},{"class":1023,"line":210},[4063,4067,4071,4076,4080,4085],{"type":993,"tag":1021,"props":4064,"children":4065},{"style":1135},[4066],{"type":998,"value":1138},{"type":993,"tag":1021,"props":4068,"children":4069},{"style":1036},[4070],{"type":998,"value":1143},{"type":993,"tag":1021,"props":4072,"children":4073},{"style":1056},[4074],{"type":998,"value":4075},"\"Remaining inventory:\"",{"type":993,"tag":1021,"props":4077,"children":4078},{"style":1036},[4079],{"type":998,"value":1253},{"type":993,"tag":1021,"props":4081,"children":4082},{"style":1135},[4083],{"type":998,"value":4084},"list",{"type":993,"tag":1021,"props":4086,"children":4087},{"style":1036},[4088],{"type":998,"value":4089},"(product_inventory.keys()))\n",{"type":993,"tag":1306,"props":4091,"children":4093},{"id":4092},"error-safe-deletion-strategies",[4094],{"type":998,"value":4095},"💡 Error-Safe Deletion Strategies",{"type":993,"tag":1001,"props":4097,"children":4098},{},[4099],{"type":998,"value":4100},"Production applications require robust deletion mechanisms that handle edge cases and unexpected data states gracefully.",{"type":993,"tag":1592,"props":4102,"children":4104},{"id":4103},"try-catch-deletion",[4105],{"type":998,"value":4106},"Try-Catch Deletion",{"type":993,"tag":1001,"props":4108,"children":4109},{},[4110],{"type":998,"value":4111},"Exception handling provides explicit control over deletion failures and enables graceful error recovery.",{"type":993,"tag":1007,"props":4113,"children":4114},{},[4115],{"type":993,"tag":1011,"props":4116,"children":4118},{"className":1013,"code":4117,"language":6,"meta":8,"style":8},"user_data = {'username': 'alice', 'email': 'alice@example.com'}\n\n# Safe deletion with error handling\ndef safe_delete(dictionary, key):\n    try:\n        value = dictionary.pop(key)\n        print(f\"Successfully removed {key}: {value}\")\n        return True\n    except KeyError:\n        print(f\"Key '{key}' not found in dictionary\")\n        return False\n\n# Test safe deletion\nsafe_delete(user_data, 'email')  # Success\nsafe_delete(user_data, 'phone')  # Key not found\nsafe_delete(user_data, 'username')  # Success\n\nprint(\"Final user data:\", user_data)\n",[4119],{"type":993,"tag":1017,"props":4120,"children":4121},{"__ignoreMap":8},[4122,4174,4181,4189,4208,4220,4237,4296,4309,4326,4367,4379,4386,4394,4416,4437,4456,4463],{"type":993,"tag":1021,"props":4123,"children":4124},{"class":1023,"line":12},[4125,4130,4134,4138,4143,4147,4152,4156,4161,4165,4170],{"type":993,"tag":1021,"props":4126,"children":4127},{"style":1036},[4128],{"type":998,"value":4129},"user_data ",{"type":993,"tag":1021,"props":4131,"children":4132},{"style":1042},[4133],{"type":998,"value":1045},{"type":993,"tag":1021,"props":4135,"children":4136},{"style":1036},[4137],{"type":998,"value":1350},{"type":993,"tag":1021,"props":4139,"children":4140},{"style":1056},[4141],{"type":998,"value":4142},"'username'",{"type":993,"tag":1021,"props":4144,"children":4145},{"style":1036},[4146],{"type":998,"value":1064},{"type":993,"tag":1021,"props":4148,"children":4149},{"style":1056},[4150],{"type":998,"value":4151},"'alice'",{"type":993,"tag":1021,"props":4153,"children":4154},{"style":1036},[4155],{"type":998,"value":1253},{"type":993,"tag":1021,"props":4157,"children":4158},{"style":1056},[4159],{"type":998,"value":4160},"'email'",{"type":993,"tag":1021,"props":4162,"children":4163},{"style":1036},[4164],{"type":998,"value":1064},{"type":993,"tag":1021,"props":4166,"children":4167},{"style":1056},[4168],{"type":998,"value":4169},"'alice@example.com'",{"type":993,"tag":1021,"props":4171,"children":4172},{"style":1036},[4173],{"type":998,"value":1121},{"type":993,"tag":1021,"props":4175,"children":4176},{"class":1023,"line":27},[4177],{"type":993,"tag":1021,"props":4178,"children":4179},{"emptyLinePlaceholder":13},[4180],{"type":998,"value":1129},{"type":993,"tag":1021,"props":4182,"children":4183},{"class":1023,"line":36},[4184],{"type":993,"tag":1021,"props":4185,"children":4186},{"style":1027},[4187],{"type":998,"value":4188},"# Safe deletion with error handling\n",{"type":993,"tag":1021,"props":4190,"children":4191},{"class":1023,"line":45},[4192,4197,4203],{"type":993,"tag":1021,"props":4193,"children":4194},{"style":1042},[4195],{"type":998,"value":4196},"def",{"type":993,"tag":1021,"props":4198,"children":4200},{"style":4199},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[4201],{"type":998,"value":4202}," safe_delete",{"type":993,"tag":1021,"props":4204,"children":4205},{"style":1036},[4206],{"type":998,"value":4207},"(dictionary, key):\n",{"type":993,"tag":1021,"props":4209,"children":4210},{"class":1023,"line":54},[4211,4216],{"type":993,"tag":1021,"props":4212,"children":4213},{"style":1042},[4214],{"type":998,"value":4215},"    try",{"type":993,"tag":1021,"props":4217,"children":4218},{"style":1036},[4219],{"type":998,"value":3416},{"type":993,"tag":1021,"props":4221,"children":4222},{"class":1023,"line":63},[4223,4228,4232],{"type":993,"tag":1021,"props":4224,"children":4225},{"style":1036},[4226],{"type":998,"value":4227},"        value ",{"type":993,"tag":1021,"props":4229,"children":4230},{"style":1042},[4231],{"type":998,"value":1045},{"type":993,"tag":1021,"props":4233,"children":4234},{"style":1036},[4235],{"type":998,"value":4236}," dictionary.pop(key)\n",{"type":993,"tag":1021,"props":4238,"children":4239},{"class":1023,"line":72},[4240,4245,4249,4253,4258,4262,4267,4271,4275,4279,4284,4288,4292],{"type":993,"tag":1021,"props":4241,"children":4242},{"style":1135},[4243],{"type":998,"value":4244},"        print",{"type":993,"tag":1021,"props":4246,"children":4247},{"style":1036},[4248],{"type":998,"value":1143},{"type":993,"tag":1021,"props":4250,"children":4251},{"style":1042},[4252],{"type":998,"value":1832},{"type":993,"tag":1021,"props":4254,"children":4255},{"style":1056},[4256],{"type":998,"value":4257},"\"Successfully removed ",{"type":993,"tag":1021,"props":4259,"children":4260},{"style":1135},[4261],{"type":998,"value":1842},{"type":993,"tag":1021,"props":4263,"children":4264},{"style":1036},[4265],{"type":998,"value":4266},"key",{"type":993,"tag":1021,"props":4268,"children":4269},{"style":1135},[4270],{"type":998,"value":1852},{"type":993,"tag":1021,"props":4272,"children":4273},{"style":1056},[4274],{"type":998,"value":1064},{"type":993,"tag":1021,"props":4276,"children":4277},{"style":1135},[4278],{"type":998,"value":1842},{"type":993,"tag":1021,"props":4280,"children":4281},{"style":1036},[4282],{"type":998,"value":4283},"value",{"type":993,"tag":1021,"props":4285,"children":4286},{"style":1135},[4287],{"type":998,"value":1852},{"type":993,"tag":1021,"props":4289,"children":4290},{"style":1056},[4291],{"type":998,"value":1875},{"type":993,"tag":1021,"props":4293,"children":4294},{"style":1036},[4295],{"type":998,"value":1263},{"type":993,"tag":1021,"props":4297,"children":4298},{"class":1023,"line":81},[4299,4304],{"type":993,"tag":1021,"props":4300,"children":4301},{"style":1042},[4302],{"type":998,"value":4303},"        return",{"type":993,"tag":1021,"props":4305,"children":4306},{"style":1135},[4307],{"type":998,"value":4308}," True\n",{"type":993,"tag":1021,"props":4310,"children":4311},{"class":1023,"line":91},[4312,4317,4322],{"type":993,"tag":1021,"props":4313,"children":4314},{"style":1042},[4315],{"type":998,"value":4316},"    except",{"type":993,"tag":1021,"props":4318,"children":4319},{"style":1135},[4320],{"type":998,"value":4321}," KeyError",{"type":993,"tag":1021,"props":4323,"children":4324},{"style":1036},[4325],{"type":998,"value":3416},{"type":993,"tag":1021,"props":4327,"children":4328},{"class":1023,"line":100},[4329,4333,4337,4341,4346,4350,4354,4358,4363],{"type":993,"tag":1021,"props":4330,"children":4331},{"style":1135},[4332],{"type":998,"value":4244},{"type":993,"tag":1021,"props":4334,"children":4335},{"style":1036},[4336],{"type":998,"value":1143},{"type":993,"tag":1021,"props":4338,"children":4339},{"style":1042},[4340],{"type":998,"value":1832},{"type":993,"tag":1021,"props":4342,"children":4343},{"style":1056},[4344],{"type":998,"value":4345},"\"Key '",{"type":993,"tag":1021,"props":4347,"children":4348},{"style":1135},[4349],{"type":998,"value":1842},{"type":993,"tag":1021,"props":4351,"children":4352},{"style":1036},[4353],{"type":998,"value":4266},{"type":993,"tag":1021,"props":4355,"children":4356},{"style":1135},[4357],{"type":998,"value":1852},{"type":993,"tag":1021,"props":4359,"children":4360},{"style":1056},[4361],{"type":998,"value":4362},"' not found in dictionary\"",{"type":993,"tag":1021,"props":4364,"children":4365},{"style":1036},[4366],{"type":998,"value":1263},{"type":993,"tag":1021,"props":4368,"children":4369},{"class":1023,"line":109},[4370,4374],{"type":993,"tag":1021,"props":4371,"children":4372},{"style":1042},[4373],{"type":998,"value":4303},{"type":993,"tag":1021,"props":4375,"children":4376},{"style":1135},[4377],{"type":998,"value":4378}," False\n",{"type":993,"tag":1021,"props":4380,"children":4381},{"class":1023,"line":118},[4382],{"type":993,"tag":1021,"props":4383,"children":4384},{"emptyLinePlaceholder":13},[4385],{"type":998,"value":1129},{"type":993,"tag":1021,"props":4387,"children":4388},{"class":1023,"line":127},[4389],{"type":993,"tag":1021,"props":4390,"children":4391},{"style":1027},[4392],{"type":998,"value":4393},"# Test safe deletion\n",{"type":993,"tag":1021,"props":4395,"children":4396},{"class":1023,"line":136},[4397,4402,4406,4411],{"type":993,"tag":1021,"props":4398,"children":4399},{"style":1036},[4400],{"type":998,"value":4401},"safe_delete(user_data, ",{"type":993,"tag":1021,"props":4403,"children":4404},{"style":1056},[4405],{"type":998,"value":4160},{"type":993,"tag":1021,"props":4407,"children":4408},{"style":1036},[4409],{"type":998,"value":4410},")  ",{"type":993,"tag":1021,"props":4412,"children":4413},{"style":1027},[4414],{"type":998,"value":4415},"# Success\n",{"type":993,"tag":1021,"props":4417,"children":4418},{"class":1023,"line":146},[4419,4423,4428,4432],{"type":993,"tag":1021,"props":4420,"children":4421},{"style":1036},[4422],{"type":998,"value":4401},{"type":993,"tag":1021,"props":4424,"children":4425},{"style":1056},[4426],{"type":998,"value":4427},"'phone'",{"type":993,"tag":1021,"props":4429,"children":4430},{"style":1036},[4431],{"type":998,"value":4410},{"type":993,"tag":1021,"props":4433,"children":4434},{"style":1027},[4435],{"type":998,"value":4436},"# Key not found\n",{"type":993,"tag":1021,"props":4438,"children":4439},{"class":1023,"line":155},[4440,4444,4448,4452],{"type":993,"tag":1021,"props":4441,"children":4442},{"style":1036},[4443],{"type":998,"value":4401},{"type":993,"tag":1021,"props":4445,"children":4446},{"style":1056},[4447],{"type":998,"value":4142},{"type":993,"tag":1021,"props":4449,"children":4450},{"style":1036},[4451],{"type":998,"value":4410},{"type":993,"tag":1021,"props":4453,"children":4454},{"style":1027},[4455],{"type":998,"value":4415},{"type":993,"tag":1021,"props":4457,"children":4458},{"class":1023,"line":164},[4459],{"type":993,"tag":1021,"props":4460,"children":4461},{"emptyLinePlaceholder":13},[4462],{"type":998,"value":1129},{"type":993,"tag":1021,"props":4464,"children":4465},{"class":1023,"line":173},[4466,4470,4474,4479],{"type":993,"tag":1021,"props":4467,"children":4468},{"style":1135},[4469],{"type":998,"value":1138},{"type":993,"tag":1021,"props":4471,"children":4472},{"style":1036},[4473],{"type":998,"value":1143},{"type":993,"tag":1021,"props":4475,"children":4476},{"style":1056},[4477],{"type":998,"value":4478},"\"Final user data:\"",{"type":993,"tag":1021,"props":4480,"children":4481},{"style":1036},[4482],{"type":998,"value":4483},", user_data)\n",{"type":993,"tag":1592,"props":4485,"children":4487},{"id":4486},"conditional-safe-deletion",[4488],{"type":998,"value":4489},"Conditional Safe Deletion",{"type":993,"tag":1001,"props":4491,"children":4492},{},[4493],{"type":998,"value":4494},"Combining existence checking with deletion creates bulletproof removal operations.",{"type":993,"tag":1007,"props":4496,"children":4497},{},[4498],{"type":993,"tag":1011,"props":4499,"children":4501},{"className":1013,"code":4500,"language":6,"meta":8,"style":8},"def conditional_delete(data, keys_to_remove):\n    \"\"\"Safely remove multiple keys if they exist\"\"\"\n    removed = {}\n    \n    for key in keys_to_remove:\n        if key in data:\n            removed[key] = data.pop(key)\n        else:\n            print(f\"Key '{key}' not found, skipping\")\n    \n    return removed\n\nconfig = {'debug': True, 'port': 8080, 'theme': 'dark'}\nto_remove = ['debug', 'invalid_key', 'theme', 'another_invalid']\n\nremoved_config = conditional_delete(config, to_remove)\nprint(\"Removed items:\", removed_config)\nprint(\"Remaining config:\", config)\n",[4502],{"type":993,"tag":1017,"props":4503,"children":4504},{"__ignoreMap":8},[4505,4522,4530,4546,4553,4575,4596,4613,4625,4666,4673,4686,4693,4760,4810,4817,4834,4855],{"type":993,"tag":1021,"props":4506,"children":4507},{"class":1023,"line":12},[4508,4512,4517],{"type":993,"tag":1021,"props":4509,"children":4510},{"style":1042},[4511],{"type":998,"value":4196},{"type":993,"tag":1021,"props":4513,"children":4514},{"style":4199},[4515],{"type":998,"value":4516}," conditional_delete",{"type":993,"tag":1021,"props":4518,"children":4519},{"style":1036},[4520],{"type":998,"value":4521},"(data, keys_to_remove):\n",{"type":993,"tag":1021,"props":4523,"children":4524},{"class":1023,"line":27},[4525],{"type":993,"tag":1021,"props":4526,"children":4527},{"style":1056},[4528],{"type":998,"value":4529},"    \"\"\"Safely remove multiple keys if they exist\"\"\"\n",{"type":993,"tag":1021,"props":4531,"children":4532},{"class":1023,"line":36},[4533,4538,4542],{"type":993,"tag":1021,"props":4534,"children":4535},{"style":1036},[4536],{"type":998,"value":4537},"    removed ",{"type":993,"tag":1021,"props":4539,"children":4540},{"style":1042},[4541],{"type":998,"value":1045},{"type":993,"tag":1021,"props":4543,"children":4544},{"style":1036},[4545],{"type":998,"value":3971},{"type":993,"tag":1021,"props":4547,"children":4548},{"class":1023,"line":45},[4549],{"type":993,"tag":1021,"props":4550,"children":4551},{"style":1036},[4552],{"type":998,"value":2621},{"type":993,"tag":1021,"props":4554,"children":4555},{"class":1023,"line":54},[4556,4561,4566,4570],{"type":993,"tag":1021,"props":4557,"children":4558},{"style":1042},[4559],{"type":998,"value":4560},"    for",{"type":993,"tag":1021,"props":4562,"children":4563},{"style":1036},[4564],{"type":998,"value":4565}," key ",{"type":993,"tag":1021,"props":4567,"children":4568},{"style":1042},[4569],{"type":998,"value":3376},{"type":993,"tag":1021,"props":4571,"children":4572},{"style":1036},[4573],{"type":998,"value":4574}," keys_to_remove:\n",{"type":993,"tag":1021,"props":4576,"children":4577},{"class":1023,"line":63},[4578,4583,4587,4591],{"type":993,"tag":1021,"props":4579,"children":4580},{"style":1042},[4581],{"type":998,"value":4582},"        if",{"type":993,"tag":1021,"props":4584,"children":4585},{"style":1036},[4586],{"type":998,"value":4565},{"type":993,"tag":1021,"props":4588,"children":4589},{"style":1042},[4590],{"type":998,"value":3376},{"type":993,"tag":1021,"props":4592,"children":4593},{"style":1036},[4594],{"type":998,"value":4595}," data:\n",{"type":993,"tag":1021,"props":4597,"children":4598},{"class":1023,"line":72},[4599,4604,4608],{"type":993,"tag":1021,"props":4600,"children":4601},{"style":1036},[4602],{"type":998,"value":4603},"            removed[key] ",{"type":993,"tag":1021,"props":4605,"children":4606},{"style":1042},[4607],{"type":998,"value":1045},{"type":993,"tag":1021,"props":4609,"children":4610},{"style":1036},[4611],{"type":998,"value":4612}," data.pop(key)\n",{"type":993,"tag":1021,"props":4614,"children":4615},{"class":1023,"line":81},[4616,4621],{"type":993,"tag":1021,"props":4617,"children":4618},{"style":1042},[4619],{"type":998,"value":4620},"        else",{"type":993,"tag":1021,"props":4622,"children":4623},{"style":1036},[4624],{"type":998,"value":3416},{"type":993,"tag":1021,"props":4626,"children":4627},{"class":1023,"line":91},[4628,4633,4637,4641,4645,4649,4653,4657,4662],{"type":993,"tag":1021,"props":4629,"children":4630},{"style":1135},[4631],{"type":998,"value":4632},"            print",{"type":993,"tag":1021,"props":4634,"children":4635},{"style":1036},[4636],{"type":998,"value":1143},{"type":993,"tag":1021,"props":4638,"children":4639},{"style":1042},[4640],{"type":998,"value":1832},{"type":993,"tag":1021,"props":4642,"children":4643},{"style":1056},[4644],{"type":998,"value":4345},{"type":993,"tag":1021,"props":4646,"children":4647},{"style":1135},[4648],{"type":998,"value":1842},{"type":993,"tag":1021,"props":4650,"children":4651},{"style":1036},[4652],{"type":998,"value":4266},{"type":993,"tag":1021,"props":4654,"children":4655},{"style":1135},[4656],{"type":998,"value":1852},{"type":993,"tag":1021,"props":4658,"children":4659},{"style":1056},[4660],{"type":998,"value":4661},"' not found, skipping\"",{"type":993,"tag":1021,"props":4663,"children":4664},{"style":1036},[4665],{"type":998,"value":1263},{"type":993,"tag":1021,"props":4667,"children":4668},{"class":1023,"line":100},[4669],{"type":993,"tag":1021,"props":4670,"children":4671},{"style":1036},[4672],{"type":998,"value":2621},{"type":993,"tag":1021,"props":4674,"children":4675},{"class":1023,"line":109},[4676,4681],{"type":993,"tag":1021,"props":4677,"children":4678},{"style":1042},[4679],{"type":998,"value":4680},"    return",{"type":993,"tag":1021,"props":4682,"children":4683},{"style":1036},[4684],{"type":998,"value":4685}," removed\n",{"type":993,"tag":1021,"props":4687,"children":4688},{"class":1023,"line":118},[4689],{"type":993,"tag":1021,"props":4690,"children":4691},{"emptyLinePlaceholder":13},[4692],{"type":998,"value":1129},{"type":993,"tag":1021,"props":4694,"children":4695},{"class":1023,"line":127},[4696,4701,4705,4709,4714,4718,4722,4726,4731,4735,4740,4744,4748,4752,4756],{"type":993,"tag":1021,"props":4697,"children":4698},{"style":1036},[4699],{"type":998,"value":4700},"config ",{"type":993,"tag":1021,"props":4702,"children":4703},{"style":1042},[4704],{"type":998,"value":1045},{"type":993,"tag":1021,"props":4706,"children":4707},{"style":1036},[4708],{"type":998,"value":1350},{"type":993,"tag":1021,"props":4710,"children":4711},{"style":1056},[4712],{"type":998,"value":4713},"'debug'",{"type":993,"tag":1021,"props":4715,"children":4716},{"style":1036},[4717],{"type":998,"value":1064},{"type":993,"tag":1021,"props":4719,"children":4720},{"style":1135},[4721],{"type":998,"value":1666},{"type":993,"tag":1021,"props":4723,"children":4724},{"style":1036},[4725],{"type":998,"value":1253},{"type":993,"tag":1021,"props":4727,"children":4728},{"style":1056},[4729],{"type":998,"value":4730},"'port'",{"type":993,"tag":1021,"props":4732,"children":4733},{"style":1036},[4734],{"type":998,"value":1064},{"type":993,"tag":1021,"props":4736,"children":4737},{"style":1135},[4738],{"type":998,"value":4739},"8080",{"type":993,"tag":1021,"props":4741,"children":4742},{"style":1036},[4743],{"type":998,"value":1253},{"type":993,"tag":1021,"props":4745,"children":4746},{"style":1056},[4747],{"type":998,"value":1780},{"type":993,"tag":1021,"props":4749,"children":4750},{"style":1036},[4751],{"type":998,"value":1064},{"type":993,"tag":1021,"props":4753,"children":4754},{"style":1056},[4755],{"type":998,"value":1645},{"type":993,"tag":1021,"props":4757,"children":4758},{"style":1036},[4759],{"type":998,"value":1121},{"type":993,"tag":1021,"props":4761,"children":4762},{"class":1023,"line":136},[4763,4767,4771,4776,4780,4784,4789,4793,4797,4801,4806],{"type":993,"tag":1021,"props":4764,"children":4765},{"style":1036},[4766],{"type":998,"value":3876},{"type":993,"tag":1021,"props":4768,"children":4769},{"style":1042},[4770],{"type":998,"value":1045},{"type":993,"tag":1021,"props":4772,"children":4773},{"style":1036},[4774],{"type":998,"value":4775}," [",{"type":993,"tag":1021,"props":4777,"children":4778},{"style":1056},[4779],{"type":998,"value":4713},{"type":993,"tag":1021,"props":4781,"children":4782},{"style":1036},[4783],{"type":998,"value":1253},{"type":993,"tag":1021,"props":4785,"children":4786},{"style":1056},[4787],{"type":998,"value":4788},"'invalid_key'",{"type":993,"tag":1021,"props":4790,"children":4791},{"style":1036},[4792],{"type":998,"value":1253},{"type":993,"tag":1021,"props":4794,"children":4795},{"style":1056},[4796],{"type":998,"value":1780},{"type":993,"tag":1021,"props":4798,"children":4799},{"style":1036},[4800],{"type":998,"value":1253},{"type":993,"tag":1021,"props":4802,"children":4803},{"style":1056},[4804],{"type":998,"value":4805},"'another_invalid'",{"type":993,"tag":1021,"props":4807,"children":4808},{"style":1036},[4809],{"type":998,"value":1191},{"type":993,"tag":1021,"props":4811,"children":4812},{"class":1023,"line":146},[4813],{"type":993,"tag":1021,"props":4814,"children":4815},{"emptyLinePlaceholder":13},[4816],{"type":998,"value":1129},{"type":993,"tag":1021,"props":4818,"children":4819},{"class":1023,"line":155},[4820,4825,4829],{"type":993,"tag":1021,"props":4821,"children":4822},{"style":1036},[4823],{"type":998,"value":4824},"removed_config ",{"type":993,"tag":1021,"props":4826,"children":4827},{"style":1042},[4828],{"type":998,"value":1045},{"type":993,"tag":1021,"props":4830,"children":4831},{"style":1036},[4832],{"type":998,"value":4833}," conditional_delete(config, to_remove)\n",{"type":993,"tag":1021,"props":4835,"children":4836},{"class":1023,"line":164},[4837,4841,4845,4850],{"type":993,"tag":1021,"props":4838,"children":4839},{"style":1135},[4840],{"type":998,"value":1138},{"type":993,"tag":1021,"props":4842,"children":4843},{"style":1036},[4844],{"type":998,"value":1143},{"type":993,"tag":1021,"props":4846,"children":4847},{"style":1056},[4848],{"type":998,"value":4849},"\"Removed items:\"",{"type":993,"tag":1021,"props":4851,"children":4852},{"style":1036},[4853],{"type":998,"value":4854},", removed_config)\n",{"type":993,"tag":1021,"props":4856,"children":4857},{"class":1023,"line":173},[4858,4862,4866,4871],{"type":993,"tag":1021,"props":4859,"children":4860},{"style":1135},[4861],{"type":998,"value":1138},{"type":993,"tag":1021,"props":4863,"children":4864},{"style":1036},[4865],{"type":998,"value":1143},{"type":993,"tag":1021,"props":4867,"children":4868},{"style":1056},[4869],{"type":998,"value":4870},"\"Remaining config:\"",{"type":993,"tag":1021,"props":4872,"children":4873},{"style":1036},[4874],{"type":998,"value":4875},", config)\n",{"type":993,"tag":1526,"props":4877,"children":4881},{"emoji":4878,"title":4879,"type":4880},"✅","Best Practices","success",[4882,4892,4902,4912],{"type":993,"tag":1001,"props":4883,"children":4884},{},[4885,4890],{"type":993,"tag":1536,"props":4886,"children":4887},{},[4888],{"type":998,"value":4889},"Choose Right Method:",{"type":998,"value":4891}," Use pop() for safe removal with value retrieval, del for known keys.",{"type":993,"tag":1001,"props":4893,"children":4894},{},[4895,4900],{"type":993,"tag":1536,"props":4896,"children":4897},{},[4898],{"type":998,"value":4899},"Handle Missing Keys:",{"type":998,"value":4901}," Always consider what happens when keys don't exist.",{"type":993,"tag":1001,"props":4903,"children":4904},{},[4905,4910],{"type":993,"tag":1536,"props":4906,"children":4907},{},[4908],{"type":998,"value":4909},"Batch Operations:",{"type":998,"value":4911}," Collect keys first, then delete to avoid iteration errors.",{"type":993,"tag":1001,"props":4913,"children":4914},{},[4915,4920],{"type":993,"tag":1536,"props":4916,"children":4917},{},[4918],{"type":998,"value":4919},"Error Recovery:",{"type":998,"value":4921}," Implement appropriate error handling for production applications.",{"type":993,"tag":4923,"props":4924,"children":4926},"content-exercise",{":widget-view":4925,"category":6,"id":565},"true",[],{"type":993,"tag":4928,"props":4929,"children":4932},"exercise",{"hint":4930,"prompt":4931},"Use the pop() method with a default value to safely remove dictionary items","Create a function that removes items from a shopping cart. Use pop() to safely remove items and return the removed quantity, or 0 if the item wasn't in the cart.",[4933],{"type":993,"tag":1011,"props":4934,"children":4936},{"className":1013,"code":4935,"language":6,"meta":8,"style":8},"def remove_from_cart(cart, item):\n    # TODO: Remove item from cart and return the quantity that was removed\n    # TODO: Return 0 if item wasn't in the cart\n    pass\n\n# Test the function\nshopping_cart = {'apples': 5, 'bananas': 3, 'oranges': 2}\n\nremoved_apples = remove_from_cart(shopping_cart, 'apples')\nremoved_grapes = remove_from_cart(shopping_cart, 'grapes')  # Not in cart\n\nprint(f\"Removed {removed_apples} apples\")\nprint(f\"Removed {removed_grapes} grapes\")\nprint(\"Cart now:\", shopping_cart)\n",[4937],{"type":993,"tag":1017,"props":4938,"children":4939},{"__ignoreMap":8},[4940,4957,4975,4991,4999,5006,5014,5080,5087,5112,5141,5148,5189,5230],{"type":993,"tag":1021,"props":4941,"children":4942},{"class":1023,"line":12},[4943,4947,4952],{"type":993,"tag":1021,"props":4944,"children":4945},{"style":1042},[4946],{"type":998,"value":4196},{"type":993,"tag":1021,"props":4948,"children":4949},{"style":4199},[4950],{"type":998,"value":4951}," remove_from_cart",{"type":993,"tag":1021,"props":4953,"children":4954},{"style":1036},[4955],{"type":998,"value":4956},"(cart, item):\n",{"type":993,"tag":1021,"props":4958,"children":4959},{"class":1023,"line":27},[4960,4965,4970],{"type":993,"tag":1021,"props":4961,"children":4962},{"style":1027},[4963],{"type":998,"value":4964},"    # ",{"type":993,"tag":1021,"props":4966,"children":4967},{"style":1042},[4968],{"type":998,"value":4969},"TODO",{"type":993,"tag":1021,"props":4971,"children":4972},{"style":1027},[4973],{"type":998,"value":4974},": Remove item from cart and return the quantity that was removed\n",{"type":993,"tag":1021,"props":4976,"children":4977},{"class":1023,"line":36},[4978,4982,4986],{"type":993,"tag":1021,"props":4979,"children":4980},{"style":1027},[4981],{"type":998,"value":4964},{"type":993,"tag":1021,"props":4983,"children":4984},{"style":1042},[4985],{"type":998,"value":4969},{"type":993,"tag":1021,"props":4987,"children":4988},{"style":1027},[4989],{"type":998,"value":4990},": Return 0 if item wasn't in the cart\n",{"type":993,"tag":1021,"props":4992,"children":4993},{"class":1023,"line":45},[4994],{"type":993,"tag":1021,"props":4995,"children":4996},{"style":1042},[4997],{"type":998,"value":4998},"    pass\n",{"type":993,"tag":1021,"props":5000,"children":5001},{"class":1023,"line":54},[5002],{"type":993,"tag":1021,"props":5003,"children":5004},{"emptyLinePlaceholder":13},[5005],{"type":998,"value":1129},{"type":993,"tag":1021,"props":5007,"children":5008},{"class":1023,"line":63},[5009],{"type":993,"tag":1021,"props":5010,"children":5011},{"style":1027},[5012],{"type":998,"value":5013},"# Test the function\n",{"type":993,"tag":1021,"props":5015,"children":5016},{"class":1023,"line":72},[5017,5022,5026,5030,5034,5038,5042,5046,5050,5054,5059,5063,5067,5071,5076],{"type":993,"tag":1021,"props":5018,"children":5019},{"style":1036},[5020],{"type":998,"value":5021},"shopping_cart ",{"type":993,"tag":1021,"props":5023,"children":5024},{"style":1042},[5025],{"type":998,"value":1045},{"type":993,"tag":1021,"props":5027,"children":5028},{"style":1036},[5029],{"type":998,"value":1350},{"type":993,"tag":1021,"props":5031,"children":5032},{"style":1056},[5033],{"type":998,"value":1355},{"type":993,"tag":1021,"props":5035,"children":5036},{"style":1036},[5037],{"type":998,"value":1064},{"type":993,"tag":1021,"props":5039,"children":5040},{"style":1135},[5041],{"type":998,"value":3736},{"type":993,"tag":1021,"props":5043,"children":5044},{"style":1036},[5045],{"type":998,"value":1253},{"type":993,"tag":1021,"props":5047,"children":5048},{"style":1056},[5049],{"type":998,"value":1373},{"type":993,"tag":1021,"props":5051,"children":5052},{"style":1036},[5053],{"type":998,"value":1064},{"type":993,"tag":1021,"props":5055,"children":5056},{"style":1135},[5057],{"type":998,"value":5058},"3",{"type":993,"tag":1021,"props":5060,"children":5061},{"style":1036},[5062],{"type":998,"value":1253},{"type":993,"tag":1021,"props":5064,"children":5065},{"style":1056},[5066],{"type":998,"value":1391},{"type":993,"tag":1021,"props":5068,"children":5069},{"style":1036},[5070],{"type":998,"value":1064},{"type":993,"tag":1021,"props":5072,"children":5073},{"style":1135},[5074],{"type":998,"value":5075},"2",{"type":993,"tag":1021,"props":5077,"children":5078},{"style":1036},[5079],{"type":998,"value":1121},{"type":993,"tag":1021,"props":5081,"children":5082},{"class":1023,"line":81},[5083],{"type":993,"tag":1021,"props":5084,"children":5085},{"emptyLinePlaceholder":13},[5086],{"type":998,"value":1129},{"type":993,"tag":1021,"props":5088,"children":5089},{"class":1023,"line":91},[5090,5095,5099,5104,5108],{"type":993,"tag":1021,"props":5091,"children":5092},{"style":1036},[5093],{"type":998,"value":5094},"removed_apples ",{"type":993,"tag":1021,"props":5096,"children":5097},{"style":1042},[5098],{"type":998,"value":1045},{"type":993,"tag":1021,"props":5100,"children":5101},{"style":1036},[5102],{"type":998,"value":5103}," remove_from_cart(shopping_cart, ",{"type":993,"tag":1021,"props":5105,"children":5106},{"style":1056},[5107],{"type":998,"value":1355},{"type":993,"tag":1021,"props":5109,"children":5110},{"style":1036},[5111],{"type":998,"value":1263},{"type":993,"tag":1021,"props":5113,"children":5114},{"class":1023,"line":100},[5115,5120,5124,5128,5132,5136],{"type":993,"tag":1021,"props":5116,"children":5117},{"style":1036},[5118],{"type":998,"value":5119},"removed_grapes ",{"type":993,"tag":1021,"props":5121,"children":5122},{"style":1042},[5123],{"type":998,"value":1045},{"type":993,"tag":1021,"props":5125,"children":5126},{"style":1036},[5127],{"type":998,"value":5103},{"type":993,"tag":1021,"props":5129,"children":5130},{"style":1056},[5131],{"type":998,"value":1409},{"type":993,"tag":1021,"props":5133,"children":5134},{"style":1036},[5135],{"type":998,"value":4410},{"type":993,"tag":1021,"props":5137,"children":5138},{"style":1027},[5139],{"type":998,"value":5140},"# Not in cart\n",{"type":993,"tag":1021,"props":5142,"children":5143},{"class":1023,"line":109},[5144],{"type":993,"tag":1021,"props":5145,"children":5146},{"emptyLinePlaceholder":13},[5147],{"type":998,"value":1129},{"type":993,"tag":1021,"props":5149,"children":5150},{"class":1023,"line":118},[5151,5155,5159,5163,5167,5171,5176,5180,5185],{"type":993,"tag":1021,"props":5152,"children":5153},{"style":1135},[5154],{"type":998,"value":1138},{"type":993,"tag":1021,"props":5156,"children":5157},{"style":1036},[5158],{"type":998,"value":1143},{"type":993,"tag":1021,"props":5160,"children":5161},{"style":1042},[5162],{"type":998,"value":1832},{"type":993,"tag":1021,"props":5164,"children":5165},{"style":1056},[5166],{"type":998,"value":4036},{"type":993,"tag":1021,"props":5168,"children":5169},{"style":1135},[5170],{"type":998,"value":1842},{"type":993,"tag":1021,"props":5172,"children":5173},{"style":1036},[5174],{"type":998,"value":5175},"removed_apples",{"type":993,"tag":1021,"props":5177,"children":5178},{"style":1135},[5179],{"type":998,"value":1852},{"type":993,"tag":1021,"props":5181,"children":5182},{"style":1056},[5183],{"type":998,"value":5184}," apples\"",{"type":993,"tag":1021,"props":5186,"children":5187},{"style":1036},[5188],{"type":998,"value":1263},{"type":993,"tag":1021,"props":5190,"children":5191},{"class":1023,"line":127},[5192,5196,5200,5204,5208,5212,5217,5221,5226],{"type":993,"tag":1021,"props":5193,"children":5194},{"style":1135},[5195],{"type":998,"value":1138},{"type":993,"tag":1021,"props":5197,"children":5198},{"style":1036},[5199],{"type":998,"value":1143},{"type":993,"tag":1021,"props":5201,"children":5202},{"style":1042},[5203],{"type":998,"value":1832},{"type":993,"tag":1021,"props":5205,"children":5206},{"style":1056},[5207],{"type":998,"value":4036},{"type":993,"tag":1021,"props":5209,"children":5210},{"style":1135},[5211],{"type":998,"value":1842},{"type":993,"tag":1021,"props":5213,"children":5214},{"style":1036},[5215],{"type":998,"value":5216},"removed_grapes",{"type":993,"tag":1021,"props":5218,"children":5219},{"style":1135},[5220],{"type":998,"value":1852},{"type":993,"tag":1021,"props":5222,"children":5223},{"style":1056},[5224],{"type":998,"value":5225}," grapes\"",{"type":993,"tag":1021,"props":5227,"children":5228},{"style":1036},[5229],{"type":998,"value":1263},{"type":993,"tag":1021,"props":5231,"children":5232},{"class":1023,"line":136},[5233,5237,5241,5246],{"type":993,"tag":1021,"props":5234,"children":5235},{"style":1135},[5236],{"type":998,"value":1138},{"type":993,"tag":1021,"props":5238,"children":5239},{"style":1036},[5240],{"type":998,"value":1143},{"type":993,"tag":1021,"props":5242,"children":5243},{"style":1056},[5244],{"type":998,"value":5245},"\"Cart now:\"",{"type":993,"tag":1021,"props":5247,"children":5248},{"style":1036},[5249],{"type":998,"value":5250},", shopping_cart)\n",{"type":993,"tag":1592,"props":5252,"children":5254},{"id":5253},"solution-and-explanation",[5255],{"type":998,"value":5256},"Solution and Explanation 💡",{"type":993,"tag":5258,"props":5259,"children":5260},"details",{},[5261,5269,5577,5585],{"type":993,"tag":5262,"props":5263,"children":5266},"summary",{"className":5264},[5265],"cursor-pointer",[5267],{"type":998,"value":5268},"Click to see the complete solution",{"type":993,"tag":1007,"props":5270,"children":5271},{},[5272],{"type":993,"tag":1011,"props":5273,"children":5275},{"className":1013,"code":5274,"language":6,"meta":8,"style":8},"def remove_from_cart(cart, item):\n    # Use pop() with default value to safely remove item\n    removed_quantity = cart.pop(item, 0)\n    return removed_quantity\n\n# Test the function\nshopping_cart = {'apples': 5, 'bananas': 3, 'oranges': 2}\n\nremoved_apples = remove_from_cart(shopping_cart, 'apples')\nremoved_grapes = remove_from_cart(shopping_cart, 'grapes')  # Not in cart\n\nprint(f\"Removed {removed_apples} apples\")\nprint(f\"Removed {removed_grapes} grapes\")\nprint(\"Cart now:\", shopping_cart)\n",[5276],{"type":993,"tag":1017,"props":5277,"children":5278},{"__ignoreMap":8},[5279,5294,5302,5327,5339,5346,5353,5416,5423,5446,5473,5480,5519,5558],{"type":993,"tag":1021,"props":5280,"children":5281},{"class":1023,"line":12},[5282,5286,5290],{"type":993,"tag":1021,"props":5283,"children":5284},{"style":1042},[5285],{"type":998,"value":4196},{"type":993,"tag":1021,"props":5287,"children":5288},{"style":4199},[5289],{"type":998,"value":4951},{"type":993,"tag":1021,"props":5291,"children":5292},{"style":1036},[5293],{"type":998,"value":4956},{"type":993,"tag":1021,"props":5295,"children":5296},{"class":1023,"line":27},[5297],{"type":993,"tag":1021,"props":5298,"children":5299},{"style":1027},[5300],{"type":998,"value":5301},"    # Use pop() with default value to safely remove item\n",{"type":993,"tag":1021,"props":5303,"children":5304},{"class":1023,"line":36},[5305,5310,5314,5319,5323],{"type":993,"tag":1021,"props":5306,"children":5307},{"style":1036},[5308],{"type":998,"value":5309},"    removed_quantity ",{"type":993,"tag":1021,"props":5311,"children":5312},{"style":1042},[5313],{"type":998,"value":1045},{"type":993,"tag":1021,"props":5315,"children":5316},{"style":1036},[5317],{"type":998,"value":5318}," cart.pop(item, ",{"type":993,"tag":1021,"props":5320,"children":5321},{"style":1135},[5322],{"type":998,"value":3599},{"type":993,"tag":1021,"props":5324,"children":5325},{"style":1036},[5326],{"type":998,"value":1263},{"type":993,"tag":1021,"props":5328,"children":5329},{"class":1023,"line":45},[5330,5334],{"type":993,"tag":1021,"props":5331,"children":5332},{"style":1042},[5333],{"type":998,"value":4680},{"type":993,"tag":1021,"props":5335,"children":5336},{"style":1036},[5337],{"type":998,"value":5338}," removed_quantity\n",{"type":993,"tag":1021,"props":5340,"children":5341},{"class":1023,"line":54},[5342],{"type":993,"tag":1021,"props":5343,"children":5344},{"emptyLinePlaceholder":13},[5345],{"type":998,"value":1129},{"type":993,"tag":1021,"props":5347,"children":5348},{"class":1023,"line":63},[5349],{"type":993,"tag":1021,"props":5350,"children":5351},{"style":1027},[5352],{"type":998,"value":5013},{"type":993,"tag":1021,"props":5354,"children":5355},{"class":1023,"line":72},[5356,5360,5364,5368,5372,5376,5380,5384,5388,5392,5396,5400,5404,5408,5412],{"type":993,"tag":1021,"props":5357,"children":5358},{"style":1036},[5359],{"type":998,"value":5021},{"type":993,"tag":1021,"props":5361,"children":5362},{"style":1042},[5363],{"type":998,"value":1045},{"type":993,"tag":1021,"props":5365,"children":5366},{"style":1036},[5367],{"type":998,"value":1350},{"type":993,"tag":1021,"props":5369,"children":5370},{"style":1056},[5371],{"type":998,"value":1355},{"type":993,"tag":1021,"props":5373,"children":5374},{"style":1036},[5375],{"type":998,"value":1064},{"type":993,"tag":1021,"props":5377,"children":5378},{"style":1135},[5379],{"type":998,"value":3736},{"type":993,"tag":1021,"props":5381,"children":5382},{"style":1036},[5383],{"type":998,"value":1253},{"type":993,"tag":1021,"props":5385,"children":5386},{"style":1056},[5387],{"type":998,"value":1373},{"type":993,"tag":1021,"props":5389,"children":5390},{"style":1036},[5391],{"type":998,"value":1064},{"type":993,"tag":1021,"props":5393,"children":5394},{"style":1135},[5395],{"type":998,"value":5058},{"type":993,"tag":1021,"props":5397,"children":5398},{"style":1036},[5399],{"type":998,"value":1253},{"type":993,"tag":1021,"props":5401,"children":5402},{"style":1056},[5403],{"type":998,"value":1391},{"type":993,"tag":1021,"props":5405,"children":5406},{"style":1036},[5407],{"type":998,"value":1064},{"type":993,"tag":1021,"props":5409,"children":5410},{"style":1135},[5411],{"type":998,"value":5075},{"type":993,"tag":1021,"props":5413,"children":5414},{"style":1036},[5415],{"type":998,"value":1121},{"type":993,"tag":1021,"props":5417,"children":5418},{"class":1023,"line":81},[5419],{"type":993,"tag":1021,"props":5420,"children":5421},{"emptyLinePlaceholder":13},[5422],{"type":998,"value":1129},{"type":993,"tag":1021,"props":5424,"children":5425},{"class":1023,"line":91},[5426,5430,5434,5438,5442],{"type":993,"tag":1021,"props":5427,"children":5428},{"style":1036},[5429],{"type":998,"value":5094},{"type":993,"tag":1021,"props":5431,"children":5432},{"style":1042},[5433],{"type":998,"value":1045},{"type":993,"tag":1021,"props":5435,"children":5436},{"style":1036},[5437],{"type":998,"value":5103},{"type":993,"tag":1021,"props":5439,"children":5440},{"style":1056},[5441],{"type":998,"value":1355},{"type":993,"tag":1021,"props":5443,"children":5444},{"style":1036},[5445],{"type":998,"value":1263},{"type":993,"tag":1021,"props":5447,"children":5448},{"class":1023,"line":100},[5449,5453,5457,5461,5465,5469],{"type":993,"tag":1021,"props":5450,"children":5451},{"style":1036},[5452],{"type":998,"value":5119},{"type":993,"tag":1021,"props":5454,"children":5455},{"style":1042},[5456],{"type":998,"value":1045},{"type":993,"tag":1021,"props":5458,"children":5459},{"style":1036},[5460],{"type":998,"value":5103},{"type":993,"tag":1021,"props":5462,"children":5463},{"style":1056},[5464],{"type":998,"value":1409},{"type":993,"tag":1021,"props":5466,"children":5467},{"style":1036},[5468],{"type":998,"value":4410},{"type":993,"tag":1021,"props":5470,"children":5471},{"style":1027},[5472],{"type":998,"value":5140},{"type":993,"tag":1021,"props":5474,"children":5475},{"class":1023,"line":109},[5476],{"type":993,"tag":1021,"props":5477,"children":5478},{"emptyLinePlaceholder":13},[5479],{"type":998,"value":1129},{"type":993,"tag":1021,"props":5481,"children":5482},{"class":1023,"line":118},[5483,5487,5491,5495,5499,5503,5507,5511,5515],{"type":993,"tag":1021,"props":5484,"children":5485},{"style":1135},[5486],{"type":998,"value":1138},{"type":993,"tag":1021,"props":5488,"children":5489},{"style":1036},[5490],{"type":998,"value":1143},{"type":993,"tag":1021,"props":5492,"children":5493},{"style":1042},[5494],{"type":998,"value":1832},{"type":993,"tag":1021,"props":5496,"children":5497},{"style":1056},[5498],{"type":998,"value":4036},{"type":993,"tag":1021,"props":5500,"children":5501},{"style":1135},[5502],{"type":998,"value":1842},{"type":993,"tag":1021,"props":5504,"children":5505},{"style":1036},[5506],{"type":998,"value":5175},{"type":993,"tag":1021,"props":5508,"children":5509},{"style":1135},[5510],{"type":998,"value":1852},{"type":993,"tag":1021,"props":5512,"children":5513},{"style":1056},[5514],{"type":998,"value":5184},{"type":993,"tag":1021,"props":5516,"children":5517},{"style":1036},[5518],{"type":998,"value":1263},{"type":993,"tag":1021,"props":5520,"children":5521},{"class":1023,"line":127},[5522,5526,5530,5534,5538,5542,5546,5550,5554],{"type":993,"tag":1021,"props":5523,"children":5524},{"style":1135},[5525],{"type":998,"value":1138},{"type":993,"tag":1021,"props":5527,"children":5528},{"style":1036},[5529],{"type":998,"value":1143},{"type":993,"tag":1021,"props":5531,"children":5532},{"style":1042},[5533],{"type":998,"value":1832},{"type":993,"tag":1021,"props":5535,"children":5536},{"style":1056},[5537],{"type":998,"value":4036},{"type":993,"tag":1021,"props":5539,"children":5540},{"style":1135},[5541],{"type":998,"value":1842},{"type":993,"tag":1021,"props":5543,"children":5544},{"style":1036},[5545],{"type":998,"value":5216},{"type":993,"tag":1021,"props":5547,"children":5548},{"style":1135},[5549],{"type":998,"value":1852},{"type":993,"tag":1021,"props":5551,"children":5552},{"style":1056},[5553],{"type":998,"value":5225},{"type":993,"tag":1021,"props":5555,"children":5556},{"style":1036},[5557],{"type":998,"value":1263},{"type":993,"tag":1021,"props":5559,"children":5560},{"class":1023,"line":136},[5561,5565,5569,5573],{"type":993,"tag":1021,"props":5562,"children":5563},{"style":1135},[5564],{"type":998,"value":1138},{"type":993,"tag":1021,"props":5566,"children":5567},{"style":1036},[5568],{"type":998,"value":1143},{"type":993,"tag":1021,"props":5570,"children":5571},{"style":1056},[5572],{"type":998,"value":5245},{"type":993,"tag":1021,"props":5574,"children":5575},{"style":1036},[5576],{"type":998,"value":5250},{"type":993,"tag":1001,"props":5578,"children":5579},{},[5580],{"type":993,"tag":1536,"props":5581,"children":5582},{},[5583],{"type":998,"value":5584},"Key Learning Points:",{"type":993,"tag":5586,"props":5587,"children":5588},"ul",{},[5589,5610,5621,5632],{"type":993,"tag":5590,"props":5591,"children":5592},"li",{},[5593,5595,5600,5602,5608],{"type":998,"value":5594},"📌 ",{"type":993,"tag":1536,"props":5596,"children":5597},{},[5598],{"type":998,"value":5599},"pop() with default",{"type":998,"value":5601},": Use ",{"type":993,"tag":1017,"props":5603,"children":5605},{"className":5604},[],[5606],{"type":998,"value":5607},"pop(key, default)",{"type":998,"value":5609}," to safely remove items without errors",{"type":993,"tag":5590,"props":5611,"children":5612},{},[5613,5614,5619],{"type":998,"value":5594},{"type":993,"tag":1536,"props":5615,"children":5616},{},[5617],{"type":998,"value":5618},"Return values",{"type":998,"value":5620},": pop() returns the removed value or the default if key doesn't exist",{"type":993,"tag":5590,"props":5622,"children":5623},{},[5624,5625,5630],{"type":998,"value":5594},{"type":993,"tag":1536,"props":5626,"children":5627},{},[5628],{"type":998,"value":5629},"Safe removal",{"type":998,"value":5631},": Avoid KeyError exceptions when removing potentially missing keys",{"type":993,"tag":5590,"props":5633,"children":5634},{},[5635,5636,5641],{"type":998,"value":5594},{"type":993,"tag":1536,"props":5637,"children":5638},{},[5639],{"type":998,"value":5640},"Function returns",{"type":998,"value":5642},": Return meaningful values from functions for user feedback",{"type":993,"tag":1001,"props":5644,"children":5645},{},[5646,5648,5654],{"type":998,"value":5647},"Learn more about ",{"type":993,"tag":5649,"props":5650,"children":5651},"a",{"href":571},[5652],{"type":998,"value":5653},"looping dictionaries",{"type":998,"value":5655}," to master iterating through dictionary data for processing and analysis.",{"type":993,"tag":1306,"props":5657,"children":5659},{"id":5658},"test-your-knowledge",[5660],{"type":998,"value":5661},"Test Your Knowledge",{"type":993,"tag":1001,"props":5663,"children":5664},{},[5665],{"type":998,"value":5666},"Test what you've learned about deleting dictionary items:",{"type":993,"tag":5668,"props":5669,"children":5673},"redirect-button",{"icon":5670,"label":5671,"url":5672},"pi pi-send","Take Quiz","/tutorial-quiz/python/deleting-dictionary-items",[],{"type":993,"tag":1306,"props":5675,"children":5677},{"id":5676},"whats-next",[5678],{"type":998,"value":5679},"What's Next?",{"type":993,"tag":1001,"props":5681,"children":5682},{},[5683],{"type":998,"value":5684},"Now that you can safely remove dictionary items, you're ready to learn how to iterate through dictionaries efficiently. Understanding loop patterns is essential for processing and analyzing dictionary data.",{"type":993,"tag":1001,"props":5686,"children":5687},{},[5688,5690,5694],{"type":998,"value":5689},"Ready to continue? Check out our lesson on ",{"type":993,"tag":5649,"props":5691,"children":5692},{"href":571},[5693],{"type":998,"value":572},{"type":998,"value":5695},".",{"type":993,"tag":5697,"props":5698,"children":5699},"style",{},[5700],{"type":998,"value":5701},"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":5703},[5704,5705,5709,5710,5711,5712,5716,5721,5722],{"id":1308,"depth":27,"text":1311},{"id":1575,"depth":27,"text":1578,"children":5706},[5707,5708],{"id":1594,"depth":36,"text":1597},{"id":1902,"depth":36,"text":1905},{"id":2177,"depth":27,"text":2180},{"id":2353,"depth":27,"text":2356},{"id":2751,"depth":27,"text":2754},{"id":3060,"depth":27,"text":3063,"children":5713},[5714,5715],{"id":3071,"depth":36,"text":3074},{"id":3539,"depth":36,"text":3542},{"id":4092,"depth":27,"text":4095,"children":5717},[5718,5719,5720],{"id":4103,"depth":36,"text":4106},{"id":4486,"depth":36,"text":4489},{"id":5253,"depth":36,"text":5256},{"id":5658,"depth":27,"text":5661},{"id":5676,"depth":27,"text":5679},1782373743194]