[{"data":1,"prerenderedAt":4323},["ShallowReactive",2],{"tutorials-python":3,"category-items-python":987,"content-/python/removing-from-sets":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},"/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",[479],{"_path":480,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":481,"description":482,"slug":483,"parentId":443,"order":484,"body":989,"_type":15,"_id":485,"_source":17,"_file":486,"_stem":487,"_extension":20},{"type":990,"children":991,"toc":4303},"root",[992,1000,1006,1167,1174,1187,1315,1359,1365,1377,1539,1545,1557,1721,1764,1770,1782,1935,1941,1946,1953,1965,2183,2189,2194,2431,2437,2579,2585,2591,2596,2903,2909,2914,3154,3160,3165,3453,3526,3531,3551,3826,3832,4251,4257,4262,4269,4275,4286,4297],{"type":993,"tag":994,"props":995,"children":996},"element","h1",{"id":483},[997],{"type":998,"value":999},"text","➖ Removing from Sets",{"type":993,"tag":1001,"props":1002,"children":1003},"p",{},[1004],{"type":998,"value":1005},"Sets in Python provide several methods to remove elements, each with different behaviors and use cases. Understanding these methods helps you choose the right approach for your specific situation.",{"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","# Basic set removal example\ncolors = {'red', 'blue', 'green', 'yellow'}\nprint(\"Original set:\", colors)\n\n# Remove an element\ncolors.remove('blue')\nprint(\"After removing blue:\", colors)\n",[1016],{"type":993,"tag":1017,"props":1018,"children":1019},"code",{"__ignoreMap":8},[1020,1031,1090,1114,1122,1130,1147],{"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},"# Basic set removal example\n",{"type":993,"tag":1021,"props":1032,"children":1033},{"class":1023,"line":27},[1034,1040,1046,1051,1057,1062,1067,1071,1076,1080,1085],{"type":993,"tag":1021,"props":1035,"children":1037},{"style":1036},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[1038],{"type":998,"value":1039},"colors ",{"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}," {",{"type":993,"tag":1021,"props":1052,"children":1054},{"style":1053},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[1055],{"type":998,"value":1056},"'red'",{"type":993,"tag":1021,"props":1058,"children":1059},{"style":1036},[1060],{"type":998,"value":1061},", ",{"type":993,"tag":1021,"props":1063,"children":1064},{"style":1053},[1065],{"type":998,"value":1066},"'blue'",{"type":993,"tag":1021,"props":1068,"children":1069},{"style":1036},[1070],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1072,"children":1073},{"style":1053},[1074],{"type":998,"value":1075},"'green'",{"type":993,"tag":1021,"props":1077,"children":1078},{"style":1036},[1079],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1081,"children":1082},{"style":1053},[1083],{"type":998,"value":1084},"'yellow'",{"type":993,"tag":1021,"props":1086,"children":1087},{"style":1036},[1088],{"type":998,"value":1089},"}\n",{"type":993,"tag":1021,"props":1091,"children":1092},{"class":1023,"line":36},[1093,1099,1104,1109],{"type":993,"tag":1021,"props":1094,"children":1096},{"style":1095},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[1097],{"type":998,"value":1098},"print",{"type":993,"tag":1021,"props":1100,"children":1101},{"style":1036},[1102],{"type":998,"value":1103},"(",{"type":993,"tag":1021,"props":1105,"children":1106},{"style":1053},[1107],{"type":998,"value":1108},"\"Original set:\"",{"type":993,"tag":1021,"props":1110,"children":1111},{"style":1036},[1112],{"type":998,"value":1113},", colors)\n",{"type":993,"tag":1021,"props":1115,"children":1116},{"class":1023,"line":45},[1117],{"type":993,"tag":1021,"props":1118,"children":1119},{"emptyLinePlaceholder":13},[1120],{"type":998,"value":1121},"\n",{"type":993,"tag":1021,"props":1123,"children":1124},{"class":1023,"line":54},[1125],{"type":993,"tag":1021,"props":1126,"children":1127},{"style":1027},[1128],{"type":998,"value":1129},"# Remove an element\n",{"type":993,"tag":1021,"props":1131,"children":1132},{"class":1023,"line":63},[1133,1138,1142],{"type":993,"tag":1021,"props":1134,"children":1135},{"style":1036},[1136],{"type":998,"value":1137},"colors.remove(",{"type":993,"tag":1021,"props":1139,"children":1140},{"style":1053},[1141],{"type":998,"value":1066},{"type":993,"tag":1021,"props":1143,"children":1144},{"style":1036},[1145],{"type":998,"value":1146},")\n",{"type":993,"tag":1021,"props":1148,"children":1149},{"class":1023,"line":72},[1150,1154,1158,1163],{"type":993,"tag":1021,"props":1151,"children":1152},{"style":1095},[1153],{"type":998,"value":1098},{"type":993,"tag":1021,"props":1155,"children":1156},{"style":1036},[1157],{"type":998,"value":1103},{"type":993,"tag":1021,"props":1159,"children":1160},{"style":1053},[1161],{"type":998,"value":1162},"\"After removing blue:\"",{"type":993,"tag":1021,"props":1164,"children":1165},{"style":1036},[1166],{"type":998,"value":1113},{"type":993,"tag":1168,"props":1169,"children":1171},"h2",{"id":1170},"the-remove-method",[1172],{"type":998,"value":1173},"🎯 The remove() Method",{"type":993,"tag":1001,"props":1175,"children":1176},{},[1177,1179,1185],{"type":998,"value":1178},"The ",{"type":993,"tag":1017,"props":1180,"children":1182},{"className":1181},[],[1183],{"type":998,"value":1184},"remove()",{"type":998,"value":1186}," method deletes a specific element from the set. This method is strict and requires the element to exist in the set.",{"type":993,"tag":1007,"props":1188,"children":1189},{},[1190],{"type":993,"tag":1011,"props":1191,"children":1193},{"className":1013,"code":1192,"language":6,"meta":8,"style":8},"fruits = {'apple', 'banana', 'orange'}\n\n# Remove an existing element\nfruits.remove('banana')\nprint(\"After removing banana:\", fruits)\n\n# This would cause an error:\n# fruits.remove('grape')  # KeyError!\n",[1194],{"type":993,"tag":1017,"props":1195,"children":1196},{"__ignoreMap":8},[1197,1240,1247,1255,1271,1292,1299,1307],{"type":993,"tag":1021,"props":1198,"children":1199},{"class":1023,"line":12},[1200,1205,1209,1213,1218,1222,1227,1231,1236],{"type":993,"tag":1021,"props":1201,"children":1202},{"style":1036},[1203],{"type":998,"value":1204},"fruits ",{"type":993,"tag":1021,"props":1206,"children":1207},{"style":1042},[1208],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1210,"children":1211},{"style":1036},[1212],{"type":998,"value":1050},{"type":993,"tag":1021,"props":1214,"children":1215},{"style":1053},[1216],{"type":998,"value":1217},"'apple'",{"type":993,"tag":1021,"props":1219,"children":1220},{"style":1036},[1221],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1223,"children":1224},{"style":1053},[1225],{"type":998,"value":1226},"'banana'",{"type":993,"tag":1021,"props":1228,"children":1229},{"style":1036},[1230],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1232,"children":1233},{"style":1053},[1234],{"type":998,"value":1235},"'orange'",{"type":993,"tag":1021,"props":1237,"children":1238},{"style":1036},[1239],{"type":998,"value":1089},{"type":993,"tag":1021,"props":1241,"children":1242},{"class":1023,"line":27},[1243],{"type":993,"tag":1021,"props":1244,"children":1245},{"emptyLinePlaceholder":13},[1246],{"type":998,"value":1121},{"type":993,"tag":1021,"props":1248,"children":1249},{"class":1023,"line":36},[1250],{"type":993,"tag":1021,"props":1251,"children":1252},{"style":1027},[1253],{"type":998,"value":1254},"# Remove an existing element\n",{"type":993,"tag":1021,"props":1256,"children":1257},{"class":1023,"line":45},[1258,1263,1267],{"type":993,"tag":1021,"props":1259,"children":1260},{"style":1036},[1261],{"type":998,"value":1262},"fruits.remove(",{"type":993,"tag":1021,"props":1264,"children":1265},{"style":1053},[1266],{"type":998,"value":1226},{"type":993,"tag":1021,"props":1268,"children":1269},{"style":1036},[1270],{"type":998,"value":1146},{"type":993,"tag":1021,"props":1272,"children":1273},{"class":1023,"line":54},[1274,1278,1282,1287],{"type":993,"tag":1021,"props":1275,"children":1276},{"style":1095},[1277],{"type":998,"value":1098},{"type":993,"tag":1021,"props":1279,"children":1280},{"style":1036},[1281],{"type":998,"value":1103},{"type":993,"tag":1021,"props":1283,"children":1284},{"style":1053},[1285],{"type":998,"value":1286},"\"After removing banana:\"",{"type":993,"tag":1021,"props":1288,"children":1289},{"style":1036},[1290],{"type":998,"value":1291},", fruits)\n",{"type":993,"tag":1021,"props":1293,"children":1294},{"class":1023,"line":63},[1295],{"type":993,"tag":1021,"props":1296,"children":1297},{"emptyLinePlaceholder":13},[1298],{"type":998,"value":1121},{"type":993,"tag":1021,"props":1300,"children":1301},{"class":1023,"line":72},[1302],{"type":993,"tag":1021,"props":1303,"children":1304},{"style":1027},[1305],{"type":998,"value":1306},"# This would cause an error:\n",{"type":993,"tag":1021,"props":1308,"children":1309},{"class":1023,"line":81},[1310],{"type":993,"tag":1021,"props":1311,"children":1312},{"style":1027},[1313],{"type":998,"value":1314},"# fruits.remove('grape')  # KeyError!\n",{"type":993,"tag":1316,"props":1317,"children":1320},"info-box",{"emoji":1318,"title":782,"type":1319},"⚠️","warning",[1321,1339,1349],{"type":993,"tag":1001,"props":1322,"children":1323},{},[1324,1330,1332,1337],{"type":993,"tag":1325,"props":1326,"children":1327},"strong",{},[1328],{"type":998,"value":1329},"Important Behavior:",{"type":998,"value":1331}," The ",{"type":993,"tag":1017,"props":1333,"children":1335},{"className":1334},[],[1336],{"type":998,"value":1184},{"type":998,"value":1338}," method raises a KeyError if the element doesn't exist in the set.",{"type":993,"tag":1001,"props":1340,"children":1341},{},[1342,1347],{"type":993,"tag":1325,"props":1343,"children":1344},{},[1345],{"type":998,"value":1346},"When to Use:",{"type":998,"value":1348}," When you're certain the element exists, or when you want an error if it doesn't.",{"type":993,"tag":1001,"props":1350,"children":1351},{},[1352,1357],{"type":993,"tag":1325,"props":1353,"children":1354},{},[1355],{"type":998,"value":1356},"Safety Tip:",{"type":998,"value":1358}," Always verify element existence or use try-catch blocks when uncertain.",{"type":993,"tag":1168,"props":1360,"children":1362},{"id":1361},"the-discard-method",[1363],{"type":998,"value":1364},"⚡ The discard() Method",{"type":993,"tag":1001,"props":1366,"children":1367},{},[1368,1369,1375],{"type":998,"value":1178},{"type":993,"tag":1017,"props":1370,"children":1372},{"className":1371},[],[1373],{"type":998,"value":1374},"discard()",{"type":998,"value":1376}," method provides safe element removal without error handling concerns. This makes it ideal for situations where element existence is uncertain.",{"type":993,"tag":1007,"props":1378,"children":1379},{},[1380],{"type":993,"tag":1011,"props":1381,"children":1383},{"className":1013,"code":1382,"language":6,"meta":8,"style":8},"animals = {'cat', 'dog', 'bird'}\n\n# Remove existing element\nanimals.discard('dog')\nprint(\"After discarding dog:\", animals)\n\n# Safe removal - no error even if element doesn't exist\nanimals.discard('elephant')  # No error!\nprint(\"After discarding elephant:\", animals)\n",[1384],{"type":993,"tag":1017,"props":1385,"children":1386},{"__ignoreMap":8},[1387,1430,1437,1445,1461,1482,1489,1497,1519],{"type":993,"tag":1021,"props":1388,"children":1389},{"class":1023,"line":12},[1390,1395,1399,1403,1408,1412,1417,1421,1426],{"type":993,"tag":1021,"props":1391,"children":1392},{"style":1036},[1393],{"type":998,"value":1394},"animals ",{"type":993,"tag":1021,"props":1396,"children":1397},{"style":1042},[1398],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1400,"children":1401},{"style":1036},[1402],{"type":998,"value":1050},{"type":993,"tag":1021,"props":1404,"children":1405},{"style":1053},[1406],{"type":998,"value":1407},"'cat'",{"type":993,"tag":1021,"props":1409,"children":1410},{"style":1036},[1411],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1413,"children":1414},{"style":1053},[1415],{"type":998,"value":1416},"'dog'",{"type":993,"tag":1021,"props":1418,"children":1419},{"style":1036},[1420],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1422,"children":1423},{"style":1053},[1424],{"type":998,"value":1425},"'bird'",{"type":993,"tag":1021,"props":1427,"children":1428},{"style":1036},[1429],{"type":998,"value":1089},{"type":993,"tag":1021,"props":1431,"children":1432},{"class":1023,"line":27},[1433],{"type":993,"tag":1021,"props":1434,"children":1435},{"emptyLinePlaceholder":13},[1436],{"type":998,"value":1121},{"type":993,"tag":1021,"props":1438,"children":1439},{"class":1023,"line":36},[1440],{"type":993,"tag":1021,"props":1441,"children":1442},{"style":1027},[1443],{"type":998,"value":1444},"# Remove existing element\n",{"type":993,"tag":1021,"props":1446,"children":1447},{"class":1023,"line":45},[1448,1453,1457],{"type":993,"tag":1021,"props":1449,"children":1450},{"style":1036},[1451],{"type":998,"value":1452},"animals.discard(",{"type":993,"tag":1021,"props":1454,"children":1455},{"style":1053},[1456],{"type":998,"value":1416},{"type":993,"tag":1021,"props":1458,"children":1459},{"style":1036},[1460],{"type":998,"value":1146},{"type":993,"tag":1021,"props":1462,"children":1463},{"class":1023,"line":54},[1464,1468,1472,1477],{"type":993,"tag":1021,"props":1465,"children":1466},{"style":1095},[1467],{"type":998,"value":1098},{"type":993,"tag":1021,"props":1469,"children":1470},{"style":1036},[1471],{"type":998,"value":1103},{"type":993,"tag":1021,"props":1473,"children":1474},{"style":1053},[1475],{"type":998,"value":1476},"\"After discarding dog:\"",{"type":993,"tag":1021,"props":1478,"children":1479},{"style":1036},[1480],{"type":998,"value":1481},", animals)\n",{"type":993,"tag":1021,"props":1483,"children":1484},{"class":1023,"line":63},[1485],{"type":993,"tag":1021,"props":1486,"children":1487},{"emptyLinePlaceholder":13},[1488],{"type":998,"value":1121},{"type":993,"tag":1021,"props":1490,"children":1491},{"class":1023,"line":72},[1492],{"type":993,"tag":1021,"props":1493,"children":1494},{"style":1027},[1495],{"type":998,"value":1496},"# Safe removal - no error even if element doesn't exist\n",{"type":993,"tag":1021,"props":1498,"children":1499},{"class":1023,"line":81},[1500,1504,1509,1514],{"type":993,"tag":1021,"props":1501,"children":1502},{"style":1036},[1503],{"type":998,"value":1452},{"type":993,"tag":1021,"props":1505,"children":1506},{"style":1053},[1507],{"type":998,"value":1508},"'elephant'",{"type":993,"tag":1021,"props":1510,"children":1511},{"style":1036},[1512],{"type":998,"value":1513},")  ",{"type":993,"tag":1021,"props":1515,"children":1516},{"style":1027},[1517],{"type":998,"value":1518},"# No error!\n",{"type":993,"tag":1021,"props":1520,"children":1521},{"class":1023,"line":91},[1522,1526,1530,1535],{"type":993,"tag":1021,"props":1523,"children":1524},{"style":1095},[1525],{"type":998,"value":1098},{"type":993,"tag":1021,"props":1527,"children":1528},{"style":1036},[1529],{"type":998,"value":1103},{"type":993,"tag":1021,"props":1531,"children":1532},{"style":1053},[1533],{"type":998,"value":1534},"\"After discarding elephant:\"",{"type":993,"tag":1021,"props":1536,"children":1537},{"style":1036},[1538],{"type":998,"value":1481},{"type":993,"tag":1168,"props":1540,"children":1542},{"id":1541},"the-pop-method",[1543],{"type":998,"value":1544},"🎲 The pop() Method",{"type":993,"tag":1001,"props":1546,"children":1547},{},[1548,1549,1555],{"type":998,"value":1178},{"type":993,"tag":1017,"props":1550,"children":1552},{"className":1551},[],[1553],{"type":998,"value":1554},"pop()",{"type":998,"value":1556}," method removes and returns an arbitrary element from the set. Since sets are unordered collections, the removed element is unpredictable.",{"type":993,"tag":1007,"props":1558,"children":1559},{},[1560],{"type":993,"tag":1011,"props":1561,"children":1563},{"className":1013,"code":1562,"language":6,"meta":8,"style":8},"numbers = {1, 2, 3, 4, 5}\nprint(\"Original set:\", numbers)\n\n# Remove and get arbitrary element\nremoved = numbers.pop()\nprint(\"Removed element:\", removed)\nprint(\"Set after pop:\", numbers)\n",[1564],{"type":993,"tag":1017,"props":1565,"children":1566},{"__ignoreMap":8},[1567,1628,1648,1655,1663,1680,1701],{"type":993,"tag":1021,"props":1568,"children":1569},{"class":1023,"line":12},[1570,1575,1579,1583,1588,1592,1597,1601,1606,1610,1615,1619,1624],{"type":993,"tag":1021,"props":1571,"children":1572},{"style":1036},[1573],{"type":998,"value":1574},"numbers ",{"type":993,"tag":1021,"props":1576,"children":1577},{"style":1042},[1578],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1580,"children":1581},{"style":1036},[1582],{"type":998,"value":1050},{"type":993,"tag":1021,"props":1584,"children":1585},{"style":1095},[1586],{"type":998,"value":1587},"1",{"type":993,"tag":1021,"props":1589,"children":1590},{"style":1036},[1591],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1593,"children":1594},{"style":1095},[1595],{"type":998,"value":1596},"2",{"type":993,"tag":1021,"props":1598,"children":1599},{"style":1036},[1600],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1602,"children":1603},{"style":1095},[1604],{"type":998,"value":1605},"3",{"type":993,"tag":1021,"props":1607,"children":1608},{"style":1036},[1609],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1611,"children":1612},{"style":1095},[1613],{"type":998,"value":1614},"4",{"type":993,"tag":1021,"props":1616,"children":1617},{"style":1036},[1618],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1620,"children":1621},{"style":1095},[1622],{"type":998,"value":1623},"5",{"type":993,"tag":1021,"props":1625,"children":1626},{"style":1036},[1627],{"type":998,"value":1089},{"type":993,"tag":1021,"props":1629,"children":1630},{"class":1023,"line":27},[1631,1635,1639,1643],{"type":993,"tag":1021,"props":1632,"children":1633},{"style":1095},[1634],{"type":998,"value":1098},{"type":993,"tag":1021,"props":1636,"children":1637},{"style":1036},[1638],{"type":998,"value":1103},{"type":993,"tag":1021,"props":1640,"children":1641},{"style":1053},[1642],{"type":998,"value":1108},{"type":993,"tag":1021,"props":1644,"children":1645},{"style":1036},[1646],{"type":998,"value":1647},", numbers)\n",{"type":993,"tag":1021,"props":1649,"children":1650},{"class":1023,"line":36},[1651],{"type":993,"tag":1021,"props":1652,"children":1653},{"emptyLinePlaceholder":13},[1654],{"type":998,"value":1121},{"type":993,"tag":1021,"props":1656,"children":1657},{"class":1023,"line":45},[1658],{"type":993,"tag":1021,"props":1659,"children":1660},{"style":1027},[1661],{"type":998,"value":1662},"# Remove and get arbitrary element\n",{"type":993,"tag":1021,"props":1664,"children":1665},{"class":1023,"line":54},[1666,1671,1675],{"type":993,"tag":1021,"props":1667,"children":1668},{"style":1036},[1669],{"type":998,"value":1670},"removed ",{"type":993,"tag":1021,"props":1672,"children":1673},{"style":1042},[1674],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1676,"children":1677},{"style":1036},[1678],{"type":998,"value":1679}," numbers.pop()\n",{"type":993,"tag":1021,"props":1681,"children":1682},{"class":1023,"line":63},[1683,1687,1691,1696],{"type":993,"tag":1021,"props":1684,"children":1685},{"style":1095},[1686],{"type":998,"value":1098},{"type":993,"tag":1021,"props":1688,"children":1689},{"style":1036},[1690],{"type":998,"value":1103},{"type":993,"tag":1021,"props":1692,"children":1693},{"style":1053},[1694],{"type":998,"value":1695},"\"Removed element:\"",{"type":993,"tag":1021,"props":1697,"children":1698},{"style":1036},[1699],{"type":998,"value":1700},", removed)\n",{"type":993,"tag":1021,"props":1702,"children":1703},{"class":1023,"line":72},[1704,1708,1712,1717],{"type":993,"tag":1021,"props":1705,"children":1706},{"style":1095},[1707],{"type":998,"value":1098},{"type":993,"tag":1021,"props":1709,"children":1710},{"style":1036},[1711],{"type":998,"value":1103},{"type":993,"tag":1021,"props":1713,"children":1714},{"style":1053},[1715],{"type":998,"value":1716},"\"Set after pop:\"",{"type":993,"tag":1021,"props":1718,"children":1719},{"style":1036},[1720],{"type":998,"value":1647},{"type":993,"tag":1316,"props":1722,"children":1726},{"emoji":1723,"title":1724,"type":1725},"🎲","Pop Method Behavior","info",[1727,1744,1754],{"type":993,"tag":1001,"props":1728,"children":1729},{},[1730,1735,1737,1742],{"type":993,"tag":1325,"props":1731,"children":1732},{},[1733],{"type":998,"value":1734},"Arbitrary Removal:",{"type":998,"value":1736}," Since sets are unordered, ",{"type":993,"tag":1017,"props":1738,"children":1740},{"className":1739},[],[1741],{"type":998,"value":1554},{"type":998,"value":1743}," doesn't guarantee which element will be removed.",{"type":993,"tag":1001,"props":1745,"children":1746},{},[1747,1752],{"type":993,"tag":1325,"props":1748,"children":1749},{},[1750],{"type":998,"value":1751},"Return Value:",{"type":998,"value":1753}," Returns the removed element, which you can store in a variable.",{"type":993,"tag":1001,"props":1755,"children":1756},{},[1757,1762],{"type":993,"tag":1325,"props":1758,"children":1759},{},[1760],{"type":998,"value":1761},"Empty Set Warning:",{"type":998,"value":1763}," Raises KeyError if called on an empty set.",{"type":993,"tag":1168,"props":1765,"children":1767},{"id":1766},"the-clear-method",[1768],{"type":998,"value":1769},"🧹 The clear() Method",{"type":993,"tag":1001,"props":1771,"children":1772},{},[1773,1774,1780],{"type":998,"value":1178},{"type":993,"tag":1017,"props":1775,"children":1777},{"className":1776},[],[1778],{"type":998,"value":1779},"clear()",{"type":998,"value":1781}," method empties the entire set in one operation. This is the most efficient way to remove all elements simultaneously.",{"type":993,"tag":1007,"props":1783,"children":1784},{},[1785],{"type":993,"tag":1011,"props":1786,"children":1788},{"className":1013,"code":1787,"language":6,"meta":8,"style":8},"sports = {'football', 'basketball', 'tennis'}\nprint(\"Before clear:\", sports)\n\nsports.clear()\nprint(\"After clear:\", sports)\nprint(\"Is empty?\", len(sports) == 0)\n",[1789],{"type":993,"tag":1017,"props":1790,"children":1791},{"__ignoreMap":8},[1792,1835,1856,1863,1871,1891],{"type":993,"tag":1021,"props":1793,"children":1794},{"class":1023,"line":12},[1795,1800,1804,1808,1813,1817,1822,1826,1831],{"type":993,"tag":1021,"props":1796,"children":1797},{"style":1036},[1798],{"type":998,"value":1799},"sports ",{"type":993,"tag":1021,"props":1801,"children":1802},{"style":1042},[1803],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1805,"children":1806},{"style":1036},[1807],{"type":998,"value":1050},{"type":993,"tag":1021,"props":1809,"children":1810},{"style":1053},[1811],{"type":998,"value":1812},"'football'",{"type":993,"tag":1021,"props":1814,"children":1815},{"style":1036},[1816],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1818,"children":1819},{"style":1053},[1820],{"type":998,"value":1821},"'basketball'",{"type":993,"tag":1021,"props":1823,"children":1824},{"style":1036},[1825],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1827,"children":1828},{"style":1053},[1829],{"type":998,"value":1830},"'tennis'",{"type":993,"tag":1021,"props":1832,"children":1833},{"style":1036},[1834],{"type":998,"value":1089},{"type":993,"tag":1021,"props":1836,"children":1837},{"class":1023,"line":27},[1838,1842,1846,1851],{"type":993,"tag":1021,"props":1839,"children":1840},{"style":1095},[1841],{"type":998,"value":1098},{"type":993,"tag":1021,"props":1843,"children":1844},{"style":1036},[1845],{"type":998,"value":1103},{"type":993,"tag":1021,"props":1847,"children":1848},{"style":1053},[1849],{"type":998,"value":1850},"\"Before clear:\"",{"type":993,"tag":1021,"props":1852,"children":1853},{"style":1036},[1854],{"type":998,"value":1855},", sports)\n",{"type":993,"tag":1021,"props":1857,"children":1858},{"class":1023,"line":36},[1859],{"type":993,"tag":1021,"props":1860,"children":1861},{"emptyLinePlaceholder":13},[1862],{"type":998,"value":1121},{"type":993,"tag":1021,"props":1864,"children":1865},{"class":1023,"line":45},[1866],{"type":993,"tag":1021,"props":1867,"children":1868},{"style":1036},[1869],{"type":998,"value":1870},"sports.clear()\n",{"type":993,"tag":1021,"props":1872,"children":1873},{"class":1023,"line":54},[1874,1878,1882,1887],{"type":993,"tag":1021,"props":1875,"children":1876},{"style":1095},[1877],{"type":998,"value":1098},{"type":993,"tag":1021,"props":1879,"children":1880},{"style":1036},[1881],{"type":998,"value":1103},{"type":993,"tag":1021,"props":1883,"children":1884},{"style":1053},[1885],{"type":998,"value":1886},"\"After clear:\"",{"type":993,"tag":1021,"props":1888,"children":1889},{"style":1036},[1890],{"type":998,"value":1855},{"type":993,"tag":1021,"props":1892,"children":1893},{"class":1023,"line":63},[1894,1898,1902,1907,1911,1916,1921,1926,1931],{"type":993,"tag":1021,"props":1895,"children":1896},{"style":1095},[1897],{"type":998,"value":1098},{"type":993,"tag":1021,"props":1899,"children":1900},{"style":1036},[1901],{"type":998,"value":1103},{"type":993,"tag":1021,"props":1903,"children":1904},{"style":1053},[1905],{"type":998,"value":1906},"\"Is empty?\"",{"type":993,"tag":1021,"props":1908,"children":1909},{"style":1036},[1910],{"type":998,"value":1061},{"type":993,"tag":1021,"props":1912,"children":1913},{"style":1095},[1914],{"type":998,"value":1915},"len",{"type":993,"tag":1021,"props":1917,"children":1918},{"style":1036},[1919],{"type":998,"value":1920},"(sports) ",{"type":993,"tag":1021,"props":1922,"children":1923},{"style":1042},[1924],{"type":998,"value":1925},"==",{"type":993,"tag":1021,"props":1927,"children":1928},{"style":1095},[1929],{"type":998,"value":1930}," 0",{"type":993,"tag":1021,"props":1932,"children":1933},{"style":1036},[1934],{"type":998,"value":1146},{"type":993,"tag":1168,"props":1936,"children":1938},{"id":1937},"removing-multiple-elements",[1939],{"type":998,"value":1940},"🚀 Removing Multiple Elements",{"type":993,"tag":1001,"props":1942,"children":1943},{},[1944],{"type":998,"value":1945},"Bulk removal operations allow you to eliminate several elements efficiently without individual method calls.",{"type":993,"tag":1947,"props":1948,"children":1950},"h3",{"id":1949},"using-a-loop-with-discard",[1951],{"type":998,"value":1952},"Using a Loop with discard()",{"type":993,"tag":1001,"props":1954,"children":1955},{},[1956,1958,1963],{"type":998,"value":1957},"Loop-based removal with ",{"type":993,"tag":1017,"props":1959,"children":1961},{"className":1960},[],[1962],{"type":998,"value":1374},{"type":998,"value":1964}," safely handles mixed scenarios where some elements may not exist.",{"type":993,"tag":1007,"props":1966,"children":1967},{},[1968],{"type":993,"tag":1011,"props":1969,"children":1971},{"className":1013,"code":1970,"language":6,"meta":8,"style":8},"data = {1, 2, 3, 4, 5, 6, 7, 8, 9}\nto_remove = [2, 4, 6, 8]\n\nfor item in to_remove:\n    data.discard(item)\n\nprint(\"After removing even numbers:\", data)\n",[1972],{"type":993,"tag":1017,"props":1973,"children":1974},{"__ignoreMap":8},[1975,2067,2117,2124,2147,2155,2162],{"type":993,"tag":1021,"props":1976,"children":1977},{"class":1023,"line":12},[1978,1983,1987,1991,1995,1999,2003,2007,2011,2015,2019,2023,2027,2031,2036,2040,2045,2049,2054,2058,2063],{"type":993,"tag":1021,"props":1979,"children":1980},{"style":1036},[1981],{"type":998,"value":1982},"data ",{"type":993,"tag":1021,"props":1984,"children":1985},{"style":1042},[1986],{"type":998,"value":1045},{"type":993,"tag":1021,"props":1988,"children":1989},{"style":1036},[1990],{"type":998,"value":1050},{"type":993,"tag":1021,"props":1992,"children":1993},{"style":1095},[1994],{"type":998,"value":1587},{"type":993,"tag":1021,"props":1996,"children":1997},{"style":1036},[1998],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2000,"children":2001},{"style":1095},[2002],{"type":998,"value":1596},{"type":993,"tag":1021,"props":2004,"children":2005},{"style":1036},[2006],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2008,"children":2009},{"style":1095},[2010],{"type":998,"value":1605},{"type":993,"tag":1021,"props":2012,"children":2013},{"style":1036},[2014],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2016,"children":2017},{"style":1095},[2018],{"type":998,"value":1614},{"type":993,"tag":1021,"props":2020,"children":2021},{"style":1036},[2022],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2024,"children":2025},{"style":1095},[2026],{"type":998,"value":1623},{"type":993,"tag":1021,"props":2028,"children":2029},{"style":1036},[2030],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2032,"children":2033},{"style":1095},[2034],{"type":998,"value":2035},"6",{"type":993,"tag":1021,"props":2037,"children":2038},{"style":1036},[2039],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2041,"children":2042},{"style":1095},[2043],{"type":998,"value":2044},"7",{"type":993,"tag":1021,"props":2046,"children":2047},{"style":1036},[2048],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2050,"children":2051},{"style":1095},[2052],{"type":998,"value":2053},"8",{"type":993,"tag":1021,"props":2055,"children":2056},{"style":1036},[2057],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2059,"children":2060},{"style":1095},[2061],{"type":998,"value":2062},"9",{"type":993,"tag":1021,"props":2064,"children":2065},{"style":1036},[2066],{"type":998,"value":1089},{"type":993,"tag":1021,"props":2068,"children":2069},{"class":1023,"line":27},[2070,2075,2079,2084,2088,2092,2096,2100,2104,2108,2112],{"type":993,"tag":1021,"props":2071,"children":2072},{"style":1036},[2073],{"type":998,"value":2074},"to_remove ",{"type":993,"tag":1021,"props":2076,"children":2077},{"style":1042},[2078],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2080,"children":2081},{"style":1036},[2082],{"type":998,"value":2083}," [",{"type":993,"tag":1021,"props":2085,"children":2086},{"style":1095},[2087],{"type":998,"value":1596},{"type":993,"tag":1021,"props":2089,"children":2090},{"style":1036},[2091],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2093,"children":2094},{"style":1095},[2095],{"type":998,"value":1614},{"type":993,"tag":1021,"props":2097,"children":2098},{"style":1036},[2099],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2101,"children":2102},{"style":1095},[2103],{"type":998,"value":2035},{"type":993,"tag":1021,"props":2105,"children":2106},{"style":1036},[2107],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2109,"children":2110},{"style":1095},[2111],{"type":998,"value":2053},{"type":993,"tag":1021,"props":2113,"children":2114},{"style":1036},[2115],{"type":998,"value":2116},"]\n",{"type":993,"tag":1021,"props":2118,"children":2119},{"class":1023,"line":36},[2120],{"type":993,"tag":1021,"props":2121,"children":2122},{"emptyLinePlaceholder":13},[2123],{"type":998,"value":1121},{"type":993,"tag":1021,"props":2125,"children":2126},{"class":1023,"line":45},[2127,2132,2137,2142],{"type":993,"tag":1021,"props":2128,"children":2129},{"style":1042},[2130],{"type":998,"value":2131},"for",{"type":993,"tag":1021,"props":2133,"children":2134},{"style":1036},[2135],{"type":998,"value":2136}," item ",{"type":993,"tag":1021,"props":2138,"children":2139},{"style":1042},[2140],{"type":998,"value":2141},"in",{"type":993,"tag":1021,"props":2143,"children":2144},{"style":1036},[2145],{"type":998,"value":2146}," to_remove:\n",{"type":993,"tag":1021,"props":2148,"children":2149},{"class":1023,"line":54},[2150],{"type":993,"tag":1021,"props":2151,"children":2152},{"style":1036},[2153],{"type":998,"value":2154},"    data.discard(item)\n",{"type":993,"tag":1021,"props":2156,"children":2157},{"class":1023,"line":63},[2158],{"type":993,"tag":1021,"props":2159,"children":2160},{"emptyLinePlaceholder":13},[2161],{"type":998,"value":1121},{"type":993,"tag":1021,"props":2163,"children":2164},{"class":1023,"line":72},[2165,2169,2173,2178],{"type":993,"tag":1021,"props":2166,"children":2167},{"style":1095},[2168],{"type":998,"value":1098},{"type":993,"tag":1021,"props":2170,"children":2171},{"style":1036},[2172],{"type":998,"value":1103},{"type":993,"tag":1021,"props":2174,"children":2175},{"style":1053},[2176],{"type":998,"value":2177},"\"After removing even numbers:\"",{"type":993,"tag":1021,"props":2179,"children":2180},{"style":1036},[2181],{"type":998,"value":2182},", data)\n",{"type":993,"tag":1947,"props":2184,"children":2186},{"id":2185},"using-set-difference",[2187],{"type":998,"value":2188},"Using Set Difference",{"type":993,"tag":1001,"props":2190,"children":2191},{},[2192],{"type":998,"value":2193},"Set difference creates a new set by excluding specified elements, leaving the original set unchanged.",{"type":993,"tag":1007,"props":2195,"children":2196},{},[2197],{"type":993,"tag":1011,"props":2198,"children":2200},{"className":1013,"code":2199,"language":6,"meta":8,"style":8},"original = {'a', 'b', 'c', 'd', 'e'}\nto_remove = {'b', 'd'}\n\n# Create new set without unwanted elements\nresult = original - to_remove\nprint(\"Original:\", original)\nprint(\"Result:\", result)\n\n# Update original set\noriginal -= to_remove\nprint(\"Original after difference update:\", original)\n",[2201],{"type":993,"tag":1017,"props":2202,"children":2203},{"__ignoreMap":8},[2204,2265,2296,2303,2311,2338,2359,2380,2387,2395,2411],{"type":993,"tag":1021,"props":2205,"children":2206},{"class":1023,"line":12},[2207,2212,2216,2220,2225,2229,2234,2238,2243,2247,2252,2256,2261],{"type":993,"tag":1021,"props":2208,"children":2209},{"style":1036},[2210],{"type":998,"value":2211},"original ",{"type":993,"tag":1021,"props":2213,"children":2214},{"style":1042},[2215],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2217,"children":2218},{"style":1036},[2219],{"type":998,"value":1050},{"type":993,"tag":1021,"props":2221,"children":2222},{"style":1053},[2223],{"type":998,"value":2224},"'a'",{"type":993,"tag":1021,"props":2226,"children":2227},{"style":1036},[2228],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2230,"children":2231},{"style":1053},[2232],{"type":998,"value":2233},"'b'",{"type":993,"tag":1021,"props":2235,"children":2236},{"style":1036},[2237],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2239,"children":2240},{"style":1053},[2241],{"type":998,"value":2242},"'c'",{"type":993,"tag":1021,"props":2244,"children":2245},{"style":1036},[2246],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2248,"children":2249},{"style":1053},[2250],{"type":998,"value":2251},"'d'",{"type":993,"tag":1021,"props":2253,"children":2254},{"style":1036},[2255],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2257,"children":2258},{"style":1053},[2259],{"type":998,"value":2260},"'e'",{"type":993,"tag":1021,"props":2262,"children":2263},{"style":1036},[2264],{"type":998,"value":1089},{"type":993,"tag":1021,"props":2266,"children":2267},{"class":1023,"line":27},[2268,2272,2276,2280,2284,2288,2292],{"type":993,"tag":1021,"props":2269,"children":2270},{"style":1036},[2271],{"type":998,"value":2074},{"type":993,"tag":1021,"props":2273,"children":2274},{"style":1042},[2275],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2277,"children":2278},{"style":1036},[2279],{"type":998,"value":1050},{"type":993,"tag":1021,"props":2281,"children":2282},{"style":1053},[2283],{"type":998,"value":2233},{"type":993,"tag":1021,"props":2285,"children":2286},{"style":1036},[2287],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2289,"children":2290},{"style":1053},[2291],{"type":998,"value":2251},{"type":993,"tag":1021,"props":2293,"children":2294},{"style":1036},[2295],{"type":998,"value":1089},{"type":993,"tag":1021,"props":2297,"children":2298},{"class":1023,"line":36},[2299],{"type":993,"tag":1021,"props":2300,"children":2301},{"emptyLinePlaceholder":13},[2302],{"type":998,"value":1121},{"type":993,"tag":1021,"props":2304,"children":2305},{"class":1023,"line":45},[2306],{"type":993,"tag":1021,"props":2307,"children":2308},{"style":1027},[2309],{"type":998,"value":2310},"# Create new set without unwanted elements\n",{"type":993,"tag":1021,"props":2312,"children":2313},{"class":1023,"line":54},[2314,2319,2323,2328,2333],{"type":993,"tag":1021,"props":2315,"children":2316},{"style":1036},[2317],{"type":998,"value":2318},"result ",{"type":993,"tag":1021,"props":2320,"children":2321},{"style":1042},[2322],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2324,"children":2325},{"style":1036},[2326],{"type":998,"value":2327}," original ",{"type":993,"tag":1021,"props":2329,"children":2330},{"style":1042},[2331],{"type":998,"value":2332},"-",{"type":993,"tag":1021,"props":2334,"children":2335},{"style":1036},[2336],{"type":998,"value":2337}," to_remove\n",{"type":993,"tag":1021,"props":2339,"children":2340},{"class":1023,"line":63},[2341,2345,2349,2354],{"type":993,"tag":1021,"props":2342,"children":2343},{"style":1095},[2344],{"type":998,"value":1098},{"type":993,"tag":1021,"props":2346,"children":2347},{"style":1036},[2348],{"type":998,"value":1103},{"type":993,"tag":1021,"props":2350,"children":2351},{"style":1053},[2352],{"type":998,"value":2353},"\"Original:\"",{"type":993,"tag":1021,"props":2355,"children":2356},{"style":1036},[2357],{"type":998,"value":2358},", original)\n",{"type":993,"tag":1021,"props":2360,"children":2361},{"class":1023,"line":72},[2362,2366,2370,2375],{"type":993,"tag":1021,"props":2363,"children":2364},{"style":1095},[2365],{"type":998,"value":1098},{"type":993,"tag":1021,"props":2367,"children":2368},{"style":1036},[2369],{"type":998,"value":1103},{"type":993,"tag":1021,"props":2371,"children":2372},{"style":1053},[2373],{"type":998,"value":2374},"\"Result:\"",{"type":993,"tag":1021,"props":2376,"children":2377},{"style":1036},[2378],{"type":998,"value":2379},", result)\n",{"type":993,"tag":1021,"props":2381,"children":2382},{"class":1023,"line":81},[2383],{"type":993,"tag":1021,"props":2384,"children":2385},{"emptyLinePlaceholder":13},[2386],{"type":998,"value":1121},{"type":993,"tag":1021,"props":2388,"children":2389},{"class":1023,"line":91},[2390],{"type":993,"tag":1021,"props":2391,"children":2392},{"style":1027},[2393],{"type":998,"value":2394},"# Update original set\n",{"type":993,"tag":1021,"props":2396,"children":2397},{"class":1023,"line":100},[2398,2402,2407],{"type":993,"tag":1021,"props":2399,"children":2400},{"style":1036},[2401],{"type":998,"value":2211},{"type":993,"tag":1021,"props":2403,"children":2404},{"style":1042},[2405],{"type":998,"value":2406},"-=",{"type":993,"tag":1021,"props":2408,"children":2409},{"style":1036},[2410],{"type":998,"value":2337},{"type":993,"tag":1021,"props":2412,"children":2413},{"class":1023,"line":109},[2414,2418,2422,2427],{"type":993,"tag":1021,"props":2415,"children":2416},{"style":1095},[2417],{"type":998,"value":1098},{"type":993,"tag":1021,"props":2419,"children":2420},{"style":1036},[2421],{"type":998,"value":1103},{"type":993,"tag":1021,"props":2423,"children":2424},{"style":1053},[2425],{"type":998,"value":2426},"\"Original after difference update:\"",{"type":993,"tag":1021,"props":2428,"children":2429},{"style":1036},[2430],{"type":998,"value":2358},{"type":993,"tag":1168,"props":2432,"children":2434},{"id":2433},"set-removal-methods-comparison",[2435],{"type":998,"value":2436},"📚 Set Removal Methods Comparison",{"type":993,"tag":2438,"props":2439,"children":2440},"table",{},[2441,2470],{"type":993,"tag":2442,"props":2443,"children":2444},"thead",{},[2445],{"type":993,"tag":2446,"props":2447,"children":2448},"tr",{},[2449,2455,2460,2465],{"type":993,"tag":2450,"props":2451,"children":2452},"th",{},[2453],{"type":998,"value":2454},"Method",{"type":993,"tag":2450,"props":2456,"children":2457},{},[2458],{"type":998,"value":2459},"Behavior if Element Missing",{"type":993,"tag":2450,"props":2461,"children":2462},{},[2463],{"type":998,"value":2464},"Returns Value",{"type":993,"tag":2450,"props":2466,"children":2467},{},[2468],{"type":998,"value":2469},"Use Case",{"type":993,"tag":2471,"props":2472,"children":2473},"tbody",{},[2474,2502,2528,2554],{"type":993,"tag":2446,"props":2475,"children":2476},{},[2477,2487,2492,2497],{"type":993,"tag":2478,"props":2479,"children":2480},"td",{},[2481],{"type":993,"tag":1017,"props":2482,"children":2484},{"className":2483},[],[2485],{"type":998,"value":2486},"remove(element)",{"type":993,"tag":2478,"props":2488,"children":2489},{},[2490],{"type":998,"value":2491},"Raises KeyError",{"type":993,"tag":2478,"props":2493,"children":2494},{},[2495],{"type":998,"value":2496},"None",{"type":993,"tag":2478,"props":2498,"children":2499},{},[2500],{"type":998,"value":2501},"When element must exist",{"type":993,"tag":2446,"props":2503,"children":2504},{},[2505,2514,2519,2523],{"type":993,"tag":2478,"props":2506,"children":2507},{},[2508],{"type":993,"tag":1017,"props":2509,"children":2511},{"className":2510},[],[2512],{"type":998,"value":2513},"discard(element)",{"type":993,"tag":2478,"props":2515,"children":2516},{},[2517],{"type":998,"value":2518},"Does nothing",{"type":993,"tag":2478,"props":2520,"children":2521},{},[2522],{"type":998,"value":2496},{"type":993,"tag":2478,"props":2524,"children":2525},{},[2526],{"type":998,"value":2527},"Safe removal",{"type":993,"tag":2446,"props":2529,"children":2530},{},[2531,2539,2544,2549],{"type":993,"tag":2478,"props":2532,"children":2533},{},[2534],{"type":993,"tag":1017,"props":2535,"children":2537},{"className":2536},[],[2538],{"type":998,"value":1554},{"type":993,"tag":2478,"props":2540,"children":2541},{},[2542],{"type":998,"value":2543},"Raises KeyError if empty",{"type":993,"tag":2478,"props":2545,"children":2546},{},[2547],{"type":998,"value":2548},"Removed element",{"type":993,"tag":2478,"props":2550,"children":2551},{},[2552],{"type":998,"value":2553},"Remove arbitrary element",{"type":993,"tag":2446,"props":2555,"children":2556},{},[2557,2565,2570,2574],{"type":993,"tag":2478,"props":2558,"children":2559},{},[2560],{"type":993,"tag":1017,"props":2561,"children":2563},{"className":2562},[],[2564],{"type":998,"value":1779},{"type":993,"tag":2478,"props":2566,"children":2567},{},[2568],{"type":998,"value":2569},"N/A",{"type":993,"tag":2478,"props":2571,"children":2572},{},[2573],{"type":998,"value":2496},{"type":993,"tag":2478,"props":2575,"children":2576},{},[2577],{"type":998,"value":2578},"Empty entire set",{"type":993,"tag":1168,"props":2580,"children":2582},{"id":2581},"practical-examples",[2583],{"type":998,"value":2584},"💡 Practical Examples",{"type":993,"tag":1947,"props":2586,"children":2588},{"id":2587},"inventory-management",[2589],{"type":998,"value":2590},"Inventory Management",{"type":993,"tag":1001,"props":2592,"children":2593},{},[2594],{"type":998,"value":2595},"Real-world inventory systems require careful element removal with proper error handling and user feedback.",{"type":993,"tag":1007,"props":2597,"children":2598},{},[2599],{"type":993,"tag":1011,"props":2600,"children":2602},{"className":1013,"code":2601,"language":6,"meta":8,"style":8},"inventory = {'laptop', 'mouse', 'keyboard', 'monitor'}\n\ndef sell_item(item_name):\n    if item_name in inventory:\n        inventory.remove(item_name)\n        print(f\"Sold: {item_name}\")\n        return True\n    else:\n        print(f\"Item not in stock: {item_name}\")\n        return False\n\nsell_item('mouse')\nsell_item('tablet')  # Not in stock\nprint(\"Remaining inventory:\", inventory)\n",[2603],{"type":993,"tag":1017,"props":2604,"children":2605},{"__ignoreMap":8},[2606,2658,2665,2684,2706,2714,2760,2773,2786,2826,2838,2845,2861,2882],{"type":993,"tag":1021,"props":2607,"children":2608},{"class":1023,"line":12},[2609,2614,2618,2622,2627,2631,2636,2640,2645,2649,2654],{"type":993,"tag":1021,"props":2610,"children":2611},{"style":1036},[2612],{"type":998,"value":2613},"inventory ",{"type":993,"tag":1021,"props":2615,"children":2616},{"style":1042},[2617],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2619,"children":2620},{"style":1036},[2621],{"type":998,"value":1050},{"type":993,"tag":1021,"props":2623,"children":2624},{"style":1053},[2625],{"type":998,"value":2626},"'laptop'",{"type":993,"tag":1021,"props":2628,"children":2629},{"style":1036},[2630],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2632,"children":2633},{"style":1053},[2634],{"type":998,"value":2635},"'mouse'",{"type":993,"tag":1021,"props":2637,"children":2638},{"style":1036},[2639],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2641,"children":2642},{"style":1053},[2643],{"type":998,"value":2644},"'keyboard'",{"type":993,"tag":1021,"props":2646,"children":2647},{"style":1036},[2648],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2650,"children":2651},{"style":1053},[2652],{"type":998,"value":2653},"'monitor'",{"type":993,"tag":1021,"props":2655,"children":2656},{"style":1036},[2657],{"type":998,"value":1089},{"type":993,"tag":1021,"props":2659,"children":2660},{"class":1023,"line":27},[2661],{"type":993,"tag":1021,"props":2662,"children":2663},{"emptyLinePlaceholder":13},[2664],{"type":998,"value":1121},{"type":993,"tag":1021,"props":2666,"children":2667},{"class":1023,"line":36},[2668,2673,2679],{"type":993,"tag":1021,"props":2669,"children":2670},{"style":1042},[2671],{"type":998,"value":2672},"def",{"type":993,"tag":1021,"props":2674,"children":2676},{"style":2675},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2677],{"type":998,"value":2678}," sell_item",{"type":993,"tag":1021,"props":2680,"children":2681},{"style":1036},[2682],{"type":998,"value":2683},"(item_name):\n",{"type":993,"tag":1021,"props":2685,"children":2686},{"class":1023,"line":45},[2687,2692,2697,2701],{"type":993,"tag":1021,"props":2688,"children":2689},{"style":1042},[2690],{"type":998,"value":2691},"    if",{"type":993,"tag":1021,"props":2693,"children":2694},{"style":1036},[2695],{"type":998,"value":2696}," item_name ",{"type":993,"tag":1021,"props":2698,"children":2699},{"style":1042},[2700],{"type":998,"value":2141},{"type":993,"tag":1021,"props":2702,"children":2703},{"style":1036},[2704],{"type":998,"value":2705}," inventory:\n",{"type":993,"tag":1021,"props":2707,"children":2708},{"class":1023,"line":54},[2709],{"type":993,"tag":1021,"props":2710,"children":2711},{"style":1036},[2712],{"type":998,"value":2713},"        inventory.remove(item_name)\n",{"type":993,"tag":1021,"props":2715,"children":2716},{"class":1023,"line":63},[2717,2722,2726,2731,2736,2741,2746,2751,2756],{"type":993,"tag":1021,"props":2718,"children":2719},{"style":1095},[2720],{"type":998,"value":2721},"        print",{"type":993,"tag":1021,"props":2723,"children":2724},{"style":1036},[2725],{"type":998,"value":1103},{"type":993,"tag":1021,"props":2727,"children":2728},{"style":1042},[2729],{"type":998,"value":2730},"f",{"type":993,"tag":1021,"props":2732,"children":2733},{"style":1053},[2734],{"type":998,"value":2735},"\"Sold: ",{"type":993,"tag":1021,"props":2737,"children":2738},{"style":1095},[2739],{"type":998,"value":2740},"{",{"type":993,"tag":1021,"props":2742,"children":2743},{"style":1036},[2744],{"type":998,"value":2745},"item_name",{"type":993,"tag":1021,"props":2747,"children":2748},{"style":1095},[2749],{"type":998,"value":2750},"}",{"type":993,"tag":1021,"props":2752,"children":2753},{"style":1053},[2754],{"type":998,"value":2755},"\"",{"type":993,"tag":1021,"props":2757,"children":2758},{"style":1036},[2759],{"type":998,"value":1146},{"type":993,"tag":1021,"props":2761,"children":2762},{"class":1023,"line":72},[2763,2768],{"type":993,"tag":1021,"props":2764,"children":2765},{"style":1042},[2766],{"type":998,"value":2767},"        return",{"type":993,"tag":1021,"props":2769,"children":2770},{"style":1095},[2771],{"type":998,"value":2772}," True\n",{"type":993,"tag":1021,"props":2774,"children":2775},{"class":1023,"line":81},[2776,2781],{"type":993,"tag":1021,"props":2777,"children":2778},{"style":1042},[2779],{"type":998,"value":2780},"    else",{"type":993,"tag":1021,"props":2782,"children":2783},{"style":1036},[2784],{"type":998,"value":2785},":\n",{"type":993,"tag":1021,"props":2787,"children":2788},{"class":1023,"line":91},[2789,2793,2797,2801,2806,2810,2814,2818,2822],{"type":993,"tag":1021,"props":2790,"children":2791},{"style":1095},[2792],{"type":998,"value":2721},{"type":993,"tag":1021,"props":2794,"children":2795},{"style":1036},[2796],{"type":998,"value":1103},{"type":993,"tag":1021,"props":2798,"children":2799},{"style":1042},[2800],{"type":998,"value":2730},{"type":993,"tag":1021,"props":2802,"children":2803},{"style":1053},[2804],{"type":998,"value":2805},"\"Item not in stock: ",{"type":993,"tag":1021,"props":2807,"children":2808},{"style":1095},[2809],{"type":998,"value":2740},{"type":993,"tag":1021,"props":2811,"children":2812},{"style":1036},[2813],{"type":998,"value":2745},{"type":993,"tag":1021,"props":2815,"children":2816},{"style":1095},[2817],{"type":998,"value":2750},{"type":993,"tag":1021,"props":2819,"children":2820},{"style":1053},[2821],{"type":998,"value":2755},{"type":993,"tag":1021,"props":2823,"children":2824},{"style":1036},[2825],{"type":998,"value":1146},{"type":993,"tag":1021,"props":2827,"children":2828},{"class":1023,"line":100},[2829,2833],{"type":993,"tag":1021,"props":2830,"children":2831},{"style":1042},[2832],{"type":998,"value":2767},{"type":993,"tag":1021,"props":2834,"children":2835},{"style":1095},[2836],{"type":998,"value":2837}," False\n",{"type":993,"tag":1021,"props":2839,"children":2840},{"class":1023,"line":109},[2841],{"type":993,"tag":1021,"props":2842,"children":2843},{"emptyLinePlaceholder":13},[2844],{"type":998,"value":1121},{"type":993,"tag":1021,"props":2846,"children":2847},{"class":1023,"line":118},[2848,2853,2857],{"type":993,"tag":1021,"props":2849,"children":2850},{"style":1036},[2851],{"type":998,"value":2852},"sell_item(",{"type":993,"tag":1021,"props":2854,"children":2855},{"style":1053},[2856],{"type":998,"value":2635},{"type":993,"tag":1021,"props":2858,"children":2859},{"style":1036},[2860],{"type":998,"value":1146},{"type":993,"tag":1021,"props":2862,"children":2863},{"class":1023,"line":127},[2864,2868,2873,2877],{"type":993,"tag":1021,"props":2865,"children":2866},{"style":1036},[2867],{"type":998,"value":2852},{"type":993,"tag":1021,"props":2869,"children":2870},{"style":1053},[2871],{"type":998,"value":2872},"'tablet'",{"type":993,"tag":1021,"props":2874,"children":2875},{"style":1036},[2876],{"type":998,"value":1513},{"type":993,"tag":1021,"props":2878,"children":2879},{"style":1027},[2880],{"type":998,"value":2881},"# Not in stock\n",{"type":993,"tag":1021,"props":2883,"children":2884},{"class":1023,"line":136},[2885,2889,2893,2898],{"type":993,"tag":1021,"props":2886,"children":2887},{"style":1095},[2888],{"type":998,"value":1098},{"type":993,"tag":1021,"props":2890,"children":2891},{"style":1036},[2892],{"type":998,"value":1103},{"type":993,"tag":1021,"props":2894,"children":2895},{"style":1053},[2896],{"type":998,"value":2897},"\"Remaining inventory:\"",{"type":993,"tag":1021,"props":2899,"children":2900},{"style":1036},[2901],{"type":998,"value":2902},", inventory)\n",{"type":993,"tag":1947,"props":2904,"children":2906},{"id":2905},"user-permissions",[2907],{"type":998,"value":2908},"User Permissions",{"type":993,"tag":1001,"props":2910,"children":2911},{},[2912],{"type":998,"value":2913},"Permission management systems often need to revoke access rights safely without causing system errors.",{"type":993,"tag":1007,"props":2915,"children":2916},{},[2917],{"type":993,"tag":1011,"props":2918,"children":2920},{"className":1013,"code":2919,"language":6,"meta":8,"style":8},"user_permissions = {'read', 'write', 'delete', 'admin'}\n\n# Revoke specific permission safely\nuser_permissions.discard('admin')\nprint(\"After revoking admin:\", user_permissions)\n\n# Revoke multiple permissions\nrevoke_permissions = {'delete', 'write'}\nuser_permissions -= revoke_permissions\nprint(\"After revoking delete and write:\", user_permissions)\n\n# Clear all permissions\nuser_permissions.clear()\nprint(\"After clearing all:\", user_permissions)\n",[2921],{"type":993,"tag":1017,"props":2922,"children":2923},{"__ignoreMap":8},[2924,2976,2983,2991,3007,3028,3035,3043,3075,3091,3111,3118,3126,3134],{"type":993,"tag":1021,"props":2925,"children":2926},{"class":1023,"line":12},[2927,2932,2936,2940,2945,2949,2954,2958,2963,2967,2972],{"type":993,"tag":1021,"props":2928,"children":2929},{"style":1036},[2930],{"type":998,"value":2931},"user_permissions ",{"type":993,"tag":1021,"props":2933,"children":2934},{"style":1042},[2935],{"type":998,"value":1045},{"type":993,"tag":1021,"props":2937,"children":2938},{"style":1036},[2939],{"type":998,"value":1050},{"type":993,"tag":1021,"props":2941,"children":2942},{"style":1053},[2943],{"type":998,"value":2944},"'read'",{"type":993,"tag":1021,"props":2946,"children":2947},{"style":1036},[2948],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2950,"children":2951},{"style":1053},[2952],{"type":998,"value":2953},"'write'",{"type":993,"tag":1021,"props":2955,"children":2956},{"style":1036},[2957],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2959,"children":2960},{"style":1053},[2961],{"type":998,"value":2962},"'delete'",{"type":993,"tag":1021,"props":2964,"children":2965},{"style":1036},[2966],{"type":998,"value":1061},{"type":993,"tag":1021,"props":2968,"children":2969},{"style":1053},[2970],{"type":998,"value":2971},"'admin'",{"type":993,"tag":1021,"props":2973,"children":2974},{"style":1036},[2975],{"type":998,"value":1089},{"type":993,"tag":1021,"props":2977,"children":2978},{"class":1023,"line":27},[2979],{"type":993,"tag":1021,"props":2980,"children":2981},{"emptyLinePlaceholder":13},[2982],{"type":998,"value":1121},{"type":993,"tag":1021,"props":2984,"children":2985},{"class":1023,"line":36},[2986],{"type":993,"tag":1021,"props":2987,"children":2988},{"style":1027},[2989],{"type":998,"value":2990},"# Revoke specific permission safely\n",{"type":993,"tag":1021,"props":2992,"children":2993},{"class":1023,"line":45},[2994,2999,3003],{"type":993,"tag":1021,"props":2995,"children":2996},{"style":1036},[2997],{"type":998,"value":2998},"user_permissions.discard(",{"type":993,"tag":1021,"props":3000,"children":3001},{"style":1053},[3002],{"type":998,"value":2971},{"type":993,"tag":1021,"props":3004,"children":3005},{"style":1036},[3006],{"type":998,"value":1146},{"type":993,"tag":1021,"props":3008,"children":3009},{"class":1023,"line":54},[3010,3014,3018,3023],{"type":993,"tag":1021,"props":3011,"children":3012},{"style":1095},[3013],{"type":998,"value":1098},{"type":993,"tag":1021,"props":3015,"children":3016},{"style":1036},[3017],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3019,"children":3020},{"style":1053},[3021],{"type":998,"value":3022},"\"After revoking admin:\"",{"type":993,"tag":1021,"props":3024,"children":3025},{"style":1036},[3026],{"type":998,"value":3027},", user_permissions)\n",{"type":993,"tag":1021,"props":3029,"children":3030},{"class":1023,"line":63},[3031],{"type":993,"tag":1021,"props":3032,"children":3033},{"emptyLinePlaceholder":13},[3034],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3036,"children":3037},{"class":1023,"line":72},[3038],{"type":993,"tag":1021,"props":3039,"children":3040},{"style":1027},[3041],{"type":998,"value":3042},"# Revoke multiple permissions\n",{"type":993,"tag":1021,"props":3044,"children":3045},{"class":1023,"line":81},[3046,3051,3055,3059,3063,3067,3071],{"type":993,"tag":1021,"props":3047,"children":3048},{"style":1036},[3049],{"type":998,"value":3050},"revoke_permissions ",{"type":993,"tag":1021,"props":3052,"children":3053},{"style":1042},[3054],{"type":998,"value":1045},{"type":993,"tag":1021,"props":3056,"children":3057},{"style":1036},[3058],{"type":998,"value":1050},{"type":993,"tag":1021,"props":3060,"children":3061},{"style":1053},[3062],{"type":998,"value":2962},{"type":993,"tag":1021,"props":3064,"children":3065},{"style":1036},[3066],{"type":998,"value":1061},{"type":993,"tag":1021,"props":3068,"children":3069},{"style":1053},[3070],{"type":998,"value":2953},{"type":993,"tag":1021,"props":3072,"children":3073},{"style":1036},[3074],{"type":998,"value":1089},{"type":993,"tag":1021,"props":3076,"children":3077},{"class":1023,"line":91},[3078,3082,3086],{"type":993,"tag":1021,"props":3079,"children":3080},{"style":1036},[3081],{"type":998,"value":2931},{"type":993,"tag":1021,"props":3083,"children":3084},{"style":1042},[3085],{"type":998,"value":2406},{"type":993,"tag":1021,"props":3087,"children":3088},{"style":1036},[3089],{"type":998,"value":3090}," revoke_permissions\n",{"type":993,"tag":1021,"props":3092,"children":3093},{"class":1023,"line":100},[3094,3098,3102,3107],{"type":993,"tag":1021,"props":3095,"children":3096},{"style":1095},[3097],{"type":998,"value":1098},{"type":993,"tag":1021,"props":3099,"children":3100},{"style":1036},[3101],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3103,"children":3104},{"style":1053},[3105],{"type":998,"value":3106},"\"After revoking delete and write:\"",{"type":993,"tag":1021,"props":3108,"children":3109},{"style":1036},[3110],{"type":998,"value":3027},{"type":993,"tag":1021,"props":3112,"children":3113},{"class":1023,"line":109},[3114],{"type":993,"tag":1021,"props":3115,"children":3116},{"emptyLinePlaceholder":13},[3117],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3119,"children":3120},{"class":1023,"line":118},[3121],{"type":993,"tag":1021,"props":3122,"children":3123},{"style":1027},[3124],{"type":998,"value":3125},"# Clear all permissions\n",{"type":993,"tag":1021,"props":3127,"children":3128},{"class":1023,"line":127},[3129],{"type":993,"tag":1021,"props":3130,"children":3131},{"style":1036},[3132],{"type":998,"value":3133},"user_permissions.clear()\n",{"type":993,"tag":1021,"props":3135,"children":3136},{"class":1023,"line":136},[3137,3141,3145,3150],{"type":993,"tag":1021,"props":3138,"children":3139},{"style":1095},[3140],{"type":998,"value":1098},{"type":993,"tag":1021,"props":3142,"children":3143},{"style":1036},[3144],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3146,"children":3147},{"style":1053},[3148],{"type":998,"value":3149},"\"After clearing all:\"",{"type":993,"tag":1021,"props":3151,"children":3152},{"style":1036},[3153],{"type":998,"value":3027},{"type":993,"tag":1168,"props":3155,"children":3157},{"id":3156},"error-handling-best-practices",[3158],{"type":998,"value":3159},"🌟 Error Handling Best Practices",{"type":993,"tag":1001,"props":3161,"children":3162},{},[3163],{"type":998,"value":3164},"Defensive programming techniques prevent runtime errors and improve application reliability when removing set elements.",{"type":993,"tag":1007,"props":3166,"children":3167},{},[3168],{"type":993,"tag":1011,"props":3169,"children":3171},{"className":1013,"code":3170,"language":6,"meta":8,"style":8},"my_set = {1, 2, 3}\n\n# Safe approach using discard()\nmy_set.discard(4)  # No error\nprint(\"After safe discard:\", my_set)\n\n# Error handling with remove()\ntry:\n    my_set.remove(4)\nexcept KeyError:\n    print(\"Element not found in set\")\n\n# Check before removing\nif 2 in my_set:\n    my_set.remove(2)\n    print(\"Successfully removed 2\")\n\nprint(\"Final set:\", my_set)\n",[3172],{"type":993,"tag":1017,"props":3173,"children":3174},{"__ignoreMap":8},[3175,3215,3222,3230,3251,3272,3279,3287,3299,3315,3332,3353,3360,3368,3391,3406,3426,3433],{"type":993,"tag":1021,"props":3176,"children":3177},{"class":1023,"line":12},[3178,3183,3187,3191,3195,3199,3203,3207,3211],{"type":993,"tag":1021,"props":3179,"children":3180},{"style":1036},[3181],{"type":998,"value":3182},"my_set ",{"type":993,"tag":1021,"props":3184,"children":3185},{"style":1042},[3186],{"type":998,"value":1045},{"type":993,"tag":1021,"props":3188,"children":3189},{"style":1036},[3190],{"type":998,"value":1050},{"type":993,"tag":1021,"props":3192,"children":3193},{"style":1095},[3194],{"type":998,"value":1587},{"type":993,"tag":1021,"props":3196,"children":3197},{"style":1036},[3198],{"type":998,"value":1061},{"type":993,"tag":1021,"props":3200,"children":3201},{"style":1095},[3202],{"type":998,"value":1596},{"type":993,"tag":1021,"props":3204,"children":3205},{"style":1036},[3206],{"type":998,"value":1061},{"type":993,"tag":1021,"props":3208,"children":3209},{"style":1095},[3210],{"type":998,"value":1605},{"type":993,"tag":1021,"props":3212,"children":3213},{"style":1036},[3214],{"type":998,"value":1089},{"type":993,"tag":1021,"props":3216,"children":3217},{"class":1023,"line":27},[3218],{"type":993,"tag":1021,"props":3219,"children":3220},{"emptyLinePlaceholder":13},[3221],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3223,"children":3224},{"class":1023,"line":36},[3225],{"type":993,"tag":1021,"props":3226,"children":3227},{"style":1027},[3228],{"type":998,"value":3229},"# Safe approach using discard()\n",{"type":993,"tag":1021,"props":3231,"children":3232},{"class":1023,"line":45},[3233,3238,3242,3246],{"type":993,"tag":1021,"props":3234,"children":3235},{"style":1036},[3236],{"type":998,"value":3237},"my_set.discard(",{"type":993,"tag":1021,"props":3239,"children":3240},{"style":1095},[3241],{"type":998,"value":1614},{"type":993,"tag":1021,"props":3243,"children":3244},{"style":1036},[3245],{"type":998,"value":1513},{"type":993,"tag":1021,"props":3247,"children":3248},{"style":1027},[3249],{"type":998,"value":3250},"# No error\n",{"type":993,"tag":1021,"props":3252,"children":3253},{"class":1023,"line":54},[3254,3258,3262,3267],{"type":993,"tag":1021,"props":3255,"children":3256},{"style":1095},[3257],{"type":998,"value":1098},{"type":993,"tag":1021,"props":3259,"children":3260},{"style":1036},[3261],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3263,"children":3264},{"style":1053},[3265],{"type":998,"value":3266},"\"After safe discard:\"",{"type":993,"tag":1021,"props":3268,"children":3269},{"style":1036},[3270],{"type":998,"value":3271},", my_set)\n",{"type":993,"tag":1021,"props":3273,"children":3274},{"class":1023,"line":63},[3275],{"type":993,"tag":1021,"props":3276,"children":3277},{"emptyLinePlaceholder":13},[3278],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3280,"children":3281},{"class":1023,"line":72},[3282],{"type":993,"tag":1021,"props":3283,"children":3284},{"style":1027},[3285],{"type":998,"value":3286},"# Error handling with remove()\n",{"type":993,"tag":1021,"props":3288,"children":3289},{"class":1023,"line":81},[3290,3295],{"type":993,"tag":1021,"props":3291,"children":3292},{"style":1042},[3293],{"type":998,"value":3294},"try",{"type":993,"tag":1021,"props":3296,"children":3297},{"style":1036},[3298],{"type":998,"value":2785},{"type":993,"tag":1021,"props":3300,"children":3301},{"class":1023,"line":91},[3302,3307,3311],{"type":993,"tag":1021,"props":3303,"children":3304},{"style":1036},[3305],{"type":998,"value":3306},"    my_set.remove(",{"type":993,"tag":1021,"props":3308,"children":3309},{"style":1095},[3310],{"type":998,"value":1614},{"type":993,"tag":1021,"props":3312,"children":3313},{"style":1036},[3314],{"type":998,"value":1146},{"type":993,"tag":1021,"props":3316,"children":3317},{"class":1023,"line":100},[3318,3323,3328],{"type":993,"tag":1021,"props":3319,"children":3320},{"style":1042},[3321],{"type":998,"value":3322},"except",{"type":993,"tag":1021,"props":3324,"children":3325},{"style":1095},[3326],{"type":998,"value":3327}," KeyError",{"type":993,"tag":1021,"props":3329,"children":3330},{"style":1036},[3331],{"type":998,"value":2785},{"type":993,"tag":1021,"props":3333,"children":3334},{"class":1023,"line":109},[3335,3340,3344,3349],{"type":993,"tag":1021,"props":3336,"children":3337},{"style":1095},[3338],{"type":998,"value":3339},"    print",{"type":993,"tag":1021,"props":3341,"children":3342},{"style":1036},[3343],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3345,"children":3346},{"style":1053},[3347],{"type":998,"value":3348},"\"Element not found in set\"",{"type":993,"tag":1021,"props":3350,"children":3351},{"style":1036},[3352],{"type":998,"value":1146},{"type":993,"tag":1021,"props":3354,"children":3355},{"class":1023,"line":118},[3356],{"type":993,"tag":1021,"props":3357,"children":3358},{"emptyLinePlaceholder":13},[3359],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3361,"children":3362},{"class":1023,"line":127},[3363],{"type":993,"tag":1021,"props":3364,"children":3365},{"style":1027},[3366],{"type":998,"value":3367},"# Check before removing\n",{"type":993,"tag":1021,"props":3369,"children":3370},{"class":1023,"line":136},[3371,3376,3381,3386],{"type":993,"tag":1021,"props":3372,"children":3373},{"style":1042},[3374],{"type":998,"value":3375},"if",{"type":993,"tag":1021,"props":3377,"children":3378},{"style":1095},[3379],{"type":998,"value":3380}," 2",{"type":993,"tag":1021,"props":3382,"children":3383},{"style":1042},[3384],{"type":998,"value":3385}," in",{"type":993,"tag":1021,"props":3387,"children":3388},{"style":1036},[3389],{"type":998,"value":3390}," my_set:\n",{"type":993,"tag":1021,"props":3392,"children":3393},{"class":1023,"line":146},[3394,3398,3402],{"type":993,"tag":1021,"props":3395,"children":3396},{"style":1036},[3397],{"type":998,"value":3306},{"type":993,"tag":1021,"props":3399,"children":3400},{"style":1095},[3401],{"type":998,"value":1596},{"type":993,"tag":1021,"props":3403,"children":3404},{"style":1036},[3405],{"type":998,"value":1146},{"type":993,"tag":1021,"props":3407,"children":3408},{"class":1023,"line":155},[3409,3413,3417,3422],{"type":993,"tag":1021,"props":3410,"children":3411},{"style":1095},[3412],{"type":998,"value":3339},{"type":993,"tag":1021,"props":3414,"children":3415},{"style":1036},[3416],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3418,"children":3419},{"style":1053},[3420],{"type":998,"value":3421},"\"Successfully removed 2\"",{"type":993,"tag":1021,"props":3423,"children":3424},{"style":1036},[3425],{"type":998,"value":1146},{"type":993,"tag":1021,"props":3427,"children":3428},{"class":1023,"line":164},[3429],{"type":993,"tag":1021,"props":3430,"children":3431},{"emptyLinePlaceholder":13},[3432],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3434,"children":3435},{"class":1023,"line":173},[3436,3440,3444,3449],{"type":993,"tag":1021,"props":3437,"children":3438},{"style":1095},[3439],{"type":998,"value":1098},{"type":993,"tag":1021,"props":3441,"children":3442},{"style":1036},[3443],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3445,"children":3446},{"style":1053},[3447],{"type":998,"value":3448},"\"Final set:\"",{"type":993,"tag":1021,"props":3450,"children":3451},{"style":1036},[3452],{"type":998,"value":3271},{"type":993,"tag":1316,"props":3454,"children":3458},{"emoji":3455,"title":3456,"type":3457},"✅","Best Practices","success",[3459,3483,3493,3510],{"type":993,"tag":1001,"props":3460,"children":3461},{},[3462,3467,3469,3474,3476,3481],{"type":993,"tag":1325,"props":3463,"children":3464},{},[3465],{"type":998,"value":3466},"Choose the Right Method:",{"type":998,"value":3468}," Use ",{"type":993,"tag":1017,"props":3470,"children":3472},{"className":3471},[],[3473],{"type":998,"value":1374},{"type":998,"value":3475}," for safe removal, ",{"type":993,"tag":1017,"props":3477,"children":3479},{"className":3478},[],[3480],{"type":998,"value":1184},{"type":998,"value":3482}," when you need error feedback.",{"type":993,"tag":1001,"props":3484,"children":3485},{},[3486,3491],{"type":993,"tag":1325,"props":3487,"children":3488},{},[3489],{"type":998,"value":3490},"Bulk Operations:",{"type":998,"value":3492}," Consider set difference for removing multiple elements efficiently.",{"type":993,"tag":1001,"props":3494,"children":3495},{},[3496,3501,3503,3508],{"type":993,"tag":1325,"props":3497,"children":3498},{},[3499],{"type":998,"value":3500},"Error Prevention:",{"type":998,"value":3502}," Always validate element existence when using ",{"type":993,"tag":1017,"props":3504,"children":3506},{"className":3505},[],[3507],{"type":998,"value":1184},{"type":998,"value":3509}," in production code.",{"type":993,"tag":1001,"props":3511,"children":3512},{},[3513,3518,3519,3524],{"type":993,"tag":1325,"props":3514,"children":3515},{},[3516],{"type":998,"value":3517},"Performance:",{"type":998,"value":3468},{"type":993,"tag":1017,"props":3520,"children":3522},{"className":3521},[],[3523],{"type":998,"value":1779},{"type":998,"value":3525}," instead of loops for emptying large sets.",{"type":993,"tag":3527,"props":3528,"children":3530},"content-exercise",{":widget-view":3529,"category":6,"id":483},"true",[],{"type":993,"tag":1001,"props":3532,"children":3533},{},[3534,3536,3542,3544,3549],{"type":998,"value":3535},"Learn more about ",{"type":993,"tag":3537,"props":3538,"children":3539},"a",{"href":489},[3540],{"type":998,"value":3541},"iterating sets",{"type":998,"value":3543}," and ",{"type":993,"tag":3537,"props":3545,"children":3546},{"href":507},[3547],{"type":998,"value":3548},"set operations",{"type":998,"value":3550}," to master complete set manipulation.",{"type":993,"tag":3552,"props":3553,"children":3556},"exercise",{"hint":3554,"prompt":3555},"Use discard() method to remove items safely, and print messages to show what happened","Create a function that removes an item from a shopping cart set. Use discard() to safely remove items without causing errors if the item doesn't exist.",[3557],{"type":993,"tag":1011,"props":3558,"children":3560},{"className":1013,"code":3559,"language":6,"meta":8,"style":8},"def remove_from_cart(cart, item):\n    # TODO: Check if item is in cart\n    # TODO: Remove using discard() method\n    # TODO: Print appropriate message\n    pass\n\n# Test data\nshopping_cart = {'laptop', 'mouse', 'keyboard', 'monitor'}\n\nprint(f\"Shopping cart: {shopping_cart}\")\nremove_from_cart(shopping_cart, 'mouse')\nremove_from_cart(shopping_cart, 'tablet')  # Not in cart\nprint(f\"Updated cart: {shopping_cart}\")\n",[3561],{"type":993,"tag":1017,"props":3562,"children":3563},{"__ignoreMap":8},[3564,3581,3599,3615,3631,3639,3646,3654,3702,3709,3750,3766,3786],{"type":993,"tag":1021,"props":3565,"children":3566},{"class":1023,"line":12},[3567,3571,3576],{"type":993,"tag":1021,"props":3568,"children":3569},{"style":1042},[3570],{"type":998,"value":2672},{"type":993,"tag":1021,"props":3572,"children":3573},{"style":2675},[3574],{"type":998,"value":3575}," remove_from_cart",{"type":993,"tag":1021,"props":3577,"children":3578},{"style":1036},[3579],{"type":998,"value":3580},"(cart, item):\n",{"type":993,"tag":1021,"props":3582,"children":3583},{"class":1023,"line":27},[3584,3589,3594],{"type":993,"tag":1021,"props":3585,"children":3586},{"style":1027},[3587],{"type":998,"value":3588},"    # ",{"type":993,"tag":1021,"props":3590,"children":3591},{"style":1042},[3592],{"type":998,"value":3593},"TODO",{"type":993,"tag":1021,"props":3595,"children":3596},{"style":1027},[3597],{"type":998,"value":3598},": Check if item is in cart\n",{"type":993,"tag":1021,"props":3600,"children":3601},{"class":1023,"line":36},[3602,3606,3610],{"type":993,"tag":1021,"props":3603,"children":3604},{"style":1027},[3605],{"type":998,"value":3588},{"type":993,"tag":1021,"props":3607,"children":3608},{"style":1042},[3609],{"type":998,"value":3593},{"type":993,"tag":1021,"props":3611,"children":3612},{"style":1027},[3613],{"type":998,"value":3614},": Remove using discard() method\n",{"type":993,"tag":1021,"props":3616,"children":3617},{"class":1023,"line":45},[3618,3622,3626],{"type":993,"tag":1021,"props":3619,"children":3620},{"style":1027},[3621],{"type":998,"value":3588},{"type":993,"tag":1021,"props":3623,"children":3624},{"style":1042},[3625],{"type":998,"value":3593},{"type":993,"tag":1021,"props":3627,"children":3628},{"style":1027},[3629],{"type":998,"value":3630},": Print appropriate message\n",{"type":993,"tag":1021,"props":3632,"children":3633},{"class":1023,"line":54},[3634],{"type":993,"tag":1021,"props":3635,"children":3636},{"style":1042},[3637],{"type":998,"value":3638},"    pass\n",{"type":993,"tag":1021,"props":3640,"children":3641},{"class":1023,"line":63},[3642],{"type":993,"tag":1021,"props":3643,"children":3644},{"emptyLinePlaceholder":13},[3645],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3647,"children":3648},{"class":1023,"line":72},[3649],{"type":993,"tag":1021,"props":3650,"children":3651},{"style":1027},[3652],{"type":998,"value":3653},"# Test data\n",{"type":993,"tag":1021,"props":3655,"children":3656},{"class":1023,"line":81},[3657,3662,3666,3670,3674,3678,3682,3686,3690,3694,3698],{"type":993,"tag":1021,"props":3658,"children":3659},{"style":1036},[3660],{"type":998,"value":3661},"shopping_cart ",{"type":993,"tag":1021,"props":3663,"children":3664},{"style":1042},[3665],{"type":998,"value":1045},{"type":993,"tag":1021,"props":3667,"children":3668},{"style":1036},[3669],{"type":998,"value":1050},{"type":993,"tag":1021,"props":3671,"children":3672},{"style":1053},[3673],{"type":998,"value":2626},{"type":993,"tag":1021,"props":3675,"children":3676},{"style":1036},[3677],{"type":998,"value":1061},{"type":993,"tag":1021,"props":3679,"children":3680},{"style":1053},[3681],{"type":998,"value":2635},{"type":993,"tag":1021,"props":3683,"children":3684},{"style":1036},[3685],{"type":998,"value":1061},{"type":993,"tag":1021,"props":3687,"children":3688},{"style":1053},[3689],{"type":998,"value":2644},{"type":993,"tag":1021,"props":3691,"children":3692},{"style":1036},[3693],{"type":998,"value":1061},{"type":993,"tag":1021,"props":3695,"children":3696},{"style":1053},[3697],{"type":998,"value":2653},{"type":993,"tag":1021,"props":3699,"children":3700},{"style":1036},[3701],{"type":998,"value":1089},{"type":993,"tag":1021,"props":3703,"children":3704},{"class":1023,"line":91},[3705],{"type":993,"tag":1021,"props":3706,"children":3707},{"emptyLinePlaceholder":13},[3708],{"type":998,"value":1121},{"type":993,"tag":1021,"props":3710,"children":3711},{"class":1023,"line":100},[3712,3716,3720,3724,3729,3733,3738,3742,3746],{"type":993,"tag":1021,"props":3713,"children":3714},{"style":1095},[3715],{"type":998,"value":1098},{"type":993,"tag":1021,"props":3717,"children":3718},{"style":1036},[3719],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3721,"children":3722},{"style":1042},[3723],{"type":998,"value":2730},{"type":993,"tag":1021,"props":3725,"children":3726},{"style":1053},[3727],{"type":998,"value":3728},"\"Shopping cart: ",{"type":993,"tag":1021,"props":3730,"children":3731},{"style":1095},[3732],{"type":998,"value":2740},{"type":993,"tag":1021,"props":3734,"children":3735},{"style":1036},[3736],{"type":998,"value":3737},"shopping_cart",{"type":993,"tag":1021,"props":3739,"children":3740},{"style":1095},[3741],{"type":998,"value":2750},{"type":993,"tag":1021,"props":3743,"children":3744},{"style":1053},[3745],{"type":998,"value":2755},{"type":993,"tag":1021,"props":3747,"children":3748},{"style":1036},[3749],{"type":998,"value":1146},{"type":993,"tag":1021,"props":3751,"children":3752},{"class":1023,"line":109},[3753,3758,3762],{"type":993,"tag":1021,"props":3754,"children":3755},{"style":1036},[3756],{"type":998,"value":3757},"remove_from_cart(shopping_cart, ",{"type":993,"tag":1021,"props":3759,"children":3760},{"style":1053},[3761],{"type":998,"value":2635},{"type":993,"tag":1021,"props":3763,"children":3764},{"style":1036},[3765],{"type":998,"value":1146},{"type":993,"tag":1021,"props":3767,"children":3768},{"class":1023,"line":118},[3769,3773,3777,3781],{"type":993,"tag":1021,"props":3770,"children":3771},{"style":1036},[3772],{"type":998,"value":3757},{"type":993,"tag":1021,"props":3774,"children":3775},{"style":1053},[3776],{"type":998,"value":2872},{"type":993,"tag":1021,"props":3778,"children":3779},{"style":1036},[3780],{"type":998,"value":1513},{"type":993,"tag":1021,"props":3782,"children":3783},{"style":1027},[3784],{"type":998,"value":3785},"# Not in cart\n",{"type":993,"tag":1021,"props":3787,"children":3788},{"class":1023,"line":127},[3789,3793,3797,3801,3806,3810,3814,3818,3822],{"type":993,"tag":1021,"props":3790,"children":3791},{"style":1095},[3792],{"type":998,"value":1098},{"type":993,"tag":1021,"props":3794,"children":3795},{"style":1036},[3796],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3798,"children":3799},{"style":1042},[3800],{"type":998,"value":2730},{"type":993,"tag":1021,"props":3802,"children":3803},{"style":1053},[3804],{"type":998,"value":3805},"\"Updated cart: ",{"type":993,"tag":1021,"props":3807,"children":3808},{"style":1095},[3809],{"type":998,"value":2740},{"type":993,"tag":1021,"props":3811,"children":3812},{"style":1036},[3813],{"type":998,"value":3737},{"type":993,"tag":1021,"props":3815,"children":3816},{"style":1095},[3817],{"type":998,"value":2750},{"type":993,"tag":1021,"props":3819,"children":3820},{"style":1053},[3821],{"type":998,"value":2755},{"type":993,"tag":1021,"props":3823,"children":3824},{"style":1036},[3825],{"type":998,"value":1146},{"type":993,"tag":1947,"props":3827,"children":3829},{"id":3828},"solution-and-explanation",[3830],{"type":998,"value":3831},"Solution and Explanation 💡",{"type":993,"tag":3833,"props":3834,"children":3835},"details",{},[3836,3844,4187,4195],{"type":993,"tag":3837,"props":3838,"children":3841},"summary",{"className":3839},[3840],"cursor-pointer",[3842],{"type":998,"value":3843},"Click to see the complete solution",{"type":993,"tag":1007,"props":3845,"children":3846},{},[3847],{"type":993,"tag":1011,"props":3848,"children":3850},{"className":1013,"code":3849,"language":6,"meta":8,"style":8},"def remove_from_cart(cart, item):\n    # Check if item is in cart\n    if item in cart:\n        # Remove using discard() method\n        cart.discard(item)\n        print(f\"Removed '{item}' from cart\")\n    else:\n        print(f\"'{item}' is not in the cart\")\n\n# Test data\nshopping_cart = {'laptop', 'mouse', 'keyboard', 'monitor'}\n\nprint(f\"Shopping cart: {shopping_cart}\")\nremove_from_cart(shopping_cart, 'mouse')\nremove_from_cart(shopping_cart, 'tablet')  # Not in cart\nprint(f\"Updated cart: {shopping_cart}\")\n",[3851],{"type":993,"tag":1017,"props":3852,"children":3853},{"__ignoreMap":8},[3854,3869,3877,3897,3905,3913,3955,3966,4007,4014,4021,4068,4075,4114,4129,4148],{"type":993,"tag":1021,"props":3855,"children":3856},{"class":1023,"line":12},[3857,3861,3865],{"type":993,"tag":1021,"props":3858,"children":3859},{"style":1042},[3860],{"type":998,"value":2672},{"type":993,"tag":1021,"props":3862,"children":3863},{"style":2675},[3864],{"type":998,"value":3575},{"type":993,"tag":1021,"props":3866,"children":3867},{"style":1036},[3868],{"type":998,"value":3580},{"type":993,"tag":1021,"props":3870,"children":3871},{"class":1023,"line":27},[3872],{"type":993,"tag":1021,"props":3873,"children":3874},{"style":1027},[3875],{"type":998,"value":3876},"    # Check if item is in cart\n",{"type":993,"tag":1021,"props":3878,"children":3879},{"class":1023,"line":36},[3880,3884,3888,3892],{"type":993,"tag":1021,"props":3881,"children":3882},{"style":1042},[3883],{"type":998,"value":2691},{"type":993,"tag":1021,"props":3885,"children":3886},{"style":1036},[3887],{"type":998,"value":2136},{"type":993,"tag":1021,"props":3889,"children":3890},{"style":1042},[3891],{"type":998,"value":2141},{"type":993,"tag":1021,"props":3893,"children":3894},{"style":1036},[3895],{"type":998,"value":3896}," cart:\n",{"type":993,"tag":1021,"props":3898,"children":3899},{"class":1023,"line":45},[3900],{"type":993,"tag":1021,"props":3901,"children":3902},{"style":1027},[3903],{"type":998,"value":3904},"        # Remove using discard() method\n",{"type":993,"tag":1021,"props":3906,"children":3907},{"class":1023,"line":54},[3908],{"type":993,"tag":1021,"props":3909,"children":3910},{"style":1036},[3911],{"type":998,"value":3912},"        cart.discard(item)\n",{"type":993,"tag":1021,"props":3914,"children":3915},{"class":1023,"line":63},[3916,3920,3924,3928,3933,3937,3942,3946,3951],{"type":993,"tag":1021,"props":3917,"children":3918},{"style":1095},[3919],{"type":998,"value":2721},{"type":993,"tag":1021,"props":3921,"children":3922},{"style":1036},[3923],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3925,"children":3926},{"style":1042},[3927],{"type":998,"value":2730},{"type":993,"tag":1021,"props":3929,"children":3930},{"style":1053},[3931],{"type":998,"value":3932},"\"Removed '",{"type":993,"tag":1021,"props":3934,"children":3935},{"style":1095},[3936],{"type":998,"value":2740},{"type":993,"tag":1021,"props":3938,"children":3939},{"style":1036},[3940],{"type":998,"value":3941},"item",{"type":993,"tag":1021,"props":3943,"children":3944},{"style":1095},[3945],{"type":998,"value":2750},{"type":993,"tag":1021,"props":3947,"children":3948},{"style":1053},[3949],{"type":998,"value":3950},"' from cart\"",{"type":993,"tag":1021,"props":3952,"children":3953},{"style":1036},[3954],{"type":998,"value":1146},{"type":993,"tag":1021,"props":3956,"children":3957},{"class":1023,"line":72},[3958,3962],{"type":993,"tag":1021,"props":3959,"children":3960},{"style":1042},[3961],{"type":998,"value":2780},{"type":993,"tag":1021,"props":3963,"children":3964},{"style":1036},[3965],{"type":998,"value":2785},{"type":993,"tag":1021,"props":3967,"children":3968},{"class":1023,"line":81},[3969,3973,3977,3981,3986,3990,3994,3998,4003],{"type":993,"tag":1021,"props":3970,"children":3971},{"style":1095},[3972],{"type":998,"value":2721},{"type":993,"tag":1021,"props":3974,"children":3975},{"style":1036},[3976],{"type":998,"value":1103},{"type":993,"tag":1021,"props":3978,"children":3979},{"style":1042},[3980],{"type":998,"value":2730},{"type":993,"tag":1021,"props":3982,"children":3983},{"style":1053},[3984],{"type":998,"value":3985},"\"'",{"type":993,"tag":1021,"props":3987,"children":3988},{"style":1095},[3989],{"type":998,"value":2740},{"type":993,"tag":1021,"props":3991,"children":3992},{"style":1036},[3993],{"type":998,"value":3941},{"type":993,"tag":1021,"props":3995,"children":3996},{"style":1095},[3997],{"type":998,"value":2750},{"type":993,"tag":1021,"props":3999,"children":4000},{"style":1053},[4001],{"type":998,"value":4002},"' is not in the cart\"",{"type":993,"tag":1021,"props":4004,"children":4005},{"style":1036},[4006],{"type":998,"value":1146},{"type":993,"tag":1021,"props":4008,"children":4009},{"class":1023,"line":91},[4010],{"type":993,"tag":1021,"props":4011,"children":4012},{"emptyLinePlaceholder":13},[4013],{"type":998,"value":1121},{"type":993,"tag":1021,"props":4015,"children":4016},{"class":1023,"line":100},[4017],{"type":993,"tag":1021,"props":4018,"children":4019},{"style":1027},[4020],{"type":998,"value":3653},{"type":993,"tag":1021,"props":4022,"children":4023},{"class":1023,"line":109},[4024,4028,4032,4036,4040,4044,4048,4052,4056,4060,4064],{"type":993,"tag":1021,"props":4025,"children":4026},{"style":1036},[4027],{"type":998,"value":3661},{"type":993,"tag":1021,"props":4029,"children":4030},{"style":1042},[4031],{"type":998,"value":1045},{"type":993,"tag":1021,"props":4033,"children":4034},{"style":1036},[4035],{"type":998,"value":1050},{"type":993,"tag":1021,"props":4037,"children":4038},{"style":1053},[4039],{"type":998,"value":2626},{"type":993,"tag":1021,"props":4041,"children":4042},{"style":1036},[4043],{"type":998,"value":1061},{"type":993,"tag":1021,"props":4045,"children":4046},{"style":1053},[4047],{"type":998,"value":2635},{"type":993,"tag":1021,"props":4049,"children":4050},{"style":1036},[4051],{"type":998,"value":1061},{"type":993,"tag":1021,"props":4053,"children":4054},{"style":1053},[4055],{"type":998,"value":2644},{"type":993,"tag":1021,"props":4057,"children":4058},{"style":1036},[4059],{"type":998,"value":1061},{"type":993,"tag":1021,"props":4061,"children":4062},{"style":1053},[4063],{"type":998,"value":2653},{"type":993,"tag":1021,"props":4065,"children":4066},{"style":1036},[4067],{"type":998,"value":1089},{"type":993,"tag":1021,"props":4069,"children":4070},{"class":1023,"line":118},[4071],{"type":993,"tag":1021,"props":4072,"children":4073},{"emptyLinePlaceholder":13},[4074],{"type":998,"value":1121},{"type":993,"tag":1021,"props":4076,"children":4077},{"class":1023,"line":127},[4078,4082,4086,4090,4094,4098,4102,4106,4110],{"type":993,"tag":1021,"props":4079,"children":4080},{"style":1095},[4081],{"type":998,"value":1098},{"type":993,"tag":1021,"props":4083,"children":4084},{"style":1036},[4085],{"type":998,"value":1103},{"type":993,"tag":1021,"props":4087,"children":4088},{"style":1042},[4089],{"type":998,"value":2730},{"type":993,"tag":1021,"props":4091,"children":4092},{"style":1053},[4093],{"type":998,"value":3728},{"type":993,"tag":1021,"props":4095,"children":4096},{"style":1095},[4097],{"type":998,"value":2740},{"type":993,"tag":1021,"props":4099,"children":4100},{"style":1036},[4101],{"type":998,"value":3737},{"type":993,"tag":1021,"props":4103,"children":4104},{"style":1095},[4105],{"type":998,"value":2750},{"type":993,"tag":1021,"props":4107,"children":4108},{"style":1053},[4109],{"type":998,"value":2755},{"type":993,"tag":1021,"props":4111,"children":4112},{"style":1036},[4113],{"type":998,"value":1146},{"type":993,"tag":1021,"props":4115,"children":4116},{"class":1023,"line":136},[4117,4121,4125],{"type":993,"tag":1021,"props":4118,"children":4119},{"style":1036},[4120],{"type":998,"value":3757},{"type":993,"tag":1021,"props":4122,"children":4123},{"style":1053},[4124],{"type":998,"value":2635},{"type":993,"tag":1021,"props":4126,"children":4127},{"style":1036},[4128],{"type":998,"value":1146},{"type":993,"tag":1021,"props":4130,"children":4131},{"class":1023,"line":146},[4132,4136,4140,4144],{"type":993,"tag":1021,"props":4133,"children":4134},{"style":1036},[4135],{"type":998,"value":3757},{"type":993,"tag":1021,"props":4137,"children":4138},{"style":1053},[4139],{"type":998,"value":2872},{"type":993,"tag":1021,"props":4141,"children":4142},{"style":1036},[4143],{"type":998,"value":1513},{"type":993,"tag":1021,"props":4145,"children":4146},{"style":1027},[4147],{"type":998,"value":3785},{"type":993,"tag":1021,"props":4149,"children":4150},{"class":1023,"line":155},[4151,4155,4159,4163,4167,4171,4175,4179,4183],{"type":993,"tag":1021,"props":4152,"children":4153},{"style":1095},[4154],{"type":998,"value":1098},{"type":993,"tag":1021,"props":4156,"children":4157},{"style":1036},[4158],{"type":998,"value":1103},{"type":993,"tag":1021,"props":4160,"children":4161},{"style":1042},[4162],{"type":998,"value":2730},{"type":993,"tag":1021,"props":4164,"children":4165},{"style":1053},[4166],{"type":998,"value":3805},{"type":993,"tag":1021,"props":4168,"children":4169},{"style":1095},[4170],{"type":998,"value":2740},{"type":993,"tag":1021,"props":4172,"children":4173},{"style":1036},[4174],{"type":998,"value":3737},{"type":993,"tag":1021,"props":4176,"children":4177},{"style":1095},[4178],{"type":998,"value":2750},{"type":993,"tag":1021,"props":4180,"children":4181},{"style":1053},[4182],{"type":998,"value":2755},{"type":993,"tag":1021,"props":4184,"children":4185},{"style":1036},[4186],{"type":998,"value":1146},{"type":993,"tag":1001,"props":4188,"children":4189},{},[4190],{"type":993,"tag":1325,"props":4191,"children":4192},{},[4193],{"type":998,"value":4194},"Key Learning Points:",{"type":993,"tag":4196,"props":4197,"children":4198},"ul",{},[4199,4212,4230,4240],{"type":993,"tag":4200,"props":4201,"children":4202},"li",{},[4203,4205,4210],{"type":998,"value":4204},"📌 ",{"type":993,"tag":1325,"props":4206,"children":4207},{},[4208],{"type":998,"value":4209},"discard() method",{"type":998,"value":4211},": Safely removes items without raising errors if item doesn't exist",{"type":993,"tag":4200,"props":4213,"children":4214},{},[4215,4216,4221,4223,4228],{"type":998,"value":4204},{"type":993,"tag":1325,"props":4217,"children":4218},{},[4219],{"type":998,"value":4220},"Membership check",{"type":998,"value":4222},": Use ",{"type":993,"tag":1017,"props":4224,"children":4226},{"className":4225},[],[4227],{"type":998,"value":2141},{"type":998,"value":4229}," to check if item exists before removal for better feedback",{"type":993,"tag":4200,"props":4231,"children":4232},{},[4233,4234,4238],{"type":998,"value":4204},{"type":993,"tag":1325,"props":4235,"children":4236},{},[4237],{"type":998,"value":2527},{"type":998,"value":4239},": discard() won't crash your program if item is missing",{"type":993,"tag":4200,"props":4241,"children":4242},{},[4243,4244,4249],{"type":998,"value":4204},{"type":993,"tag":1325,"props":4245,"children":4246},{},[4247],{"type":998,"value":4248},"User feedback",{"type":998,"value":4250},": Always inform users about what happened during the operation",{"type":993,"tag":1168,"props":4252,"children":4254},{"id":4253},"test-your-knowledge",[4255],{"type":998,"value":4256},"Test Your Knowledge",{"type":993,"tag":1001,"props":4258,"children":4259},{},[4260],{"type":998,"value":4261},"Test what you've learned about removing elements from sets:",{"type":993,"tag":4263,"props":4264,"children":4268},"redirect-button",{"icon":4265,"label":4266,"url":4267},"pi pi-send","Take Quiz","/tutorial-quiz/python/removing-from-sets",[],{"type":993,"tag":1168,"props":4270,"children":4272},{"id":4271},"whats-next",[4273],{"type":998,"value":4274},"What's Next?",{"type":993,"tag":1001,"props":4276,"children":4277},{},[4278,4280,4284],{"type":998,"value":4279},"In the next lesson, we'll explore ",{"type":993,"tag":3537,"props":4281,"children":4282},{"href":489},[4283],{"type":998,"value":490},{"type":998,"value":4285},", where you'll learn different ways to loop through set elements and work with them efficiently.",{"type":993,"tag":1001,"props":4287,"children":4288},{},[4289,4291,4295],{"type":998,"value":4290},"Ready to continue? Check out our lesson on ",{"type":993,"tag":3537,"props":4292,"children":4293},{"href":489},[4294],{"type":998,"value":490},{"type":998,"value":4296},".",{"type":993,"tag":4298,"props":4299,"children":4300},"style",{},[4301],{"type":998,"value":4302},"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":4304},[4305,4306,4307,4308,4309,4313,4314,4318,4321,4322],{"id":1170,"depth":27,"text":1173},{"id":1361,"depth":27,"text":1364},{"id":1541,"depth":27,"text":1544},{"id":1766,"depth":27,"text":1769},{"id":1937,"depth":27,"text":1940,"children":4310},[4311,4312],{"id":1949,"depth":36,"text":1952},{"id":2185,"depth":36,"text":2188},{"id":2433,"depth":27,"text":2436},{"id":2581,"depth":27,"text":2584,"children":4315},[4316,4317],{"id":2587,"depth":36,"text":2590},{"id":2905,"depth":36,"text":2908},{"id":3156,"depth":27,"text":3159,"children":4319},[4320],{"id":3828,"depth":36,"text":3831},{"id":4253,"depth":27,"text":4256},{"id":4271,"depth":27,"text":4274},1782373741538]