[{"data":1,"prerenderedAt":8844},["ShallowReactive",2],{"tutorials-python":3,"category-items-python":987,"content-/python/special-methods":988},[4,22,31,40,49,58,67,76,86,95,104,113,122,131,141,150,159,168,177,186,196,205,214,223,233,242,251,260,269,279,288,297,306,315,324,333,342,351,360,369,379,388,397,406,415,424,433,442,452,461,470,479,488,497,506,515,525,534,543,552,561,570,579,588,597,606,616,625,634,643,652,661,670,680,689,698,707,716,725,734,744,753,762,771,780,789,798,807,817,826,835,844,853,863,872,881,890,900,909,918,927,936,945,953,961,970,979],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"slug":11,"order":12,"isParent":13,"icon":14,"_type":15,"_id":16,"_source":17,"_file":18,"_stem":19,"_extension":20,"children":21,"expanded":13},"/python/getting-started","python",false,"","Getting Started","Begin your Python programming journey. Learn what Python is, how to set it up, and write your first programs. Perfect for complete beginners starting their coding adventure.","getting-started",1,true,"pi pi-folder","markdown","content:python:1.getting-started.md","content","python/1.getting-started.md","python/1.getting-started","md",[22,31,40,49,58,67],{"_path":23,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":15,"_id":28,"_source":17,"_file":29,"_stem":30,"_extension":20},"/python/what-is-python","What is Python","Discover Python's fascinating history, design philosophy, and key features. Learn why Python has become one of the world's most popular programming languages and perfect for beginners.","what-is-python",2,"content:python:2.what-is-python.md","python/2.what-is-python.md","python/2.what-is-python",{"_path":32,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":15,"_id":37,"_source":17,"_file":38,"_stem":39,"_extension":20},"/python/setup-python","Setup Python","Learn how to install Python on your computer and set up your development environment. Step-by-step guide for Windows, macOS, and Linux with beginner-friendly instructions.","setup-python",3,"content:python:3.setup-python.md","python/3.setup-python.md","python/3.setup-python",{"_path":41,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":15,"_id":46,"_source":17,"_file":47,"_stem":48,"_extension":20},"/python/your-first-program","Your First Program","Write and run your first Python program! Learn the basics of Python programming with simple examples and step-by-step instructions for beginners.","your-first-program",4,"content:python:4.your-first-program.md","python/4.your-first-program.md","python/4.your-first-program",{"_path":50,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":15,"_id":55,"_source":17,"_file":56,"_stem":57,"_extension":20},"/python/python-code-structure","Python Code Structure","Learn how Python code is organized and structured. Understand indentation, line breaks, and the basic rules that make Python programs work correctly.","python-code-structure",5,"content:python:5.python-code-structure.md","python/5.python-code-structure.md","python/5.python-code-structure",{"_path":59,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":15,"_id":64,"_source":17,"_file":65,"_stem":66,"_extension":20},"/python/writing-comments","Writing Comments","Learn how to write effective comments in Python. Discover when and how to document your code to make it clear, maintainable, and easy to understand.","writing-comments",6,"content:python:6.writing-comments.md","python/6.writing-comments.md","python/6.writing-comments",{"_path":68,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":69,"description":70,"slug":71,"parentId":5,"order":72,"_type":15,"_id":73,"_source":17,"_file":74,"_stem":75,"_extension":20},"/python/working-with-variables","Working with Variables","Learn how to create, use, and manage variables in Python. Understand how to store data, change values, and follow naming conventions for clean, readable code.","working-with-variables",7,"content:python:7.working-with-variables.md","python/7.working-with-variables.md","python/7.working-with-variables",{"_path":77,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":78,"description":79,"slug":80,"order":81,"isParent":13,"icon":14,"_type":15,"_id":82,"_source":17,"_file":83,"_stem":84,"_extension":20,"children":85,"expanded":13},"/python/basic-data-types","Basic Data Types","Learn about Python's fundamental data types including numbers, text, and boolean values","basic-data-types",8,"content:python:8.basic-data-types.md","python/8.basic-data-types.md","python/8.basic-data-types",[86,95,104,113,122],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":91,"_type":15,"_id":92,"_source":17,"_file":93,"_stem":94,"_extension":20},"/python/understanding-data-types","Understanding Data Types","Learn how Python identifies different data types and why they're important for programming","understanding-data-types",9,"content:python:9.understanding-data-types.md","python/9.understanding-data-types.md","python/9.understanding-data-types",{"_path":96,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":97,"description":98,"slug":99,"parentId":77,"order":100,"_type":15,"_id":101,"_source":17,"_file":102,"_stem":103,"_extension":20},"/python/working-with-numbers","Working with Numbers","Learn about Python's numeric data types including integers and floats, and how to perform calculations","working-with-numbers",10,"content:python:10.working-with-numbers.md","python/10.working-with-numbers.md","python/10.working-with-numbers",{"_path":105,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":106,"description":107,"slug":108,"parentId":77,"order":109,"_type":15,"_id":110,"_source":17,"_file":111,"_stem":112,"_extension":20},"/python/text-and-strings","Text and Strings","Learn how to work with text data in Python using strings, including creation, manipulation, and formatting","text-and-strings",11,"content:python:11.text-and-strings.md","python/11.text-and-strings.md","python/11.text-and-strings",{"_path":114,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":115,"description":116,"slug":117,"parentId":77,"order":118,"_type":15,"_id":119,"_source":17,"_file":120,"_stem":121,"_extension":20},"/python/true-false-values","True/False Values","Learn about boolean values in Python, including True/False logic, comparison operations, and how to use booleans for decision-making in your programs","true-false-values",12,"content:python:12.true-false-values.md","python/12.true-false-values.md","python/12.true-false-values",{"_path":123,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":124,"description":125,"slug":126,"parentId":77,"order":127,"_type":15,"_id":128,"_source":17,"_file":129,"_stem":130,"_extension":20},"/python/converting-types","Converting Types","Learn how to convert between different Python data types including strings, numbers, and booleans","converting-types",13,"content:python:13.converting-types.md","python/13.converting-types.md","python/13.converting-types",{"_path":132,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":133,"description":134,"slug":135,"order":136,"isParent":13,"icon":14,"_type":15,"_id":137,"_source":17,"_file":138,"_stem":139,"_extension":20,"children":140,"expanded":13},"/python/python-operators","Python Operators","Learn about Python operators - the symbols and keywords that perform operations on data. Discover arithmetic, comparison, logical, and assignment operators with simple examples.","python-operators",14,"content:python:14.python-operators.md","python/14.python-operators.md","python/14.python-operators",[141,150,159,168,177],{"_path":142,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":143,"description":144,"slug":145,"parentId":132,"order":146,"_type":15,"_id":147,"_source":17,"_file":148,"_stem":149,"_extension":20},"/python/math-operations","Math Operations","Learn Python's arithmetic operators for mathematical calculations. Master addition, subtraction, multiplication, division, and more with practical examples.","math-operations",15,"content:python:15.math-operations.md","python/15.math-operations.md","python/15.math-operations",{"_path":151,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":152,"description":153,"slug":154,"parentId":132,"order":155,"_type":15,"_id":156,"_source":17,"_file":157,"_stem":158,"_extension":20},"/python/comparing-values","Comparing Values","Learn Python's comparison operators to compare values and make decisions. Master equality, inequality, and relational operators with practical examples.","comparing-values",16,"content:python:16.comparing-values.md","python/16.comparing-values.md","python/16.comparing-values",{"_path":160,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":161,"description":162,"slug":163,"parentId":132,"order":164,"_type":15,"_id":165,"_source":17,"_file":166,"_stem":167,"_extension":20},"/python/logic-operations","Logic Operations","Learn about Python's logical operators for combining conditions and creating complex boolean expressions","logic-operations",17,"content:python:17.logic-operations.md","python/17.logic-operations.md","python/17.logic-operations",{"_path":169,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":170,"description":171,"slug":172,"parentId":132,"order":173,"_type":15,"_id":174,"_source":17,"_file":175,"_stem":176,"_extension":20},"/python/value-assignment","Value Assignment","Learn about Python's assignment operators for efficiently updating variables and performing calculations","value-assignment",18,"content:python:18.value-assignment.md","python/18.value-assignment.md","python/18.value-assignment",{"_path":178,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":179,"description":180,"slug":181,"parentId":132,"order":182,"_type":15,"_id":183,"_source":17,"_file":184,"_stem":185,"_extension":20},"/python/operator-precedence","Operator Precedence","Learn how Python evaluates expressions with multiple operators and how to control evaluation order","operator-precedence",19,"content:python:19.operator-precedence.md","python/19.operator-precedence.md","python/19.operator-precedence",{"_path":187,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":188,"description":189,"slug":190,"order":191,"isParent":13,"icon":14,"_type":15,"_id":192,"_source":17,"_file":193,"_stem":194,"_extension":20,"children":195,"expanded":13},"/python/decision-making","Decision Making","Learn how to make decisions in your Python programs using conditional statements and control flow","decision-making",20,"content:python:20.decision-making.md","python/20.decision-making.md","python/20.decision-making",[196,205,214],{"_path":197,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":198,"description":199,"slug":200,"parentId":187,"order":201,"_type":15,"_id":202,"_source":17,"_file":203,"_stem":204,"_extension":20},"/python/if-statements","If Statements","Learn how to use if statements to make decisions and control program flow in Python","if-statements",21,"content:python:21.if-statements.md","python/21.if-statements.md","python/21.if-statements",{"_path":206,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":207,"description":208,"slug":209,"parentId":187,"order":210,"_type":15,"_id":211,"_source":17,"_file":212,"_stem":213,"_extension":20},"/python/multiple-conditions","Multiple Conditions","Learn how to handle multiple conditions using elif statements and complex conditional logic in Python","multiple-conditions",22,"content:python:22.multiple-conditions.md","python/22.multiple-conditions.md","python/22.multiple-conditions",{"_path":215,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":216,"description":217,"slug":218,"parentId":187,"order":219,"_type":15,"_id":220,"_source":17,"_file":221,"_stem":222,"_extension":20},"/python/pattern-matching","Pattern Matching","Learn how to use Python's match-case statements for powerful pattern matching and complex decision making","pattern-matching",23,"content:python:23.pattern-matching.md","python/23.pattern-matching.md","python/23.pattern-matching",{"_path":224,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":225,"description":226,"slug":227,"order":228,"isParent":13,"icon":14,"_type":15,"_id":229,"_source":17,"_file":230,"_stem":231,"_extension":20,"children":232,"expanded":13},"/python/repetition-and-loops","Python Loops","Learn how to use loops to repeat code efficiently and handle repetitive tasks in Python","repetition-and-loops",24,"content:python:24.repetition-and-loops.md","python/24.repetition-and-loops.md","python/24.repetition-and-loops",[233,242,251,260],{"_path":234,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":235,"description":236,"slug":237,"parentId":224,"order":238,"_type":15,"_id":239,"_source":17,"_file":240,"_stem":241,"_extension":20},"/python/while-loops","While Loops","Learn how to use while loops for condition-based repetition and create loops that run until specific conditions are met","while-loops",25,"content:python:25.while-loops.md","python/25.while-loops.md","python/25.while-loops",{"_path":243,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":244,"description":245,"slug":246,"parentId":224,"order":247,"_type":15,"_id":248,"_source":17,"_file":249,"_stem":250,"_extension":20},"/python/for-loops","For Loops","Learn how to use for loops to iterate through sequences, collections, and ranges efficiently in Python","for-loops",26,"content:python:26.for-loops.md","python/26.for-loops.md","python/26.for-loops",{"_path":252,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":253,"description":254,"slug":255,"parentId":224,"order":256,"_type":15,"_id":257,"_source":17,"_file":258,"_stem":259,"_extension":20},"/python/loop-control","Loop Control","Master advanced loop control techniques including break, continue, and else clauses for sophisticated iteration patterns","loop-control",27,"content:python:27.loop-control.md","python/27.loop-control.md","python/27.loop-control",{"_path":261,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":262,"description":263,"slug":264,"parentId":224,"order":265,"_type":15,"_id":266,"_source":17,"_file":267,"_stem":268,"_extension":20},"/python/nested-loops","Nested Loops","Learn how to use nested loops to process multi-dimensional data, create patterns, and handle complex iteration scenarios","nested-loops",28,"content:python:28.nested-loops.md","python/28.nested-loops.md","python/28.nested-loops",{"_path":270,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":271,"description":272,"slug":273,"order":274,"isParent":13,"icon":14,"_type":15,"_id":275,"_source":17,"_file":276,"_stem":277,"_extension":20,"children":278,"expanded":13},"/python/python-lists","Python Lists","Learn about Python lists, one of the most important and versatile data structures for storing and organizing collections of data","python-lists",29,"content:python:29.python-lists.md","python/29.python-lists.md","python/29.python-lists",[279,288,297,306,315,324,333,342,351,360],{"_path":280,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":281,"description":282,"slug":283,"parentId":270,"order":284,"_type":15,"_id":285,"_source":17,"_file":286,"_stem":287,"_extension":20},"/python/creating-lists","Creating Lists","Learn different methods to create and initialize Python lists, from simple literals to advanced techniques","creating-lists",30,"content:python:30.creating-lists.md","python/30.creating-lists.md","python/30.creating-lists",{"_path":289,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":290,"description":291,"slug":292,"parentId":270,"order":293,"_type":15,"_id":294,"_source":17,"_file":295,"_stem":296,"_extension":20},"/python/reading-list-data","Reading List Data","Master techniques for accessing and retrieving data from Python lists using indexing, slicing, and built-in methods","reading-list-data",31,"content:python:31.reading-list-data.md","python/31.reading-list-data.md","python/31.reading-list-data",{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":270,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python/modifying-lists","Modifying Lists","Learn how to change, update, and modify existing elements in Python lists using indexing and various methods","modifying-lists",32,"content:python:32.modifying-lists.md","python/32.modifying-lists.md","python/32.modifying-lists",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":270,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python/adding-to-lists","Adding to Lists","Learn various methods to add elements to Python lists including append, insert, extend, and concatenation techniques","adding-to-lists",33,"content:python:33.adding-to-lists.md","python/33.adding-to-lists.md","python/33.adding-to-lists",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":270,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python/removing-from-lists","Removing from Lists","Learn different methods to remove and delete elements from Python lists including remove, pop, del, and clear","removing-from-lists",34,"content:python:34.removing-from-lists.md","python/34.removing-from-lists.md","python/34.removing-from-lists",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":270,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python/looping-through-lists","Looping Through Lists","Learn different ways to iterate through Python lists using for loops, while loops, enumerate, and other iteration techniques","looping-through-lists",35,"content:python:35.looping-through-lists.md","python/35.looping-through-lists.md","python/35.looping-through-lists",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":270,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python/list-shortcuts","List Shortcuts","Learn powerful Python list shortcuts including list comprehensions, slicing tricks, and built-in functions for efficient list operations","list-shortcuts",36,"content:python:36.list-shortcuts.md","python/36.list-shortcuts.md","python/36.list-shortcuts",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":270,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python/organizing-lists","Organizing Lists","Learn how to sort, reverse, and organize Python lists using built-in methods and custom sorting techniques","organizing-lists",37,"content:python:37.organizing-lists.md","python/37.organizing-lists.md","python/37.organizing-lists",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":270,"order":356,"_type":15,"_id":357,"_source":17,"_file":358,"_stem":359,"_extension":20},"/python/combining-lists","Combining Lists","Learn various techniques to combine, merge, and join Python lists including concatenation, zipping, and advanced merging strategies","combining-lists",38,"content:python:38.combining-lists.md","python/38.combining-lists.md","python/38.combining-lists",{"_path":361,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":362,"description":363,"slug":364,"parentId":270,"order":365,"_type":15,"_id":366,"_source":17,"_file":367,"_stem":368,"_extension":20},"/python/essential-list-tools","Essential List Tools","Master powerful built-in functions and advanced techniques for efficient Python list manipulation and data processing","essential-list-tools",39,"content:python:39.essential-list-tools.md","python/39.essential-list-tools.md","python/39.essential-list-tools",{"_path":370,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":371,"description":372,"slug":373,"order":374,"isParent":13,"icon":14,"_type":15,"_id":375,"_source":17,"_file":376,"_stem":377,"_extension":20,"children":378,"expanded":13},"/python/python-tuples","Python Tuples","Master Python tuples - immutable sequences perfect for storing related data that shouldn't change. Learn creation, access, and manipulation techniques.","python-tuples",40,"content:python:40.python-tuples.md","python/40.python-tuples.md","python/40.python-tuples",[379,388,397,406,415,424,433],{"_path":380,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":381,"description":382,"slug":383,"parentId":370,"order":384,"_type":15,"_id":385,"_source":17,"_file":386,"_stem":387,"_extension":20},"/python/creating-tuples","Creating Tuples","Learn different ways to create Python tuples, from basic syntax to advanced techniques. Master tuple initialization and understand when to use tuples.","creating-tuples",41,"content:python:41.creating-tuples.md","python/41.creating-tuples.md","python/41.creating-tuples",{"_path":389,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":390,"description":391,"slug":392,"parentId":370,"order":393,"_type":15,"_id":394,"_source":17,"_file":395,"_stem":396,"_extension":20},"/python/reading-tuple-data","Reading Tuple Data","Master accessing tuple elements through indexing, slicing, and searching. Learn efficient patterns for reading and working with tuple data.","reading-tuple-data",42,"content:python:42.reading-tuple-data.md","python/42.reading-tuple-data.md","python/42.reading-tuple-data",{"_path":398,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":399,"description":400,"slug":401,"parentId":370,"order":402,"_type":15,"_id":403,"_source":17,"_file":404,"_stem":405,"_extension":20},"/python/changing-tuples","Changing Tuples","Understand tuple immutability and learn techniques for working with unchangeable data. Master creating modified tuple versions and handling immutable constraints.","changing-tuples",43,"content:python:43.changing-tuples.md","python/43.changing-tuples.md","python/43.changing-tuples",{"_path":407,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":408,"description":409,"slug":410,"parentId":370,"order":411,"_type":15,"_id":412,"_source":17,"_file":413,"_stem":414,"_extension":20},"/python/tuple-unpacking","Tuple Unpacking","Master tuple unpacking for elegant variable assignment, function returns, and data extraction. Learn Python's powerful unpacking syntax and patterns.","tuple-unpacking",44,"content:python:44.tuple-unpacking.md","python/44.tuple-unpacking.md","python/44.tuple-unpacking",{"_path":416,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":417,"description":418,"slug":419,"parentId":370,"order":420,"_type":15,"_id":421,"_source":17,"_file":422,"_stem":423,"_extension":20},"/python/iterating-tuples","Iterating Tuples","Master tuple iteration techniques for processing sequence data. Learn basic loops, enumerate, nested iteration, and advanced patterns for efficient data processing.","iterating-tuples",45,"content:python:45.iterating-tuples.md","python/45.iterating-tuples.md","python/45.iterating-tuples",{"_path":425,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":426,"description":427,"slug":428,"parentId":370,"order":429,"_type":15,"_id":430,"_source":17,"_file":431,"_stem":432,"_extension":20},"/python/merging-tuples","Merging Tuples","Learn techniques for combining and merging tuples to create larger data structures. Master concatenation, joining multiple tuples, and advanced merging patterns.","merging-tuples",46,"content:python:46.merging-tuples.md","python/46.merging-tuples.md","python/46.merging-tuples",{"_path":434,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":435,"description":436,"slug":437,"parentId":370,"order":438,"_type":15,"_id":439,"_source":17,"_file":440,"_stem":441,"_extension":20},"/python/tuple-operations","Tuple Operations","Master comprehensive tuple operations including built-in functions, mathematical operations, comparisons, and advanced techniques for efficient tuple manipulation.","tuple-operations",47,"content:python:47.tuple-operations.md","python/47.tuple-operations.md","python/47.tuple-operations",{"_path":443,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":444,"description":445,"slug":446,"order":447,"isParent":13,"icon":14,"_type":15,"_id":448,"_source":17,"_file":449,"_stem":450,"_extension":20,"children":451,"expanded":13},"/python/python-sets","Python Sets","Discover Python sets - unique collections that automatically eliminate duplicates and provide powerful mathematical operations for data filtering and analysis.","python-sets",48,"content:python:48.python-sets.md","python/48.python-sets.md","python/48.python-sets",[452,461,470,479,488,497,506],{"_path":453,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":454,"description":455,"slug":456,"parentId":443,"order":457,"_type":15,"_id":458,"_source":17,"_file":459,"_stem":460,"_extension":20},"/python/creating-sets","Creating Sets","Learn multiple ways to create sets in Python including literal syntax, set() function, and set comprehensions. Master set creation from different data sources.","creating-sets",49,"content:python:49.creating-sets.md","python/49.creating-sets.md","python/49.creating-sets",{"_path":462,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":463,"description":464,"slug":465,"parentId":443,"order":466,"_type":15,"_id":467,"_source":17,"_file":468,"_stem":469,"_extension":20},"/python/reading-set-data","Reading Set Data","Learn how to access and examine set data in Python including membership testing, iteration, size checking, and converting sets to other data types.","reading-set-data",50,"content:python:50.reading-set-data.md","python/50.reading-set-data.md","python/50.reading-set-data",{"_path":471,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":472,"description":473,"slug":474,"parentId":443,"order":475,"_type":15,"_id":476,"_source":17,"_file":477,"_stem":478,"_extension":20},"/python/adding-to-sets","Adding to Sets","Learn how to add elements to sets in Python using add(), update(), and union operations. Master growing sets dynamically with single items and multiple elements.","adding-to-sets",51,"content:python:51.adding-to-sets.md","python/51.adding-to-sets.md","python/51.adding-to-sets",{"_path":480,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":481,"description":482,"slug":483,"parentId":443,"order":484,"_type":15,"_id":485,"_source":17,"_file":486,"_stem":487,"_extension":20},"/python/removing-from-sets","Removing from Sets","Learn how to remove elements from Python sets using different methods like remove(), discard(), pop(), and clear()","removing-from-sets",52,"content:python:52.removing-from-sets.md","python/52.removing-from-sets.md","python/52.removing-from-sets",{"_path":489,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":490,"description":491,"slug":492,"parentId":443,"order":493,"_type":15,"_id":494,"_source":17,"_file":495,"_stem":496,"_extension":20},"/python/iterating-sets","Iterating Sets","Learn different ways to iterate through Python sets using for loops, comprehensions, and built-in functions","iterating-sets",53,"content:python:53.iterating-sets.md","python/53.iterating-sets.md","python/53.iterating-sets",{"_path":498,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":499,"description":500,"slug":501,"parentId":443,"order":502,"_type":15,"_id":503,"_source":17,"_file":504,"_stem":505,"_extension":20},"/python/combining-sets","Combining Sets","Learn how to combine Python sets using union, intersection, difference, and other set operations","combining-sets",54,"content:python:54.combining-sets.md","python/54.combining-sets.md","python/54.combining-sets",{"_path":507,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":508,"description":509,"slug":510,"parentId":443,"order":511,"_type":15,"_id":512,"_source":17,"_file":513,"_stem":514,"_extension":20},"/python/set-operations","Set Operations","Learn advanced Python set operations including comparisons, subsets, supersets, and mathematical set relationships","set-operations",55,"content:python:55.set-operations.md","python/55.set-operations.md","python/55.set-operations",{"_path":516,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":517,"description":518,"slug":519,"order":520,"isParent":13,"icon":14,"_type":15,"_id":521,"_source":17,"_file":522,"_stem":523,"_extension":20,"children":524,"expanded":13},"/python/python-dictionaries","Python Dictionaries","Learn about Python dictionaries - key-value data structures for storing and organizing related information","python-dictionaries",56,"content:python:56.python-dictionaries.md","python/56.python-dictionaries.md","python/56.python-dictionaries",[525,534,543,552,561,570,579,588,597],{"_path":526,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":527,"description":528,"slug":529,"parentId":516,"order":530,"_type":15,"_id":531,"_source":17,"_file":532,"_stem":533,"_extension":20},"/python/creating-dictionaries","Creating Dictionaries","Learn different methods to create Python dictionaries using literals, constructors, and comprehensions","creating-dictionaries",57,"content:python:57.creating-dictionaries.md","python/57.creating-dictionaries.md","python/57.creating-dictionaries",{"_path":535,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":536,"description":537,"slug":538,"parentId":516,"order":539,"_type":15,"_id":540,"_source":17,"_file":541,"_stem":542,"_extension":20},"/python/getting-dictionary-values","Getting Dictionary Values","Learn safe and efficient methods to retrieve data from Python dictionaries using various access techniques","getting-dictionary-values",58,"content:python:58.getting-dictionary-values.md","python/58.getting-dictionary-values.md","python/58.getting-dictionary-values",{"_path":544,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":545,"description":546,"slug":547,"parentId":516,"order":548,"_type":15,"_id":549,"_source":17,"_file":550,"_stem":551,"_extension":20},"/python/updating-dictionaries","Updating Dictionaries","Learn how to modify and maintain Python dictionary data using various update methods and techniques","updating-dictionaries",59,"content:python:59.updating-dictionaries.md","python/59.updating-dictionaries.md","python/59.updating-dictionaries",{"_path":553,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":554,"description":555,"slug":556,"parentId":516,"order":557,"_type":15,"_id":558,"_source":17,"_file":559,"_stem":560,"_extension":20},"/python/adding-dictionary-items","Adding Dictionary Items","Learn effective techniques for adding new items to Python dictionaries with various methods and best practices","adding-dictionary-items",60,"content:python:60.adding-dictionary-items.md","python/60.adding-dictionary-items.md","python/60.adding-dictionary-items",{"_path":562,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":563,"description":564,"slug":565,"parentId":516,"order":566,"_type":15,"_id":567,"_source":17,"_file":568,"_stem":569,"_extension":20},"/python/deleting-dictionary-items","Deleting Dictionary Items","Master safe and efficient techniques for removing items from Python dictionaries with various methods and error handling","deleting-dictionary-items",61,"content:python:61.deleting-dictionary-items.md","python/61.deleting-dictionary-items.md","python/61.deleting-dictionary-items",{"_path":571,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":572,"description":573,"slug":574,"parentId":516,"order":575,"_type":15,"_id":576,"_source":17,"_file":577,"_stem":578,"_extension":20},"/python/looping-dictionaries","Looping Dictionaries","Learn efficient techniques for iterating through Python dictionaries using keys, values, and items","looping-dictionaries",62,"content:python:62.looping-dictionaries.md","python/62.looping-dictionaries.md","python/62.looping-dictionaries",{"_path":580,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":581,"description":582,"slug":583,"parentId":516,"order":584,"_type":15,"_id":585,"_source":17,"_file":586,"_stem":587,"_extension":20},"/python/dictionary-copies","Dictionary Copies","Learn safe techniques for duplicating Python dictionaries using shallow and deep copy methods","dictionary-copies",63,"content:python:63.dictionary-copies.md","python/63.dictionary-copies.md","python/63.dictionary-copies",{"_path":589,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":590,"description":591,"slug":592,"parentId":516,"order":593,"_type":15,"_id":594,"_source":17,"_file":595,"_stem":596,"_extension":20},"/python/multi-level-dictionaries","Multi-level Dictionaries","Master working with nested Python dictionaries for complex data structures and hierarchical information","multi-level-dictionaries",64,"content:python:64.multi-level-dictionaries.md","python/64.multi-level-dictionaries.md","python/64.multi-level-dictionaries",{"_path":598,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":599,"description":600,"slug":601,"parentId":516,"order":602,"_type":15,"_id":603,"_source":17,"_file":604,"_stem":605,"_extension":20},"/python/dictionary-tools","Dictionary Tools","Explore powerful built-in functions and advanced techniques for efficient Python dictionary manipulation and analysis","dictionary-tools",65,"content:python:65.dictionary-tools.md","python/65.dictionary-tools.md","python/65.dictionary-tools",{"_path":607,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":608,"description":609,"slug":610,"order":611,"isParent":13,"icon":14,"_type":15,"_id":612,"_source":17,"_file":613,"_stem":614,"_extension":20,"children":615,"expanded":13},"/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,"expanded":13},"/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",[725],{"_path":726,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":727,"description":728,"slug":729,"parentId":671,"order":730,"body":989,"_type":15,"_id":731,"_source":17,"_file":732,"_stem":733,"_extension":20},{"type":990,"children":991,"toc":8820},"root",[992,1000,1023,1044,1677,1684,1689,1930,1937,1942,1961,1978,2472,2478,2483,3351,3357,3362,3368,3373,4296,4302,4307,4313,4318,5282,5288,5294,5322,6232,6238,6251,6951,6957,6962,7341,7488,7493,8028,8034,8761,8774,8780,8785,8792,8798,8803,8814],{"type":993,"tag":994,"props":995,"children":996},"element","h1",{"id":729},[997],{"type":998,"value":999},"text","✨ Special Methods",{"type":993,"tag":1001,"props":1002,"children":1003},"p",{},[1004,1006,1013,1015,1021],{"type":998,"value":1005},"Special methods (also called magic methods or dunder methods) are Python's secret sauce for making your custom classes work seamlessly with built-in functions and operators. By implementing these double-underscore methods, you can make your objects behave naturally with ",{"type":993,"tag":1007,"props":1008,"children":1010},"code",{"className":1009},[],[1011],{"type":998,"value":1012},"len()",{"type":998,"value":1014},", ",{"type":993,"tag":1007,"props":1016,"children":1018},{"className":1017},[],[1019],{"type":998,"value":1020},"str()",{"type":998,"value":1022},", comparison operators, and much more.",{"type":993,"tag":1001,"props":1024,"children":1025},{},[1026,1028,1034,1036,1042],{"type":998,"value":1027},"Think of special methods as translation protocols - they tell Python how to handle your custom objects when using familiar operations. Instead of writing ",{"type":993,"tag":1007,"props":1029,"children":1031},{"className":1030},[],[1032],{"type":998,"value":1033},"my_object.get_length()",{"type":998,"value":1035},", special methods let you use ",{"type":993,"tag":1007,"props":1037,"children":1039},{"className":1038},[],[1040],{"type":998,"value":1041},"len(my_object)",{"type":998,"value":1043}," just like with built-in types.",{"type":993,"tag":1045,"props":1046,"children":1047},"code-try",{},[1048],{"type":993,"tag":1049,"props":1050,"children":1053},"pre",{"className":1051,"code":1052,"language":6,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Special methods make objects feel natural\nclass Playlist:\n    def __init__(self, name):\n        self.name = name\n        self.songs = []\n    \n    def __str__(self):  # For print() and str()\n        return f\"Playlist: {self.name} ({len(self.songs)} songs)\"\n    \n    def __len__(self):  # For len() function\n        return len(self.songs)\n    \n    def __getitem__(self, index):  # For indexing: playlist[0]\n        return self.songs[index]\n    \n    def __contains__(self, song):  # For 'in' operator\n        return song in self.songs\n    \n    def add_song(self, song):\n        self.songs.append(song)\n\n# Your class now works with built-in functions!\nplaylist = Playlist(\"My Favorites\")\nplaylist.add_song(\"Bohemian Rhapsody\")\nplaylist.add_song(\"Imagine\")\n\nprint(playlist)                    # Uses __str__\nprint(f\"Length: {len(playlist)}\")  # Uses __len__\nprint(f\"First song: {playlist[0]}\")  # Uses __getitem__\nprint(\"Imagine\" in playlist)       # Uses __contains__\n",[1054],{"type":993,"tag":1007,"props":1055,"children":1056},{"__ignoreMap":8},[1057,1068,1089,1108,1131,1152,1160,1182,1250,1257,1278,1303,1310,1332,1349,1356,1378,1404,1411,1428,1440,1448,1456,1483,1500,1516,1523,1541,1590,1647],{"type":993,"tag":1058,"props":1059,"children":1061},"span",{"class":1060,"line":12},"line",[1062],{"type":993,"tag":1058,"props":1063,"children":1065},{"style":1064},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[1066],{"type":998,"value":1067},"# Special methods make objects feel natural\n",{"type":993,"tag":1058,"props":1069,"children":1070},{"class":1060,"line":27},[1071,1077,1083],{"type":993,"tag":1058,"props":1072,"children":1074},{"style":1073},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[1075],{"type":998,"value":1076},"class",{"type":993,"tag":1058,"props":1078,"children":1080},{"style":1079},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[1081],{"type":998,"value":1082}," Playlist",{"type":993,"tag":1058,"props":1084,"children":1086},{"style":1085},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[1087],{"type":998,"value":1088},":\n",{"type":993,"tag":1058,"props":1090,"children":1091},{"class":1060,"line":36},[1092,1097,1103],{"type":993,"tag":1058,"props":1093,"children":1094},{"style":1073},[1095],{"type":998,"value":1096},"    def",{"type":993,"tag":1058,"props":1098,"children":1100},{"style":1099},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[1101],{"type":998,"value":1102}," __init__",{"type":993,"tag":1058,"props":1104,"children":1105},{"style":1085},[1106],{"type":998,"value":1107},"(self, name):\n",{"type":993,"tag":1058,"props":1109,"children":1110},{"class":1060,"line":45},[1111,1116,1121,1126],{"type":993,"tag":1058,"props":1112,"children":1113},{"style":1099},[1114],{"type":998,"value":1115},"        self",{"type":993,"tag":1058,"props":1117,"children":1118},{"style":1085},[1119],{"type":998,"value":1120},".name ",{"type":993,"tag":1058,"props":1122,"children":1123},{"style":1073},[1124],{"type":998,"value":1125},"=",{"type":993,"tag":1058,"props":1127,"children":1128},{"style":1085},[1129],{"type":998,"value":1130}," name\n",{"type":993,"tag":1058,"props":1132,"children":1133},{"class":1060,"line":54},[1134,1138,1143,1147],{"type":993,"tag":1058,"props":1135,"children":1136},{"style":1099},[1137],{"type":998,"value":1115},{"type":993,"tag":1058,"props":1139,"children":1140},{"style":1085},[1141],{"type":998,"value":1142},".songs ",{"type":993,"tag":1058,"props":1144,"children":1145},{"style":1073},[1146],{"type":998,"value":1125},{"type":993,"tag":1058,"props":1148,"children":1149},{"style":1085},[1150],{"type":998,"value":1151}," []\n",{"type":993,"tag":1058,"props":1153,"children":1154},{"class":1060,"line":63},[1155],{"type":993,"tag":1058,"props":1156,"children":1157},{"style":1085},[1158],{"type":998,"value":1159},"    \n",{"type":993,"tag":1058,"props":1161,"children":1162},{"class":1060,"line":72},[1163,1167,1172,1177],{"type":993,"tag":1058,"props":1164,"children":1165},{"style":1073},[1166],{"type":998,"value":1096},{"type":993,"tag":1058,"props":1168,"children":1169},{"style":1099},[1170],{"type":998,"value":1171}," __str__",{"type":993,"tag":1058,"props":1173,"children":1174},{"style":1085},[1175],{"type":998,"value":1176},"(self):  ",{"type":993,"tag":1058,"props":1178,"children":1179},{"style":1064},[1180],{"type":998,"value":1181},"# For print() and str()\n",{"type":993,"tag":1058,"props":1183,"children":1184},{"class":1060,"line":81},[1185,1190,1195,1201,1206,1211,1216,1221,1226,1231,1236,1241,1245],{"type":993,"tag":1058,"props":1186,"children":1187},{"style":1073},[1188],{"type":998,"value":1189},"        return",{"type":993,"tag":1058,"props":1191,"children":1192},{"style":1073},[1193],{"type":998,"value":1194}," f",{"type":993,"tag":1058,"props":1196,"children":1198},{"style":1197},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[1199],{"type":998,"value":1200},"\"Playlist: ",{"type":993,"tag":1058,"props":1202,"children":1203},{"style":1099},[1204],{"type":998,"value":1205},"{self",{"type":993,"tag":1058,"props":1207,"children":1208},{"style":1085},[1209],{"type":998,"value":1210},".name",{"type":993,"tag":1058,"props":1212,"children":1213},{"style":1099},[1214],{"type":998,"value":1215},"}",{"type":993,"tag":1058,"props":1217,"children":1218},{"style":1197},[1219],{"type":998,"value":1220}," (",{"type":993,"tag":1058,"props":1222,"children":1223},{"style":1099},[1224],{"type":998,"value":1225},"{len",{"type":993,"tag":1058,"props":1227,"children":1228},{"style":1085},[1229],{"type":998,"value":1230},"(",{"type":993,"tag":1058,"props":1232,"children":1233},{"style":1099},[1234],{"type":998,"value":1235},"self",{"type":993,"tag":1058,"props":1237,"children":1238},{"style":1085},[1239],{"type":998,"value":1240},".songs)",{"type":993,"tag":1058,"props":1242,"children":1243},{"style":1099},[1244],{"type":998,"value":1215},{"type":993,"tag":1058,"props":1246,"children":1247},{"style":1197},[1248],{"type":998,"value":1249}," songs)\"\n",{"type":993,"tag":1058,"props":1251,"children":1252},{"class":1060,"line":91},[1253],{"type":993,"tag":1058,"props":1254,"children":1255},{"style":1085},[1256],{"type":998,"value":1159},{"type":993,"tag":1058,"props":1258,"children":1259},{"class":1060,"line":100},[1260,1264,1269,1273],{"type":993,"tag":1058,"props":1261,"children":1262},{"style":1073},[1263],{"type":998,"value":1096},{"type":993,"tag":1058,"props":1265,"children":1266},{"style":1099},[1267],{"type":998,"value":1268}," __len__",{"type":993,"tag":1058,"props":1270,"children":1271},{"style":1085},[1272],{"type":998,"value":1176},{"type":993,"tag":1058,"props":1274,"children":1275},{"style":1064},[1276],{"type":998,"value":1277},"# For len() function\n",{"type":993,"tag":1058,"props":1279,"children":1280},{"class":1060,"line":109},[1281,1285,1290,1294,1298],{"type":993,"tag":1058,"props":1282,"children":1283},{"style":1073},[1284],{"type":998,"value":1189},{"type":993,"tag":1058,"props":1286,"children":1287},{"style":1099},[1288],{"type":998,"value":1289}," len",{"type":993,"tag":1058,"props":1291,"children":1292},{"style":1085},[1293],{"type":998,"value":1230},{"type":993,"tag":1058,"props":1295,"children":1296},{"style":1099},[1297],{"type":998,"value":1235},{"type":993,"tag":1058,"props":1299,"children":1300},{"style":1085},[1301],{"type":998,"value":1302},".songs)\n",{"type":993,"tag":1058,"props":1304,"children":1305},{"class":1060,"line":118},[1306],{"type":993,"tag":1058,"props":1307,"children":1308},{"style":1085},[1309],{"type":998,"value":1159},{"type":993,"tag":1058,"props":1311,"children":1312},{"class":1060,"line":127},[1313,1317,1322,1327],{"type":993,"tag":1058,"props":1314,"children":1315},{"style":1073},[1316],{"type":998,"value":1096},{"type":993,"tag":1058,"props":1318,"children":1319},{"style":1099},[1320],{"type":998,"value":1321}," __getitem__",{"type":993,"tag":1058,"props":1323,"children":1324},{"style":1085},[1325],{"type":998,"value":1326},"(self, index):  ",{"type":993,"tag":1058,"props":1328,"children":1329},{"style":1064},[1330],{"type":998,"value":1331},"# For indexing: playlist[0]\n",{"type":993,"tag":1058,"props":1333,"children":1334},{"class":1060,"line":136},[1335,1339,1344],{"type":993,"tag":1058,"props":1336,"children":1337},{"style":1073},[1338],{"type":998,"value":1189},{"type":993,"tag":1058,"props":1340,"children":1341},{"style":1099},[1342],{"type":998,"value":1343}," self",{"type":993,"tag":1058,"props":1345,"children":1346},{"style":1085},[1347],{"type":998,"value":1348},".songs[index]\n",{"type":993,"tag":1058,"props":1350,"children":1351},{"class":1060,"line":146},[1352],{"type":993,"tag":1058,"props":1353,"children":1354},{"style":1085},[1355],{"type":998,"value":1159},{"type":993,"tag":1058,"props":1357,"children":1358},{"class":1060,"line":155},[1359,1363,1368,1373],{"type":993,"tag":1058,"props":1360,"children":1361},{"style":1073},[1362],{"type":998,"value":1096},{"type":993,"tag":1058,"props":1364,"children":1365},{"style":1099},[1366],{"type":998,"value":1367}," __contains__",{"type":993,"tag":1058,"props":1369,"children":1370},{"style":1085},[1371],{"type":998,"value":1372},"(self, song):  ",{"type":993,"tag":1058,"props":1374,"children":1375},{"style":1064},[1376],{"type":998,"value":1377},"# For 'in' operator\n",{"type":993,"tag":1058,"props":1379,"children":1380},{"class":1060,"line":164},[1381,1385,1390,1395,1399],{"type":993,"tag":1058,"props":1382,"children":1383},{"style":1073},[1384],{"type":998,"value":1189},{"type":993,"tag":1058,"props":1386,"children":1387},{"style":1085},[1388],{"type":998,"value":1389}," song ",{"type":993,"tag":1058,"props":1391,"children":1392},{"style":1073},[1393],{"type":998,"value":1394},"in",{"type":993,"tag":1058,"props":1396,"children":1397},{"style":1099},[1398],{"type":998,"value":1343},{"type":993,"tag":1058,"props":1400,"children":1401},{"style":1085},[1402],{"type":998,"value":1403},".songs\n",{"type":993,"tag":1058,"props":1405,"children":1406},{"class":1060,"line":173},[1407],{"type":993,"tag":1058,"props":1408,"children":1409},{"style":1085},[1410],{"type":998,"value":1159},{"type":993,"tag":1058,"props":1412,"children":1413},{"class":1060,"line":182},[1414,1418,1423],{"type":993,"tag":1058,"props":1415,"children":1416},{"style":1073},[1417],{"type":998,"value":1096},{"type":993,"tag":1058,"props":1419,"children":1420},{"style":1079},[1421],{"type":998,"value":1422}," add_song",{"type":993,"tag":1058,"props":1424,"children":1425},{"style":1085},[1426],{"type":998,"value":1427},"(self, song):\n",{"type":993,"tag":1058,"props":1429,"children":1430},{"class":1060,"line":191},[1431,1435],{"type":993,"tag":1058,"props":1432,"children":1433},{"style":1099},[1434],{"type":998,"value":1115},{"type":993,"tag":1058,"props":1436,"children":1437},{"style":1085},[1438],{"type":998,"value":1439},".songs.append(song)\n",{"type":993,"tag":1058,"props":1441,"children":1442},{"class":1060,"line":201},[1443],{"type":993,"tag":1058,"props":1444,"children":1445},{"emptyLinePlaceholder":13},[1446],{"type":998,"value":1447},"\n",{"type":993,"tag":1058,"props":1449,"children":1450},{"class":1060,"line":210},[1451],{"type":993,"tag":1058,"props":1452,"children":1453},{"style":1064},[1454],{"type":998,"value":1455},"# Your class now works with built-in functions!\n",{"type":993,"tag":1058,"props":1457,"children":1458},{"class":1060,"line":219},[1459,1464,1468,1473,1478],{"type":993,"tag":1058,"props":1460,"children":1461},{"style":1085},[1462],{"type":998,"value":1463},"playlist ",{"type":993,"tag":1058,"props":1465,"children":1466},{"style":1073},[1467],{"type":998,"value":1125},{"type":993,"tag":1058,"props":1469,"children":1470},{"style":1085},[1471],{"type":998,"value":1472}," Playlist(",{"type":993,"tag":1058,"props":1474,"children":1475},{"style":1197},[1476],{"type":998,"value":1477},"\"My Favorites\"",{"type":993,"tag":1058,"props":1479,"children":1480},{"style":1085},[1481],{"type":998,"value":1482},")\n",{"type":993,"tag":1058,"props":1484,"children":1485},{"class":1060,"line":228},[1486,1491,1496],{"type":993,"tag":1058,"props":1487,"children":1488},{"style":1085},[1489],{"type":998,"value":1490},"playlist.add_song(",{"type":993,"tag":1058,"props":1492,"children":1493},{"style":1197},[1494],{"type":998,"value":1495},"\"Bohemian Rhapsody\"",{"type":993,"tag":1058,"props":1497,"children":1498},{"style":1085},[1499],{"type":998,"value":1482},{"type":993,"tag":1058,"props":1501,"children":1502},{"class":1060,"line":238},[1503,1507,1512],{"type":993,"tag":1058,"props":1504,"children":1505},{"style":1085},[1506],{"type":998,"value":1490},{"type":993,"tag":1058,"props":1508,"children":1509},{"style":1197},[1510],{"type":998,"value":1511},"\"Imagine\"",{"type":993,"tag":1058,"props":1513,"children":1514},{"style":1085},[1515],{"type":998,"value":1482},{"type":993,"tag":1058,"props":1517,"children":1518},{"class":1060,"line":247},[1519],{"type":993,"tag":1058,"props":1520,"children":1521},{"emptyLinePlaceholder":13},[1522],{"type":998,"value":1447},{"type":993,"tag":1058,"props":1524,"children":1525},{"class":1060,"line":256},[1526,1531,1536],{"type":993,"tag":1058,"props":1527,"children":1528},{"style":1099},[1529],{"type":998,"value":1530},"print",{"type":993,"tag":1058,"props":1532,"children":1533},{"style":1085},[1534],{"type":998,"value":1535},"(playlist)                    ",{"type":993,"tag":1058,"props":1537,"children":1538},{"style":1064},[1539],{"type":998,"value":1540},"# Uses __str__\n",{"type":993,"tag":1058,"props":1542,"children":1543},{"class":1060,"line":265},[1544,1548,1552,1557,1562,1566,1571,1575,1580,1585],{"type":993,"tag":1058,"props":1545,"children":1546},{"style":1099},[1547],{"type":998,"value":1530},{"type":993,"tag":1058,"props":1549,"children":1550},{"style":1085},[1551],{"type":998,"value":1230},{"type":993,"tag":1058,"props":1553,"children":1554},{"style":1073},[1555],{"type":998,"value":1556},"f",{"type":993,"tag":1058,"props":1558,"children":1559},{"style":1197},[1560],{"type":998,"value":1561},"\"Length: ",{"type":993,"tag":1058,"props":1563,"children":1564},{"style":1099},[1565],{"type":998,"value":1225},{"type":993,"tag":1058,"props":1567,"children":1568},{"style":1085},[1569],{"type":998,"value":1570},"(playlist)",{"type":993,"tag":1058,"props":1572,"children":1573},{"style":1099},[1574],{"type":998,"value":1215},{"type":993,"tag":1058,"props":1576,"children":1577},{"style":1197},[1578],{"type":998,"value":1579},"\"",{"type":993,"tag":1058,"props":1581,"children":1582},{"style":1085},[1583],{"type":998,"value":1584},")  ",{"type":993,"tag":1058,"props":1586,"children":1587},{"style":1064},[1588],{"type":998,"value":1589},"# Uses __len__\n",{"type":993,"tag":1058,"props":1591,"children":1592},{"class":1060,"line":274},[1593,1597,1601,1605,1610,1615,1620,1625,1630,1634,1638,1642],{"type":993,"tag":1058,"props":1594,"children":1595},{"style":1099},[1596],{"type":998,"value":1530},{"type":993,"tag":1058,"props":1598,"children":1599},{"style":1085},[1600],{"type":998,"value":1230},{"type":993,"tag":1058,"props":1602,"children":1603},{"style":1073},[1604],{"type":998,"value":1556},{"type":993,"tag":1058,"props":1606,"children":1607},{"style":1197},[1608],{"type":998,"value":1609},"\"First song: ",{"type":993,"tag":1058,"props":1611,"children":1612},{"style":1099},[1613],{"type":998,"value":1614},"{",{"type":993,"tag":1058,"props":1616,"children":1617},{"style":1085},[1618],{"type":998,"value":1619},"playlist[",{"type":993,"tag":1058,"props":1621,"children":1622},{"style":1099},[1623],{"type":998,"value":1624},"0",{"type":993,"tag":1058,"props":1626,"children":1627},{"style":1085},[1628],{"type":998,"value":1629},"]",{"type":993,"tag":1058,"props":1631,"children":1632},{"style":1099},[1633],{"type":998,"value":1215},{"type":993,"tag":1058,"props":1635,"children":1636},{"style":1197},[1637],{"type":998,"value":1579},{"type":993,"tag":1058,"props":1639,"children":1640},{"style":1085},[1641],{"type":998,"value":1584},{"type":993,"tag":1058,"props":1643,"children":1644},{"style":1064},[1645],{"type":998,"value":1646},"# Uses __getitem__\n",{"type":993,"tag":1058,"props":1648,"children":1649},{"class":1060,"line":284},[1650,1654,1658,1662,1667,1672],{"type":993,"tag":1058,"props":1651,"children":1652},{"style":1099},[1653],{"type":998,"value":1530},{"type":993,"tag":1058,"props":1655,"children":1656},{"style":1085},[1657],{"type":998,"value":1230},{"type":993,"tag":1058,"props":1659,"children":1660},{"style":1197},[1661],{"type":998,"value":1511},{"type":993,"tag":1058,"props":1663,"children":1664},{"style":1073},[1665],{"type":998,"value":1666}," in",{"type":993,"tag":1058,"props":1668,"children":1669},{"style":1085},[1670],{"type":998,"value":1671}," playlist)       ",{"type":993,"tag":1058,"props":1673,"children":1674},{"style":1064},[1675],{"type":998,"value":1676},"# Uses __contains__\n",{"type":993,"tag":1678,"props":1679,"children":1681},"h2",{"id":1680},"understanding-special-methods",[1682],{"type":998,"value":1683},"🎯 Understanding Special Methods",{"type":993,"tag":1001,"props":1685,"children":1686},{},[1687],{"type":998,"value":1688},"Special methods are Python's way of allowing your classes to integrate with the language's syntax and built-in functions. They define how your objects respond to common operations.",{"type":993,"tag":1690,"props":1691,"children":1695},"info-box",{"emoji":1692,"title":1693,"type":1694},"🔧","Special Method Fundamentals","info",[1696,1705,1736,1744,1879,1887],{"type":993,"tag":1001,"props":1697,"children":1698},{},[1699],{"type":993,"tag":1700,"props":1701,"children":1702},"strong",{},[1703],{"type":998,"value":1704},"What Are Special Methods:",{"type":993,"tag":1706,"props":1707,"children":1708},"ul",{},[1709,1721,1726,1731],{"type":993,"tag":1710,"props":1711,"children":1712},"li",{},[1713,1715],{"type":998,"value":1714},"Methods with double underscores on both sides: ",{"type":993,"tag":1007,"props":1716,"children":1718},{"className":1717},[],[1719],{"type":998,"value":1720},"__method__",{"type":993,"tag":1710,"props":1722,"children":1723},{},[1724],{"type":998,"value":1725},"Automatically called by Python when certain operations occur",{"type":993,"tag":1710,"props":1727,"children":1728},{},[1729],{"type":998,"value":1730},"Enable your classes to work with built-in functions and operators",{"type":993,"tag":1710,"props":1732,"children":1733},{},[1734],{"type":998,"value":1735},"Make custom objects feel like native Python types",{"type":993,"tag":1001,"props":1737,"children":1738},{},[1739],{"type":993,"tag":1700,"props":1740,"children":1741},{},[1742],{"type":998,"value":1743},"Common Categories:",{"type":993,"tag":1706,"props":1745,"children":1746},{},[1747,1770,1799,1828,1857],{"type":993,"tag":1710,"props":1748,"children":1749},{},[1750,1755,1757,1763,1764],{"type":993,"tag":1700,"props":1751,"children":1752},{},[1753],{"type":998,"value":1754},"String Representation",{"type":998,"value":1756},": ",{"type":993,"tag":1007,"props":1758,"children":1760},{"className":1759},[],[1761],{"type":998,"value":1762},"__str__",{"type":998,"value":1014},{"type":993,"tag":1007,"props":1765,"children":1767},{"className":1766},[],[1768],{"type":998,"value":1769},"__repr__",{"type":993,"tag":1710,"props":1771,"children":1772},{},[1773,1778,1779,1785,1786,1792,1793],{"type":993,"tag":1700,"props":1774,"children":1775},{},[1776],{"type":998,"value":1777},"Numeric Operations",{"type":998,"value":1756},{"type":993,"tag":1007,"props":1780,"children":1782},{"className":1781},[],[1783],{"type":998,"value":1784},"__add__",{"type":998,"value":1014},{"type":993,"tag":1007,"props":1787,"children":1789},{"className":1788},[],[1790],{"type":998,"value":1791},"__sub__",{"type":998,"value":1014},{"type":993,"tag":1007,"props":1794,"children":1796},{"className":1795},[],[1797],{"type":998,"value":1798},"__mul__",{"type":993,"tag":1710,"props":1800,"children":1801},{},[1802,1807,1808,1814,1815,1821,1822],{"type":993,"tag":1700,"props":1803,"children":1804},{},[1805],{"type":998,"value":1806},"Comparison",{"type":998,"value":1756},{"type":993,"tag":1007,"props":1809,"children":1811},{"className":1810},[],[1812],{"type":998,"value":1813},"__eq__",{"type":998,"value":1014},{"type":993,"tag":1007,"props":1816,"children":1818},{"className":1817},[],[1819],{"type":998,"value":1820},"__lt__",{"type":998,"value":1014},{"type":993,"tag":1007,"props":1823,"children":1825},{"className":1824},[],[1826],{"type":998,"value":1827},"__gt__",{"type":993,"tag":1710,"props":1829,"children":1830},{},[1831,1836,1837,1843,1844,1850,1851],{"type":993,"tag":1700,"props":1832,"children":1833},{},[1834],{"type":998,"value":1835},"Container Operations",{"type":998,"value":1756},{"type":993,"tag":1007,"props":1838,"children":1840},{"className":1839},[],[1841],{"type":998,"value":1842},"__len__",{"type":998,"value":1014},{"type":993,"tag":1007,"props":1845,"children":1847},{"className":1846},[],[1848],{"type":998,"value":1849},"__getitem__",{"type":998,"value":1014},{"type":993,"tag":1007,"props":1852,"children":1854},{"className":1853},[],[1855],{"type":998,"value":1856},"__contains__",{"type":993,"tag":1710,"props":1858,"children":1859},{},[1860,1865,1866,1872,1873],{"type":993,"tag":1700,"props":1861,"children":1862},{},[1863],{"type":998,"value":1864},"Lifecycle",{"type":998,"value":1756},{"type":993,"tag":1007,"props":1867,"children":1869},{"className":1868},[],[1870],{"type":998,"value":1871},"__init__",{"type":998,"value":1014},{"type":993,"tag":1007,"props":1874,"children":1876},{"className":1875},[],[1877],{"type":998,"value":1878},"__del__",{"type":993,"tag":1001,"props":1880,"children":1881},{},[1882],{"type":993,"tag":1700,"props":1883,"children":1884},{},[1885],{"type":998,"value":1886},"Key Benefits:",{"type":993,"tag":1706,"props":1888,"children":1889},{},[1890,1900,1910,1920],{"type":993,"tag":1710,"props":1891,"children":1892},{},[1893,1898],{"type":993,"tag":1700,"props":1894,"children":1895},{},[1896],{"type":998,"value":1897},"Natural Syntax",{"type":998,"value":1899},": Use familiar Python operations on custom objects",{"type":993,"tag":1710,"props":1901,"children":1902},{},[1903,1908],{"type":993,"tag":1700,"props":1904,"children":1905},{},[1906],{"type":998,"value":1907},"Integration",{"type":998,"value":1909},": Work seamlessly with built-in functions and libraries",{"type":993,"tag":1710,"props":1911,"children":1912},{},[1913,1918],{"type":993,"tag":1700,"props":1914,"children":1915},{},[1916],{"type":998,"value":1917},"Consistency",{"type":998,"value":1919},": Follow Python's conventions for object behavior",{"type":993,"tag":1710,"props":1921,"children":1922},{},[1923,1928],{"type":993,"tag":1700,"props":1924,"children":1925},{},[1926],{"type":998,"value":1927},"Readability",{"type":998,"value":1929},": Code becomes more intuitive and pythonic",{"type":993,"tag":1931,"props":1932,"children":1934},"h3",{"id":1933},"string-representation-methods",[1935],{"type":998,"value":1936},"String Representation Methods",{"type":993,"tag":1001,"props":1938,"children":1939},{},[1940],{"type":998,"value":1941},"These methods control how your objects appear as strings, crucial for debugging and user interaction.",{"type":993,"tag":1943,"props":1944,"children":1946},"h4",{"id":1945},"__str__-and-__repr__",[1947,1953,1955],{"type":993,"tag":1007,"props":1948,"children":1950},{"className":1949},[],[1951],{"type":998,"value":1952},"__str__()",{"type":998,"value":1954}," and ",{"type":993,"tag":1007,"props":1956,"children":1958},{"className":1957},[],[1959],{"type":998,"value":1960},"__repr__()",{"type":993,"tag":1001,"props":1962,"children":1963},{},[1964,1969,1971,1976],{"type":993,"tag":1007,"props":1965,"children":1967},{"className":1966},[],[1968],{"type":998,"value":1952},{"type":998,"value":1970}," provides user-friendly string representation, while ",{"type":993,"tag":1007,"props":1972,"children":1974},{"className":1973},[],[1975],{"type":998,"value":1960},{"type":998,"value":1977}," gives developer-oriented representation for debugging.",{"type":993,"tag":1045,"props":1979,"children":1980},{},[1981],{"type":993,"tag":1049,"props":1982,"children":1984},{"className":1051,"code":1983,"language":6,"meta":8,"style":8},"class Product:\n    def __init__(self, name, price, category):\n        self.name = name\n        self.price = price\n        self.category = category\n    \n    def __str__(self):\n        # User-friendly representation\n        return f\"{self.name} - ${self.price}\"\n    \n    def __repr__(self):\n        # Developer-friendly representation\n        return f\"Product('{self.name}', {self.price}, '{self.category}')\"\n\n# Different string representations\nlaptop = Product(\"MacBook Pro\", 1999, \"Electronics\")\n\nprint(str(laptop))   # Uses __str__ - user-friendly\nprint(repr(laptop))  # Uses __repr__ - developer-friendly\nprint(laptop)        # Uses __str__ by default\n\n# In lists, __repr__ is used\nproducts = [laptop, Product(\"iPhone\", 999, \"Electronics\")]\nprint(products)      # Shows __repr__ for each item\n",[1985],{"type":993,"tag":1007,"props":1986,"children":1987},{"__ignoreMap":8},[1988,2004,2020,2039,2060,2081,2088,2104,2112,2162,2169,2185,2193,2261,2268,2276,2320,2327,2353,2379,2396,2403,2411,2455],{"type":993,"tag":1058,"props":1989,"children":1990},{"class":1060,"line":12},[1991,1995,2000],{"type":993,"tag":1058,"props":1992,"children":1993},{"style":1073},[1994],{"type":998,"value":1076},{"type":993,"tag":1058,"props":1996,"children":1997},{"style":1079},[1998],{"type":998,"value":1999}," Product",{"type":993,"tag":1058,"props":2001,"children":2002},{"style":1085},[2003],{"type":998,"value":1088},{"type":993,"tag":1058,"props":2005,"children":2006},{"class":1060,"line":27},[2007,2011,2015],{"type":993,"tag":1058,"props":2008,"children":2009},{"style":1073},[2010],{"type":998,"value":1096},{"type":993,"tag":1058,"props":2012,"children":2013},{"style":1099},[2014],{"type":998,"value":1102},{"type":993,"tag":1058,"props":2016,"children":2017},{"style":1085},[2018],{"type":998,"value":2019},"(self, name, price, category):\n",{"type":993,"tag":1058,"props":2021,"children":2022},{"class":1060,"line":36},[2023,2027,2031,2035],{"type":993,"tag":1058,"props":2024,"children":2025},{"style":1099},[2026],{"type":998,"value":1115},{"type":993,"tag":1058,"props":2028,"children":2029},{"style":1085},[2030],{"type":998,"value":1120},{"type":993,"tag":1058,"props":2032,"children":2033},{"style":1073},[2034],{"type":998,"value":1125},{"type":993,"tag":1058,"props":2036,"children":2037},{"style":1085},[2038],{"type":998,"value":1130},{"type":993,"tag":1058,"props":2040,"children":2041},{"class":1060,"line":45},[2042,2046,2051,2055],{"type":993,"tag":1058,"props":2043,"children":2044},{"style":1099},[2045],{"type":998,"value":1115},{"type":993,"tag":1058,"props":2047,"children":2048},{"style":1085},[2049],{"type":998,"value":2050},".price ",{"type":993,"tag":1058,"props":2052,"children":2053},{"style":1073},[2054],{"type":998,"value":1125},{"type":993,"tag":1058,"props":2056,"children":2057},{"style":1085},[2058],{"type":998,"value":2059}," price\n",{"type":993,"tag":1058,"props":2061,"children":2062},{"class":1060,"line":54},[2063,2067,2072,2076],{"type":993,"tag":1058,"props":2064,"children":2065},{"style":1099},[2066],{"type":998,"value":1115},{"type":993,"tag":1058,"props":2068,"children":2069},{"style":1085},[2070],{"type":998,"value":2071},".category ",{"type":993,"tag":1058,"props":2073,"children":2074},{"style":1073},[2075],{"type":998,"value":1125},{"type":993,"tag":1058,"props":2077,"children":2078},{"style":1085},[2079],{"type":998,"value":2080}," category\n",{"type":993,"tag":1058,"props":2082,"children":2083},{"class":1060,"line":63},[2084],{"type":993,"tag":1058,"props":2085,"children":2086},{"style":1085},[2087],{"type":998,"value":1159},{"type":993,"tag":1058,"props":2089,"children":2090},{"class":1060,"line":72},[2091,2095,2099],{"type":993,"tag":1058,"props":2092,"children":2093},{"style":1073},[2094],{"type":998,"value":1096},{"type":993,"tag":1058,"props":2096,"children":2097},{"style":1099},[2098],{"type":998,"value":1171},{"type":993,"tag":1058,"props":2100,"children":2101},{"style":1085},[2102],{"type":998,"value":2103},"(self):\n",{"type":993,"tag":1058,"props":2105,"children":2106},{"class":1060,"line":81},[2107],{"type":993,"tag":1058,"props":2108,"children":2109},{"style":1064},[2110],{"type":998,"value":2111},"        # User-friendly representation\n",{"type":993,"tag":1058,"props":2113,"children":2114},{"class":1060,"line":91},[2115,2119,2123,2127,2131,2135,2139,2144,2148,2153,2157],{"type":993,"tag":1058,"props":2116,"children":2117},{"style":1073},[2118],{"type":998,"value":1189},{"type":993,"tag":1058,"props":2120,"children":2121},{"style":1073},[2122],{"type":998,"value":1194},{"type":993,"tag":1058,"props":2124,"children":2125},{"style":1197},[2126],{"type":998,"value":1579},{"type":993,"tag":1058,"props":2128,"children":2129},{"style":1099},[2130],{"type":998,"value":1205},{"type":993,"tag":1058,"props":2132,"children":2133},{"style":1085},[2134],{"type":998,"value":1210},{"type":993,"tag":1058,"props":2136,"children":2137},{"style":1099},[2138],{"type":998,"value":1215},{"type":993,"tag":1058,"props":2140,"children":2141},{"style":1197},[2142],{"type":998,"value":2143}," - $",{"type":993,"tag":1058,"props":2145,"children":2146},{"style":1099},[2147],{"type":998,"value":1205},{"type":993,"tag":1058,"props":2149,"children":2150},{"style":1085},[2151],{"type":998,"value":2152},".price",{"type":993,"tag":1058,"props":2154,"children":2155},{"style":1099},[2156],{"type":998,"value":1215},{"type":993,"tag":1058,"props":2158,"children":2159},{"style":1197},[2160],{"type":998,"value":2161},"\"\n",{"type":993,"tag":1058,"props":2163,"children":2164},{"class":1060,"line":100},[2165],{"type":993,"tag":1058,"props":2166,"children":2167},{"style":1085},[2168],{"type":998,"value":1159},{"type":993,"tag":1058,"props":2170,"children":2171},{"class":1060,"line":109},[2172,2176,2181],{"type":993,"tag":1058,"props":2173,"children":2174},{"style":1073},[2175],{"type":998,"value":1096},{"type":993,"tag":1058,"props":2177,"children":2178},{"style":1099},[2179],{"type":998,"value":2180}," __repr__",{"type":993,"tag":1058,"props":2182,"children":2183},{"style":1085},[2184],{"type":998,"value":2103},{"type":993,"tag":1058,"props":2186,"children":2187},{"class":1060,"line":118},[2188],{"type":993,"tag":1058,"props":2189,"children":2190},{"style":1064},[2191],{"type":998,"value":2192},"        # Developer-friendly representation\n",{"type":993,"tag":1058,"props":2194,"children":2195},{"class":1060,"line":127},[2196,2200,2204,2209,2213,2217,2221,2226,2230,2234,2238,2243,2247,2252,2256],{"type":993,"tag":1058,"props":2197,"children":2198},{"style":1073},[2199],{"type":998,"value":1189},{"type":993,"tag":1058,"props":2201,"children":2202},{"style":1073},[2203],{"type":998,"value":1194},{"type":993,"tag":1058,"props":2205,"children":2206},{"style":1197},[2207],{"type":998,"value":2208},"\"Product('",{"type":993,"tag":1058,"props":2210,"children":2211},{"style":1099},[2212],{"type":998,"value":1205},{"type":993,"tag":1058,"props":2214,"children":2215},{"style":1085},[2216],{"type":998,"value":1210},{"type":993,"tag":1058,"props":2218,"children":2219},{"style":1099},[2220],{"type":998,"value":1215},{"type":993,"tag":1058,"props":2222,"children":2223},{"style":1197},[2224],{"type":998,"value":2225},"', ",{"type":993,"tag":1058,"props":2227,"children":2228},{"style":1099},[2229],{"type":998,"value":1205},{"type":993,"tag":1058,"props":2231,"children":2232},{"style":1085},[2233],{"type":998,"value":2152},{"type":993,"tag":1058,"props":2235,"children":2236},{"style":1099},[2237],{"type":998,"value":1215},{"type":993,"tag":1058,"props":2239,"children":2240},{"style":1197},[2241],{"type":998,"value":2242},", '",{"type":993,"tag":1058,"props":2244,"children":2245},{"style":1099},[2246],{"type":998,"value":1205},{"type":993,"tag":1058,"props":2248,"children":2249},{"style":1085},[2250],{"type":998,"value":2251},".category",{"type":993,"tag":1058,"props":2253,"children":2254},{"style":1099},[2255],{"type":998,"value":1215},{"type":993,"tag":1058,"props":2257,"children":2258},{"style":1197},[2259],{"type":998,"value":2260},"')\"\n",{"type":993,"tag":1058,"props":2262,"children":2263},{"class":1060,"line":136},[2264],{"type":993,"tag":1058,"props":2265,"children":2266},{"emptyLinePlaceholder":13},[2267],{"type":998,"value":1447},{"type":993,"tag":1058,"props":2269,"children":2270},{"class":1060,"line":146},[2271],{"type":993,"tag":1058,"props":2272,"children":2273},{"style":1064},[2274],{"type":998,"value":2275},"# Different string representations\n",{"type":993,"tag":1058,"props":2277,"children":2278},{"class":1060,"line":155},[2279,2284,2288,2293,2298,2302,2307,2311,2316],{"type":993,"tag":1058,"props":2280,"children":2281},{"style":1085},[2282],{"type":998,"value":2283},"laptop ",{"type":993,"tag":1058,"props":2285,"children":2286},{"style":1073},[2287],{"type":998,"value":1125},{"type":993,"tag":1058,"props":2289,"children":2290},{"style":1085},[2291],{"type":998,"value":2292}," Product(",{"type":993,"tag":1058,"props":2294,"children":2295},{"style":1197},[2296],{"type":998,"value":2297},"\"MacBook Pro\"",{"type":993,"tag":1058,"props":2299,"children":2300},{"style":1085},[2301],{"type":998,"value":1014},{"type":993,"tag":1058,"props":2303,"children":2304},{"style":1099},[2305],{"type":998,"value":2306},"1999",{"type":993,"tag":1058,"props":2308,"children":2309},{"style":1085},[2310],{"type":998,"value":1014},{"type":993,"tag":1058,"props":2312,"children":2313},{"style":1197},[2314],{"type":998,"value":2315},"\"Electronics\"",{"type":993,"tag":1058,"props":2317,"children":2318},{"style":1085},[2319],{"type":998,"value":1482},{"type":993,"tag":1058,"props":2321,"children":2322},{"class":1060,"line":164},[2323],{"type":993,"tag":1058,"props":2324,"children":2325},{"emptyLinePlaceholder":13},[2326],{"type":998,"value":1447},{"type":993,"tag":1058,"props":2328,"children":2329},{"class":1060,"line":173},[2330,2334,2338,2343,2348],{"type":993,"tag":1058,"props":2331,"children":2332},{"style":1099},[2333],{"type":998,"value":1530},{"type":993,"tag":1058,"props":2335,"children":2336},{"style":1085},[2337],{"type":998,"value":1230},{"type":993,"tag":1058,"props":2339,"children":2340},{"style":1099},[2341],{"type":998,"value":2342},"str",{"type":993,"tag":1058,"props":2344,"children":2345},{"style":1085},[2346],{"type":998,"value":2347},"(laptop))   ",{"type":993,"tag":1058,"props":2349,"children":2350},{"style":1064},[2351],{"type":998,"value":2352},"# Uses __str__ - user-friendly\n",{"type":993,"tag":1058,"props":2354,"children":2355},{"class":1060,"line":182},[2356,2360,2364,2369,2374],{"type":993,"tag":1058,"props":2357,"children":2358},{"style":1099},[2359],{"type":998,"value":1530},{"type":993,"tag":1058,"props":2361,"children":2362},{"style":1085},[2363],{"type":998,"value":1230},{"type":993,"tag":1058,"props":2365,"children":2366},{"style":1099},[2367],{"type":998,"value":2368},"repr",{"type":993,"tag":1058,"props":2370,"children":2371},{"style":1085},[2372],{"type":998,"value":2373},"(laptop))  ",{"type":993,"tag":1058,"props":2375,"children":2376},{"style":1064},[2377],{"type":998,"value":2378},"# Uses __repr__ - developer-friendly\n",{"type":993,"tag":1058,"props":2380,"children":2381},{"class":1060,"line":191},[2382,2386,2391],{"type":993,"tag":1058,"props":2383,"children":2384},{"style":1099},[2385],{"type":998,"value":1530},{"type":993,"tag":1058,"props":2387,"children":2388},{"style":1085},[2389],{"type":998,"value":2390},"(laptop)        ",{"type":993,"tag":1058,"props":2392,"children":2393},{"style":1064},[2394],{"type":998,"value":2395},"# Uses __str__ by default\n",{"type":993,"tag":1058,"props":2397,"children":2398},{"class":1060,"line":201},[2399],{"type":993,"tag":1058,"props":2400,"children":2401},{"emptyLinePlaceholder":13},[2402],{"type":998,"value":1447},{"type":993,"tag":1058,"props":2404,"children":2405},{"class":1060,"line":210},[2406],{"type":993,"tag":1058,"props":2407,"children":2408},{"style":1064},[2409],{"type":998,"value":2410},"# In lists, __repr__ is used\n",{"type":993,"tag":1058,"props":2412,"children":2413},{"class":1060,"line":219},[2414,2419,2423,2428,2433,2437,2442,2446,2450],{"type":993,"tag":1058,"props":2415,"children":2416},{"style":1085},[2417],{"type":998,"value":2418},"products ",{"type":993,"tag":1058,"props":2420,"children":2421},{"style":1073},[2422],{"type":998,"value":1125},{"type":993,"tag":1058,"props":2424,"children":2425},{"style":1085},[2426],{"type":998,"value":2427}," [laptop, Product(",{"type":993,"tag":1058,"props":2429,"children":2430},{"style":1197},[2431],{"type":998,"value":2432},"\"iPhone\"",{"type":993,"tag":1058,"props":2434,"children":2435},{"style":1085},[2436],{"type":998,"value":1014},{"type":993,"tag":1058,"props":2438,"children":2439},{"style":1099},[2440],{"type":998,"value":2441},"999",{"type":993,"tag":1058,"props":2443,"children":2444},{"style":1085},[2445],{"type":998,"value":1014},{"type":993,"tag":1058,"props":2447,"children":2448},{"style":1197},[2449],{"type":998,"value":2315},{"type":993,"tag":1058,"props":2451,"children":2452},{"style":1085},[2453],{"type":998,"value":2454},")]\n",{"type":993,"tag":1058,"props":2456,"children":2457},{"class":1060,"line":228},[2458,2462,2467],{"type":993,"tag":1058,"props":2459,"children":2460},{"style":1099},[2461],{"type":998,"value":1530},{"type":993,"tag":1058,"props":2463,"children":2464},{"style":1085},[2465],{"type":998,"value":2466},"(products)      ",{"type":993,"tag":1058,"props":2468,"children":2469},{"style":1064},[2470],{"type":998,"value":2471},"# Shows __repr__ for each item\n",{"type":993,"tag":1931,"props":2473,"children":2475},{"id":2474},"comparison-methods",[2476],{"type":998,"value":2477},"Comparison Methods",{"type":993,"tag":1001,"props":2479,"children":2480},{},[2481],{"type":998,"value":2482},"Comparison special methods allow your objects to be compared using standard operators, enabling sorting and equality testing.",{"type":993,"tag":1045,"props":2484,"children":2485},{},[2486],{"type":993,"tag":1049,"props":2487,"children":2489},{"className":1051,"code":2488,"language":6,"meta":8,"style":8},"class Student:\n    def __init__(self, name, grade, student_id):\n        self.name = name\n        self.grade = grade\n        self.student_id = student_id\n    \n    def __str__(self):\n        return f\"{self.name} (Grade: {self.grade})\"\n    \n    def __eq__(self, other):\n        # Define equality based on student ID\n        if isinstance(other, Student):\n            return self.student_id == other.student_id\n        return False\n    \n    def __lt__(self, other):\n        # Define less-than for sorting by grade\n        if isinstance(other, Student):\n            return self.grade \u003C other.grade\n        return NotImplemented\n    \n    def __gt__(self, other):\n        # Greater than\n        if isinstance(other, Student):\n            return self.grade > other.grade\n        return NotImplemented\n\n# Comparison operations now work\nalice = Student(\"Alice\", 95, \"S001\")\nbob = Student(\"Bob\", 87, \"S002\")\ncharlie = Student(\"Charlie\", 92, \"S003\")\n\nprint(f\"Alice == Bob: {alice == bob}\")\nprint(f\"Alice > Bob: {alice > bob}\")\nprint(f\"Bob \u003C Charlie: {bob \u003C charlie}\")\n\n# Sorting works automatically\nstudents = [alice, bob, charlie]\nsorted_students = sorted(students)  # Uses __lt__ for sorting\nprint(\"Sorted by grade:\")\nfor student in sorted_students:\n    print(f\"  {student}\")\n",[2490],{"type":993,"tag":1007,"props":2491,"children":2492},{"__ignoreMap":8},[2493,2509,2525,2544,2565,2586,2593,2608,2658,2665,2682,2690,2708,2734,2746,2753,2769,2777,2792,2817,2829,2836,2852,2860,2875,2899,2910,2917,2925,2969,3012,3055,3062,3111,3159,3208,3215,3223,3240,3267,3287,3309],{"type":993,"tag":1058,"props":2494,"children":2495},{"class":1060,"line":12},[2496,2500,2505],{"type":993,"tag":1058,"props":2497,"children":2498},{"style":1073},[2499],{"type":998,"value":1076},{"type":993,"tag":1058,"props":2501,"children":2502},{"style":1079},[2503],{"type":998,"value":2504}," Student",{"type":993,"tag":1058,"props":2506,"children":2507},{"style":1085},[2508],{"type":998,"value":1088},{"type":993,"tag":1058,"props":2510,"children":2511},{"class":1060,"line":27},[2512,2516,2520],{"type":993,"tag":1058,"props":2513,"children":2514},{"style":1073},[2515],{"type":998,"value":1096},{"type":993,"tag":1058,"props":2517,"children":2518},{"style":1099},[2519],{"type":998,"value":1102},{"type":993,"tag":1058,"props":2521,"children":2522},{"style":1085},[2523],{"type":998,"value":2524},"(self, name, grade, student_id):\n",{"type":993,"tag":1058,"props":2526,"children":2527},{"class":1060,"line":36},[2528,2532,2536,2540],{"type":993,"tag":1058,"props":2529,"children":2530},{"style":1099},[2531],{"type":998,"value":1115},{"type":993,"tag":1058,"props":2533,"children":2534},{"style":1085},[2535],{"type":998,"value":1120},{"type":993,"tag":1058,"props":2537,"children":2538},{"style":1073},[2539],{"type":998,"value":1125},{"type":993,"tag":1058,"props":2541,"children":2542},{"style":1085},[2543],{"type":998,"value":1130},{"type":993,"tag":1058,"props":2545,"children":2546},{"class":1060,"line":45},[2547,2551,2556,2560],{"type":993,"tag":1058,"props":2548,"children":2549},{"style":1099},[2550],{"type":998,"value":1115},{"type":993,"tag":1058,"props":2552,"children":2553},{"style":1085},[2554],{"type":998,"value":2555},".grade ",{"type":993,"tag":1058,"props":2557,"children":2558},{"style":1073},[2559],{"type":998,"value":1125},{"type":993,"tag":1058,"props":2561,"children":2562},{"style":1085},[2563],{"type":998,"value":2564}," grade\n",{"type":993,"tag":1058,"props":2566,"children":2567},{"class":1060,"line":54},[2568,2572,2577,2581],{"type":993,"tag":1058,"props":2569,"children":2570},{"style":1099},[2571],{"type":998,"value":1115},{"type":993,"tag":1058,"props":2573,"children":2574},{"style":1085},[2575],{"type":998,"value":2576},".student_id ",{"type":993,"tag":1058,"props":2578,"children":2579},{"style":1073},[2580],{"type":998,"value":1125},{"type":993,"tag":1058,"props":2582,"children":2583},{"style":1085},[2584],{"type":998,"value":2585}," student_id\n",{"type":993,"tag":1058,"props":2587,"children":2588},{"class":1060,"line":63},[2589],{"type":993,"tag":1058,"props":2590,"children":2591},{"style":1085},[2592],{"type":998,"value":1159},{"type":993,"tag":1058,"props":2594,"children":2595},{"class":1060,"line":72},[2596,2600,2604],{"type":993,"tag":1058,"props":2597,"children":2598},{"style":1073},[2599],{"type":998,"value":1096},{"type":993,"tag":1058,"props":2601,"children":2602},{"style":1099},[2603],{"type":998,"value":1171},{"type":993,"tag":1058,"props":2605,"children":2606},{"style":1085},[2607],{"type":998,"value":2103},{"type":993,"tag":1058,"props":2609,"children":2610},{"class":1060,"line":81},[2611,2615,2619,2623,2627,2631,2635,2640,2644,2649,2653],{"type":993,"tag":1058,"props":2612,"children":2613},{"style":1073},[2614],{"type":998,"value":1189},{"type":993,"tag":1058,"props":2616,"children":2617},{"style":1073},[2618],{"type":998,"value":1194},{"type":993,"tag":1058,"props":2620,"children":2621},{"style":1197},[2622],{"type":998,"value":1579},{"type":993,"tag":1058,"props":2624,"children":2625},{"style":1099},[2626],{"type":998,"value":1205},{"type":993,"tag":1058,"props":2628,"children":2629},{"style":1085},[2630],{"type":998,"value":1210},{"type":993,"tag":1058,"props":2632,"children":2633},{"style":1099},[2634],{"type":998,"value":1215},{"type":993,"tag":1058,"props":2636,"children":2637},{"style":1197},[2638],{"type":998,"value":2639}," (Grade: ",{"type":993,"tag":1058,"props":2641,"children":2642},{"style":1099},[2643],{"type":998,"value":1205},{"type":993,"tag":1058,"props":2645,"children":2646},{"style":1085},[2647],{"type":998,"value":2648},".grade",{"type":993,"tag":1058,"props":2650,"children":2651},{"style":1099},[2652],{"type":998,"value":1215},{"type":993,"tag":1058,"props":2654,"children":2655},{"style":1197},[2656],{"type":998,"value":2657},")\"\n",{"type":993,"tag":1058,"props":2659,"children":2660},{"class":1060,"line":91},[2661],{"type":993,"tag":1058,"props":2662,"children":2663},{"style":1085},[2664],{"type":998,"value":1159},{"type":993,"tag":1058,"props":2666,"children":2667},{"class":1060,"line":100},[2668,2672,2677],{"type":993,"tag":1058,"props":2669,"children":2670},{"style":1073},[2671],{"type":998,"value":1096},{"type":993,"tag":1058,"props":2673,"children":2674},{"style":1099},[2675],{"type":998,"value":2676}," __eq__",{"type":993,"tag":1058,"props":2678,"children":2679},{"style":1085},[2680],{"type":998,"value":2681},"(self, other):\n",{"type":993,"tag":1058,"props":2683,"children":2684},{"class":1060,"line":109},[2685],{"type":993,"tag":1058,"props":2686,"children":2687},{"style":1064},[2688],{"type":998,"value":2689},"        # Define equality based on student ID\n",{"type":993,"tag":1058,"props":2691,"children":2692},{"class":1060,"line":118},[2693,2698,2703],{"type":993,"tag":1058,"props":2694,"children":2695},{"style":1073},[2696],{"type":998,"value":2697},"        if",{"type":993,"tag":1058,"props":2699,"children":2700},{"style":1099},[2701],{"type":998,"value":2702}," isinstance",{"type":993,"tag":1058,"props":2704,"children":2705},{"style":1085},[2706],{"type":998,"value":2707},"(other, Student):\n",{"type":993,"tag":1058,"props":2709,"children":2710},{"class":1060,"line":127},[2711,2716,2720,2724,2729],{"type":993,"tag":1058,"props":2712,"children":2713},{"style":1073},[2714],{"type":998,"value":2715},"            return",{"type":993,"tag":1058,"props":2717,"children":2718},{"style":1099},[2719],{"type":998,"value":1343},{"type":993,"tag":1058,"props":2721,"children":2722},{"style":1085},[2723],{"type":998,"value":2576},{"type":993,"tag":1058,"props":2725,"children":2726},{"style":1073},[2727],{"type":998,"value":2728},"==",{"type":993,"tag":1058,"props":2730,"children":2731},{"style":1085},[2732],{"type":998,"value":2733}," other.student_id\n",{"type":993,"tag":1058,"props":2735,"children":2736},{"class":1060,"line":136},[2737,2741],{"type":993,"tag":1058,"props":2738,"children":2739},{"style":1073},[2740],{"type":998,"value":1189},{"type":993,"tag":1058,"props":2742,"children":2743},{"style":1099},[2744],{"type":998,"value":2745}," False\n",{"type":993,"tag":1058,"props":2747,"children":2748},{"class":1060,"line":146},[2749],{"type":993,"tag":1058,"props":2750,"children":2751},{"style":1085},[2752],{"type":998,"value":1159},{"type":993,"tag":1058,"props":2754,"children":2755},{"class":1060,"line":155},[2756,2760,2765],{"type":993,"tag":1058,"props":2757,"children":2758},{"style":1073},[2759],{"type":998,"value":1096},{"type":993,"tag":1058,"props":2761,"children":2762},{"style":1099},[2763],{"type":998,"value":2764}," __lt__",{"type":993,"tag":1058,"props":2766,"children":2767},{"style":1085},[2768],{"type":998,"value":2681},{"type":993,"tag":1058,"props":2770,"children":2771},{"class":1060,"line":164},[2772],{"type":993,"tag":1058,"props":2773,"children":2774},{"style":1064},[2775],{"type":998,"value":2776},"        # Define less-than for sorting by grade\n",{"type":993,"tag":1058,"props":2778,"children":2779},{"class":1060,"line":173},[2780,2784,2788],{"type":993,"tag":1058,"props":2781,"children":2782},{"style":1073},[2783],{"type":998,"value":2697},{"type":993,"tag":1058,"props":2785,"children":2786},{"style":1099},[2787],{"type":998,"value":2702},{"type":993,"tag":1058,"props":2789,"children":2790},{"style":1085},[2791],{"type":998,"value":2707},{"type":993,"tag":1058,"props":2793,"children":2794},{"class":1060,"line":182},[2795,2799,2803,2807,2812],{"type":993,"tag":1058,"props":2796,"children":2797},{"style":1073},[2798],{"type":998,"value":2715},{"type":993,"tag":1058,"props":2800,"children":2801},{"style":1099},[2802],{"type":998,"value":1343},{"type":993,"tag":1058,"props":2804,"children":2805},{"style":1085},[2806],{"type":998,"value":2555},{"type":993,"tag":1058,"props":2808,"children":2809},{"style":1073},[2810],{"type":998,"value":2811},"\u003C",{"type":993,"tag":1058,"props":2813,"children":2814},{"style":1085},[2815],{"type":998,"value":2816}," other.grade\n",{"type":993,"tag":1058,"props":2818,"children":2819},{"class":1060,"line":191},[2820,2824],{"type":993,"tag":1058,"props":2821,"children":2822},{"style":1073},[2823],{"type":998,"value":1189},{"type":993,"tag":1058,"props":2825,"children":2826},{"style":1099},[2827],{"type":998,"value":2828}," NotImplemented\n",{"type":993,"tag":1058,"props":2830,"children":2831},{"class":1060,"line":201},[2832],{"type":993,"tag":1058,"props":2833,"children":2834},{"style":1085},[2835],{"type":998,"value":1159},{"type":993,"tag":1058,"props":2837,"children":2838},{"class":1060,"line":210},[2839,2843,2848],{"type":993,"tag":1058,"props":2840,"children":2841},{"style":1073},[2842],{"type":998,"value":1096},{"type":993,"tag":1058,"props":2844,"children":2845},{"style":1099},[2846],{"type":998,"value":2847}," __gt__",{"type":993,"tag":1058,"props":2849,"children":2850},{"style":1085},[2851],{"type":998,"value":2681},{"type":993,"tag":1058,"props":2853,"children":2854},{"class":1060,"line":219},[2855],{"type":993,"tag":1058,"props":2856,"children":2857},{"style":1064},[2858],{"type":998,"value":2859},"        # Greater than\n",{"type":993,"tag":1058,"props":2861,"children":2862},{"class":1060,"line":228},[2863,2867,2871],{"type":993,"tag":1058,"props":2864,"children":2865},{"style":1073},[2866],{"type":998,"value":2697},{"type":993,"tag":1058,"props":2868,"children":2869},{"style":1099},[2870],{"type":998,"value":2702},{"type":993,"tag":1058,"props":2872,"children":2873},{"style":1085},[2874],{"type":998,"value":2707},{"type":993,"tag":1058,"props":2876,"children":2877},{"class":1060,"line":238},[2878,2882,2886,2890,2895],{"type":993,"tag":1058,"props":2879,"children":2880},{"style":1073},[2881],{"type":998,"value":2715},{"type":993,"tag":1058,"props":2883,"children":2884},{"style":1099},[2885],{"type":998,"value":1343},{"type":993,"tag":1058,"props":2887,"children":2888},{"style":1085},[2889],{"type":998,"value":2555},{"type":993,"tag":1058,"props":2891,"children":2892},{"style":1073},[2893],{"type":998,"value":2894},">",{"type":993,"tag":1058,"props":2896,"children":2897},{"style":1085},[2898],{"type":998,"value":2816},{"type":993,"tag":1058,"props":2900,"children":2901},{"class":1060,"line":247},[2902,2906],{"type":993,"tag":1058,"props":2903,"children":2904},{"style":1073},[2905],{"type":998,"value":1189},{"type":993,"tag":1058,"props":2907,"children":2908},{"style":1099},[2909],{"type":998,"value":2828},{"type":993,"tag":1058,"props":2911,"children":2912},{"class":1060,"line":256},[2913],{"type":993,"tag":1058,"props":2914,"children":2915},{"emptyLinePlaceholder":13},[2916],{"type":998,"value":1447},{"type":993,"tag":1058,"props":2918,"children":2919},{"class":1060,"line":265},[2920],{"type":993,"tag":1058,"props":2921,"children":2922},{"style":1064},[2923],{"type":998,"value":2924},"# Comparison operations now work\n",{"type":993,"tag":1058,"props":2926,"children":2927},{"class":1060,"line":274},[2928,2933,2937,2942,2947,2951,2956,2960,2965],{"type":993,"tag":1058,"props":2929,"children":2930},{"style":1085},[2931],{"type":998,"value":2932},"alice ",{"type":993,"tag":1058,"props":2934,"children":2935},{"style":1073},[2936],{"type":998,"value":1125},{"type":993,"tag":1058,"props":2938,"children":2939},{"style":1085},[2940],{"type":998,"value":2941}," Student(",{"type":993,"tag":1058,"props":2943,"children":2944},{"style":1197},[2945],{"type":998,"value":2946},"\"Alice\"",{"type":993,"tag":1058,"props":2948,"children":2949},{"style":1085},[2950],{"type":998,"value":1014},{"type":993,"tag":1058,"props":2952,"children":2953},{"style":1099},[2954],{"type":998,"value":2955},"95",{"type":993,"tag":1058,"props":2957,"children":2958},{"style":1085},[2959],{"type":998,"value":1014},{"type":993,"tag":1058,"props":2961,"children":2962},{"style":1197},[2963],{"type":998,"value":2964},"\"S001\"",{"type":993,"tag":1058,"props":2966,"children":2967},{"style":1085},[2968],{"type":998,"value":1482},{"type":993,"tag":1058,"props":2970,"children":2971},{"class":1060,"line":284},[2972,2977,2981,2985,2990,2994,2999,3003,3008],{"type":993,"tag":1058,"props":2973,"children":2974},{"style":1085},[2975],{"type":998,"value":2976},"bob ",{"type":993,"tag":1058,"props":2978,"children":2979},{"style":1073},[2980],{"type":998,"value":1125},{"type":993,"tag":1058,"props":2982,"children":2983},{"style":1085},[2984],{"type":998,"value":2941},{"type":993,"tag":1058,"props":2986,"children":2987},{"style":1197},[2988],{"type":998,"value":2989},"\"Bob\"",{"type":993,"tag":1058,"props":2991,"children":2992},{"style":1085},[2993],{"type":998,"value":1014},{"type":993,"tag":1058,"props":2995,"children":2996},{"style":1099},[2997],{"type":998,"value":2998},"87",{"type":993,"tag":1058,"props":3000,"children":3001},{"style":1085},[3002],{"type":998,"value":1014},{"type":993,"tag":1058,"props":3004,"children":3005},{"style":1197},[3006],{"type":998,"value":3007},"\"S002\"",{"type":993,"tag":1058,"props":3009,"children":3010},{"style":1085},[3011],{"type":998,"value":1482},{"type":993,"tag":1058,"props":3013,"children":3014},{"class":1060,"line":293},[3015,3020,3024,3028,3033,3037,3042,3046,3051],{"type":993,"tag":1058,"props":3016,"children":3017},{"style":1085},[3018],{"type":998,"value":3019},"charlie ",{"type":993,"tag":1058,"props":3021,"children":3022},{"style":1073},[3023],{"type":998,"value":1125},{"type":993,"tag":1058,"props":3025,"children":3026},{"style":1085},[3027],{"type":998,"value":2941},{"type":993,"tag":1058,"props":3029,"children":3030},{"style":1197},[3031],{"type":998,"value":3032},"\"Charlie\"",{"type":993,"tag":1058,"props":3034,"children":3035},{"style":1085},[3036],{"type":998,"value":1014},{"type":993,"tag":1058,"props":3038,"children":3039},{"style":1099},[3040],{"type":998,"value":3041},"92",{"type":993,"tag":1058,"props":3043,"children":3044},{"style":1085},[3045],{"type":998,"value":1014},{"type":993,"tag":1058,"props":3047,"children":3048},{"style":1197},[3049],{"type":998,"value":3050},"\"S003\"",{"type":993,"tag":1058,"props":3052,"children":3053},{"style":1085},[3054],{"type":998,"value":1482},{"type":993,"tag":1058,"props":3056,"children":3057},{"class":1060,"line":302},[3058],{"type":993,"tag":1058,"props":3059,"children":3060},{"emptyLinePlaceholder":13},[3061],{"type":998,"value":1447},{"type":993,"tag":1058,"props":3063,"children":3064},{"class":1060,"line":311},[3065,3069,3073,3077,3082,3086,3090,3094,3099,3103,3107],{"type":993,"tag":1058,"props":3066,"children":3067},{"style":1099},[3068],{"type":998,"value":1530},{"type":993,"tag":1058,"props":3070,"children":3071},{"style":1085},[3072],{"type":998,"value":1230},{"type":993,"tag":1058,"props":3074,"children":3075},{"style":1073},[3076],{"type":998,"value":1556},{"type":993,"tag":1058,"props":3078,"children":3079},{"style":1197},[3080],{"type":998,"value":3081},"\"Alice == Bob: ",{"type":993,"tag":1058,"props":3083,"children":3084},{"style":1099},[3085],{"type":998,"value":1614},{"type":993,"tag":1058,"props":3087,"children":3088},{"style":1085},[3089],{"type":998,"value":2932},{"type":993,"tag":1058,"props":3091,"children":3092},{"style":1073},[3093],{"type":998,"value":2728},{"type":993,"tag":1058,"props":3095,"children":3096},{"style":1085},[3097],{"type":998,"value":3098}," bob",{"type":993,"tag":1058,"props":3100,"children":3101},{"style":1099},[3102],{"type":998,"value":1215},{"type":993,"tag":1058,"props":3104,"children":3105},{"style":1197},[3106],{"type":998,"value":1579},{"type":993,"tag":1058,"props":3108,"children":3109},{"style":1085},[3110],{"type":998,"value":1482},{"type":993,"tag":1058,"props":3112,"children":3113},{"class":1060,"line":320},[3114,3118,3122,3126,3131,3135,3139,3143,3147,3151,3155],{"type":993,"tag":1058,"props":3115,"children":3116},{"style":1099},[3117],{"type":998,"value":1530},{"type":993,"tag":1058,"props":3119,"children":3120},{"style":1085},[3121],{"type":998,"value":1230},{"type":993,"tag":1058,"props":3123,"children":3124},{"style":1073},[3125],{"type":998,"value":1556},{"type":993,"tag":1058,"props":3127,"children":3128},{"style":1197},[3129],{"type":998,"value":3130},"\"Alice > Bob: ",{"type":993,"tag":1058,"props":3132,"children":3133},{"style":1099},[3134],{"type":998,"value":1614},{"type":993,"tag":1058,"props":3136,"children":3137},{"style":1085},[3138],{"type":998,"value":2932},{"type":993,"tag":1058,"props":3140,"children":3141},{"style":1073},[3142],{"type":998,"value":2894},{"type":993,"tag":1058,"props":3144,"children":3145},{"style":1085},[3146],{"type":998,"value":3098},{"type":993,"tag":1058,"props":3148,"children":3149},{"style":1099},[3150],{"type":998,"value":1215},{"type":993,"tag":1058,"props":3152,"children":3153},{"style":1197},[3154],{"type":998,"value":1579},{"type":993,"tag":1058,"props":3156,"children":3157},{"style":1085},[3158],{"type":998,"value":1482},{"type":993,"tag":1058,"props":3160,"children":3161},{"class":1060,"line":329},[3162,3166,3170,3174,3179,3183,3187,3191,3196,3200,3204],{"type":993,"tag":1058,"props":3163,"children":3164},{"style":1099},[3165],{"type":998,"value":1530},{"type":993,"tag":1058,"props":3167,"children":3168},{"style":1085},[3169],{"type":998,"value":1230},{"type":993,"tag":1058,"props":3171,"children":3172},{"style":1073},[3173],{"type":998,"value":1556},{"type":993,"tag":1058,"props":3175,"children":3176},{"style":1197},[3177],{"type":998,"value":3178},"\"Bob \u003C Charlie: ",{"type":993,"tag":1058,"props":3180,"children":3181},{"style":1099},[3182],{"type":998,"value":1614},{"type":993,"tag":1058,"props":3184,"children":3185},{"style":1085},[3186],{"type":998,"value":2976},{"type":993,"tag":1058,"props":3188,"children":3189},{"style":1073},[3190],{"type":998,"value":2811},{"type":993,"tag":1058,"props":3192,"children":3193},{"style":1085},[3194],{"type":998,"value":3195}," charlie",{"type":993,"tag":1058,"props":3197,"children":3198},{"style":1099},[3199],{"type":998,"value":1215},{"type":993,"tag":1058,"props":3201,"children":3202},{"style":1197},[3203],{"type":998,"value":1579},{"type":993,"tag":1058,"props":3205,"children":3206},{"style":1085},[3207],{"type":998,"value":1482},{"type":993,"tag":1058,"props":3209,"children":3210},{"class":1060,"line":338},[3211],{"type":993,"tag":1058,"props":3212,"children":3213},{"emptyLinePlaceholder":13},[3214],{"type":998,"value":1447},{"type":993,"tag":1058,"props":3216,"children":3217},{"class":1060,"line":347},[3218],{"type":993,"tag":1058,"props":3219,"children":3220},{"style":1064},[3221],{"type":998,"value":3222},"# Sorting works automatically\n",{"type":993,"tag":1058,"props":3224,"children":3225},{"class":1060,"line":356},[3226,3231,3235],{"type":993,"tag":1058,"props":3227,"children":3228},{"style":1085},[3229],{"type":998,"value":3230},"students ",{"type":993,"tag":1058,"props":3232,"children":3233},{"style":1073},[3234],{"type":998,"value":1125},{"type":993,"tag":1058,"props":3236,"children":3237},{"style":1085},[3238],{"type":998,"value":3239}," [alice, bob, charlie]\n",{"type":993,"tag":1058,"props":3241,"children":3242},{"class":1060,"line":365},[3243,3248,3252,3257,3262],{"type":993,"tag":1058,"props":3244,"children":3245},{"style":1085},[3246],{"type":998,"value":3247},"sorted_students ",{"type":993,"tag":1058,"props":3249,"children":3250},{"style":1073},[3251],{"type":998,"value":1125},{"type":993,"tag":1058,"props":3253,"children":3254},{"style":1099},[3255],{"type":998,"value":3256}," sorted",{"type":993,"tag":1058,"props":3258,"children":3259},{"style":1085},[3260],{"type":998,"value":3261},"(students)  ",{"type":993,"tag":1058,"props":3263,"children":3264},{"style":1064},[3265],{"type":998,"value":3266},"# Uses __lt__ for sorting\n",{"type":993,"tag":1058,"props":3268,"children":3269},{"class":1060,"line":374},[3270,3274,3278,3283],{"type":993,"tag":1058,"props":3271,"children":3272},{"style":1099},[3273],{"type":998,"value":1530},{"type":993,"tag":1058,"props":3275,"children":3276},{"style":1085},[3277],{"type":998,"value":1230},{"type":993,"tag":1058,"props":3279,"children":3280},{"style":1197},[3281],{"type":998,"value":3282},"\"Sorted by grade:\"",{"type":993,"tag":1058,"props":3284,"children":3285},{"style":1085},[3286],{"type":998,"value":1482},{"type":993,"tag":1058,"props":3288,"children":3289},{"class":1060,"line":384},[3290,3295,3300,3304],{"type":993,"tag":1058,"props":3291,"children":3292},{"style":1073},[3293],{"type":998,"value":3294},"for",{"type":993,"tag":1058,"props":3296,"children":3297},{"style":1085},[3298],{"type":998,"value":3299}," student ",{"type":993,"tag":1058,"props":3301,"children":3302},{"style":1073},[3303],{"type":998,"value":1394},{"type":993,"tag":1058,"props":3305,"children":3306},{"style":1085},[3307],{"type":998,"value":3308}," sorted_students:\n",{"type":993,"tag":1058,"props":3310,"children":3311},{"class":1060,"line":393},[3312,3317,3321,3325,3330,3334,3339,3343,3347],{"type":993,"tag":1058,"props":3313,"children":3314},{"style":1099},[3315],{"type":998,"value":3316},"    print",{"type":993,"tag":1058,"props":3318,"children":3319},{"style":1085},[3320],{"type":998,"value":1230},{"type":993,"tag":1058,"props":3322,"children":3323},{"style":1073},[3324],{"type":998,"value":1556},{"type":993,"tag":1058,"props":3326,"children":3327},{"style":1197},[3328],{"type":998,"value":3329},"\"  ",{"type":993,"tag":1058,"props":3331,"children":3332},{"style":1099},[3333],{"type":998,"value":1614},{"type":993,"tag":1058,"props":3335,"children":3336},{"style":1085},[3337],{"type":998,"value":3338},"student",{"type":993,"tag":1058,"props":3340,"children":3341},{"style":1099},[3342],{"type":998,"value":1215},{"type":993,"tag":1058,"props":3344,"children":3345},{"style":1197},[3346],{"type":998,"value":1579},{"type":993,"tag":1058,"props":3348,"children":3349},{"style":1085},[3350],{"type":998,"value":1482},{"type":993,"tag":1678,"props":3352,"children":3354},{"id":3353},"container-methods",[3355],{"type":998,"value":3356},"⚡ Container Methods",{"type":993,"tag":1001,"props":3358,"children":3359},{},[3360],{"type":998,"value":3361},"Container methods make your objects behave like built-in containers (lists, dictionaries), supporting indexing, length, and membership testing.",{"type":993,"tag":1931,"props":3363,"children":3365},{"id":3364},"length-and-indexing",[3366],{"type":998,"value":3367},"Length and Indexing",{"type":993,"tag":1001,"props":3369,"children":3370},{},[3371],{"type":998,"value":3372},"Implementing container methods allows natural interaction with your custom collection classes.",{"type":993,"tag":1045,"props":3374,"children":3375},{},[3376],{"type":993,"tag":1049,"props":3377,"children":3379},{"className":1051,"code":3378,"language":6,"meta":8,"style":8},"class ShoppingCart:\n    def __init__(self):\n        self.items = []\n        self.quantities = {}\n    \n    def add_item(self, item, quantity=1):\n        if item in self.quantities:\n            self.quantities[item] += quantity\n        else:\n            self.items.append(item)\n            self.quantities[item] = quantity\n    \n    def __len__(self):\n        # Return total number of unique items\n        return len(self.items)\n    \n    def __getitem__(self, index):\n        # Support indexing: cart[0]\n        item = self.items[index]\n        return f\"{item} (qty: {self.quantities[item]})\"\n    \n    def __contains__(self, item):\n        # Support 'in' operator: \"apple\" in cart\n        return item in self.items\n    \n    def __iter__(self):\n        # Support iteration: for item in cart\n        for item in self.items:\n            yield f\"{item} (qty: {self.quantities[item]})\"\n    \n    def __str__(self):\n        return f\"Shopping Cart: {len(self)} items\"\n\n# Container methods enable natural usage\ncart = ShoppingCart()\ncart.add_item(\"Apple\", 3)\ncart.add_item(\"Banana\", 2)\ncart.add_item(\"Orange\", 1)\n\nprint(f\"Cart size: {len(cart)}\")      # Uses __len__\nprint(f\"First item: {cart[0]}\")       # Uses __getitem__\nprint(\"Apple\" in cart)                # Uses __contains__\n\nprint(\"All items:\")\nfor item in cart:                     # Uses __iter__\n    print(f\"  {item}\")\n",[3380],{"type":993,"tag":1007,"props":3381,"children":3382},{"__ignoreMap":8},[3383,3399,3414,3434,3455,3462,3493,3518,3541,3553,3565,3584,3591,3606,3614,3638,3645,3661,3669,3690,3740,3747,3763,3771,3795,3802,3818,3826,3851,3899,3906,3921,3963,3970,3978,3995,4021,4046,4070,4077,4123,4177,4205,4212,4232,4257],{"type":993,"tag":1058,"props":3384,"children":3385},{"class":1060,"line":12},[3386,3390,3395],{"type":993,"tag":1058,"props":3387,"children":3388},{"style":1073},[3389],{"type":998,"value":1076},{"type":993,"tag":1058,"props":3391,"children":3392},{"style":1079},[3393],{"type":998,"value":3394}," ShoppingCart",{"type":993,"tag":1058,"props":3396,"children":3397},{"style":1085},[3398],{"type":998,"value":1088},{"type":993,"tag":1058,"props":3400,"children":3401},{"class":1060,"line":27},[3402,3406,3410],{"type":993,"tag":1058,"props":3403,"children":3404},{"style":1073},[3405],{"type":998,"value":1096},{"type":993,"tag":1058,"props":3407,"children":3408},{"style":1099},[3409],{"type":998,"value":1102},{"type":993,"tag":1058,"props":3411,"children":3412},{"style":1085},[3413],{"type":998,"value":2103},{"type":993,"tag":1058,"props":3415,"children":3416},{"class":1060,"line":36},[3417,3421,3426,3430],{"type":993,"tag":1058,"props":3418,"children":3419},{"style":1099},[3420],{"type":998,"value":1115},{"type":993,"tag":1058,"props":3422,"children":3423},{"style":1085},[3424],{"type":998,"value":3425},".items ",{"type":993,"tag":1058,"props":3427,"children":3428},{"style":1073},[3429],{"type":998,"value":1125},{"type":993,"tag":1058,"props":3431,"children":3432},{"style":1085},[3433],{"type":998,"value":1151},{"type":993,"tag":1058,"props":3435,"children":3436},{"class":1060,"line":45},[3437,3441,3446,3450],{"type":993,"tag":1058,"props":3438,"children":3439},{"style":1099},[3440],{"type":998,"value":1115},{"type":993,"tag":1058,"props":3442,"children":3443},{"style":1085},[3444],{"type":998,"value":3445},".quantities ",{"type":993,"tag":1058,"props":3447,"children":3448},{"style":1073},[3449],{"type":998,"value":1125},{"type":993,"tag":1058,"props":3451,"children":3452},{"style":1085},[3453],{"type":998,"value":3454}," {}\n",{"type":993,"tag":1058,"props":3456,"children":3457},{"class":1060,"line":54},[3458],{"type":993,"tag":1058,"props":3459,"children":3460},{"style":1085},[3461],{"type":998,"value":1159},{"type":993,"tag":1058,"props":3463,"children":3464},{"class":1060,"line":63},[3465,3469,3474,3479,3483,3488],{"type":993,"tag":1058,"props":3466,"children":3467},{"style":1073},[3468],{"type":998,"value":1096},{"type":993,"tag":1058,"props":3470,"children":3471},{"style":1079},[3472],{"type":998,"value":3473}," add_item",{"type":993,"tag":1058,"props":3475,"children":3476},{"style":1085},[3477],{"type":998,"value":3478},"(self, item, quantity",{"type":993,"tag":1058,"props":3480,"children":3481},{"style":1073},[3482],{"type":998,"value":1125},{"type":993,"tag":1058,"props":3484,"children":3485},{"style":1099},[3486],{"type":998,"value":3487},"1",{"type":993,"tag":1058,"props":3489,"children":3490},{"style":1085},[3491],{"type":998,"value":3492},"):\n",{"type":993,"tag":1058,"props":3494,"children":3495},{"class":1060,"line":72},[3496,3500,3505,3509,3513],{"type":993,"tag":1058,"props":3497,"children":3498},{"style":1073},[3499],{"type":998,"value":2697},{"type":993,"tag":1058,"props":3501,"children":3502},{"style":1085},[3503],{"type":998,"value":3504}," item ",{"type":993,"tag":1058,"props":3506,"children":3507},{"style":1073},[3508],{"type":998,"value":1394},{"type":993,"tag":1058,"props":3510,"children":3511},{"style":1099},[3512],{"type":998,"value":1343},{"type":993,"tag":1058,"props":3514,"children":3515},{"style":1085},[3516],{"type":998,"value":3517},".quantities:\n",{"type":993,"tag":1058,"props":3519,"children":3520},{"class":1060,"line":81},[3521,3526,3531,3536],{"type":993,"tag":1058,"props":3522,"children":3523},{"style":1099},[3524],{"type":998,"value":3525},"            self",{"type":993,"tag":1058,"props":3527,"children":3528},{"style":1085},[3529],{"type":998,"value":3530},".quantities[item] ",{"type":993,"tag":1058,"props":3532,"children":3533},{"style":1073},[3534],{"type":998,"value":3535},"+=",{"type":993,"tag":1058,"props":3537,"children":3538},{"style":1085},[3539],{"type":998,"value":3540}," quantity\n",{"type":993,"tag":1058,"props":3542,"children":3543},{"class":1060,"line":91},[3544,3549],{"type":993,"tag":1058,"props":3545,"children":3546},{"style":1073},[3547],{"type":998,"value":3548},"        else",{"type":993,"tag":1058,"props":3550,"children":3551},{"style":1085},[3552],{"type":998,"value":1088},{"type":993,"tag":1058,"props":3554,"children":3555},{"class":1060,"line":100},[3556,3560],{"type":993,"tag":1058,"props":3557,"children":3558},{"style":1099},[3559],{"type":998,"value":3525},{"type":993,"tag":1058,"props":3561,"children":3562},{"style":1085},[3563],{"type":998,"value":3564},".items.append(item)\n",{"type":993,"tag":1058,"props":3566,"children":3567},{"class":1060,"line":109},[3568,3572,3576,3580],{"type":993,"tag":1058,"props":3569,"children":3570},{"style":1099},[3571],{"type":998,"value":3525},{"type":993,"tag":1058,"props":3573,"children":3574},{"style":1085},[3575],{"type":998,"value":3530},{"type":993,"tag":1058,"props":3577,"children":3578},{"style":1073},[3579],{"type":998,"value":1125},{"type":993,"tag":1058,"props":3581,"children":3582},{"style":1085},[3583],{"type":998,"value":3540},{"type":993,"tag":1058,"props":3585,"children":3586},{"class":1060,"line":118},[3587],{"type":993,"tag":1058,"props":3588,"children":3589},{"style":1085},[3590],{"type":998,"value":1159},{"type":993,"tag":1058,"props":3592,"children":3593},{"class":1060,"line":127},[3594,3598,3602],{"type":993,"tag":1058,"props":3595,"children":3596},{"style":1073},[3597],{"type":998,"value":1096},{"type":993,"tag":1058,"props":3599,"children":3600},{"style":1099},[3601],{"type":998,"value":1268},{"type":993,"tag":1058,"props":3603,"children":3604},{"style":1085},[3605],{"type":998,"value":2103},{"type":993,"tag":1058,"props":3607,"children":3608},{"class":1060,"line":136},[3609],{"type":993,"tag":1058,"props":3610,"children":3611},{"style":1064},[3612],{"type":998,"value":3613},"        # Return total number of unique items\n",{"type":993,"tag":1058,"props":3615,"children":3616},{"class":1060,"line":146},[3617,3621,3625,3629,3633],{"type":993,"tag":1058,"props":3618,"children":3619},{"style":1073},[3620],{"type":998,"value":1189},{"type":993,"tag":1058,"props":3622,"children":3623},{"style":1099},[3624],{"type":998,"value":1289},{"type":993,"tag":1058,"props":3626,"children":3627},{"style":1085},[3628],{"type":998,"value":1230},{"type":993,"tag":1058,"props":3630,"children":3631},{"style":1099},[3632],{"type":998,"value":1235},{"type":993,"tag":1058,"props":3634,"children":3635},{"style":1085},[3636],{"type":998,"value":3637},".items)\n",{"type":993,"tag":1058,"props":3639,"children":3640},{"class":1060,"line":155},[3641],{"type":993,"tag":1058,"props":3642,"children":3643},{"style":1085},[3644],{"type":998,"value":1159},{"type":993,"tag":1058,"props":3646,"children":3647},{"class":1060,"line":164},[3648,3652,3656],{"type":993,"tag":1058,"props":3649,"children":3650},{"style":1073},[3651],{"type":998,"value":1096},{"type":993,"tag":1058,"props":3653,"children":3654},{"style":1099},[3655],{"type":998,"value":1321},{"type":993,"tag":1058,"props":3657,"children":3658},{"style":1085},[3659],{"type":998,"value":3660},"(self, index):\n",{"type":993,"tag":1058,"props":3662,"children":3663},{"class":1060,"line":173},[3664],{"type":993,"tag":1058,"props":3665,"children":3666},{"style":1064},[3667],{"type":998,"value":3668},"        # Support indexing: cart[0]\n",{"type":993,"tag":1058,"props":3670,"children":3671},{"class":1060,"line":182},[3672,3677,3681,3685],{"type":993,"tag":1058,"props":3673,"children":3674},{"style":1085},[3675],{"type":998,"value":3676},"        item ",{"type":993,"tag":1058,"props":3678,"children":3679},{"style":1073},[3680],{"type":998,"value":1125},{"type":993,"tag":1058,"props":3682,"children":3683},{"style":1099},[3684],{"type":998,"value":1343},{"type":993,"tag":1058,"props":3686,"children":3687},{"style":1085},[3688],{"type":998,"value":3689},".items[index]\n",{"type":993,"tag":1058,"props":3691,"children":3692},{"class":1060,"line":191},[3693,3697,3701,3705,3709,3714,3718,3723,3727,3732,3736],{"type":993,"tag":1058,"props":3694,"children":3695},{"style":1073},[3696],{"type":998,"value":1189},{"type":993,"tag":1058,"props":3698,"children":3699},{"style":1073},[3700],{"type":998,"value":1194},{"type":993,"tag":1058,"props":3702,"children":3703},{"style":1197},[3704],{"type":998,"value":1579},{"type":993,"tag":1058,"props":3706,"children":3707},{"style":1099},[3708],{"type":998,"value":1614},{"type":993,"tag":1058,"props":3710,"children":3711},{"style":1085},[3712],{"type":998,"value":3713},"item",{"type":993,"tag":1058,"props":3715,"children":3716},{"style":1099},[3717],{"type":998,"value":1215},{"type":993,"tag":1058,"props":3719,"children":3720},{"style":1197},[3721],{"type":998,"value":3722}," (qty: ",{"type":993,"tag":1058,"props":3724,"children":3725},{"style":1099},[3726],{"type":998,"value":1205},{"type":993,"tag":1058,"props":3728,"children":3729},{"style":1085},[3730],{"type":998,"value":3731},".quantities[item]",{"type":993,"tag":1058,"props":3733,"children":3734},{"style":1099},[3735],{"type":998,"value":1215},{"type":993,"tag":1058,"props":3737,"children":3738},{"style":1197},[3739],{"type":998,"value":2657},{"type":993,"tag":1058,"props":3741,"children":3742},{"class":1060,"line":201},[3743],{"type":993,"tag":1058,"props":3744,"children":3745},{"style":1085},[3746],{"type":998,"value":1159},{"type":993,"tag":1058,"props":3748,"children":3749},{"class":1060,"line":210},[3750,3754,3758],{"type":993,"tag":1058,"props":3751,"children":3752},{"style":1073},[3753],{"type":998,"value":1096},{"type":993,"tag":1058,"props":3755,"children":3756},{"style":1099},[3757],{"type":998,"value":1367},{"type":993,"tag":1058,"props":3759,"children":3760},{"style":1085},[3761],{"type":998,"value":3762},"(self, item):\n",{"type":993,"tag":1058,"props":3764,"children":3765},{"class":1060,"line":219},[3766],{"type":993,"tag":1058,"props":3767,"children":3768},{"style":1064},[3769],{"type":998,"value":3770},"        # Support 'in' operator: \"apple\" in cart\n",{"type":993,"tag":1058,"props":3772,"children":3773},{"class":1060,"line":228},[3774,3778,3782,3786,3790],{"type":993,"tag":1058,"props":3775,"children":3776},{"style":1073},[3777],{"type":998,"value":1189},{"type":993,"tag":1058,"props":3779,"children":3780},{"style":1085},[3781],{"type":998,"value":3504},{"type":993,"tag":1058,"props":3783,"children":3784},{"style":1073},[3785],{"type":998,"value":1394},{"type":993,"tag":1058,"props":3787,"children":3788},{"style":1099},[3789],{"type":998,"value":1343},{"type":993,"tag":1058,"props":3791,"children":3792},{"style":1085},[3793],{"type":998,"value":3794},".items\n",{"type":993,"tag":1058,"props":3796,"children":3797},{"class":1060,"line":238},[3798],{"type":993,"tag":1058,"props":3799,"children":3800},{"style":1085},[3801],{"type":998,"value":1159},{"type":993,"tag":1058,"props":3803,"children":3804},{"class":1060,"line":247},[3805,3809,3814],{"type":993,"tag":1058,"props":3806,"children":3807},{"style":1073},[3808],{"type":998,"value":1096},{"type":993,"tag":1058,"props":3810,"children":3811},{"style":1099},[3812],{"type":998,"value":3813}," __iter__",{"type":993,"tag":1058,"props":3815,"children":3816},{"style":1085},[3817],{"type":998,"value":2103},{"type":993,"tag":1058,"props":3819,"children":3820},{"class":1060,"line":256},[3821],{"type":993,"tag":1058,"props":3822,"children":3823},{"style":1064},[3824],{"type":998,"value":3825},"        # Support iteration: for item in cart\n",{"type":993,"tag":1058,"props":3827,"children":3828},{"class":1060,"line":265},[3829,3834,3838,3842,3846],{"type":993,"tag":1058,"props":3830,"children":3831},{"style":1073},[3832],{"type":998,"value":3833},"        for",{"type":993,"tag":1058,"props":3835,"children":3836},{"style":1085},[3837],{"type":998,"value":3504},{"type":993,"tag":1058,"props":3839,"children":3840},{"style":1073},[3841],{"type":998,"value":1394},{"type":993,"tag":1058,"props":3843,"children":3844},{"style":1099},[3845],{"type":998,"value":1343},{"type":993,"tag":1058,"props":3847,"children":3848},{"style":1085},[3849],{"type":998,"value":3850},".items:\n",{"type":993,"tag":1058,"props":3852,"children":3853},{"class":1060,"line":274},[3854,3859,3863,3867,3871,3875,3879,3883,3887,3891,3895],{"type":993,"tag":1058,"props":3855,"children":3856},{"style":1073},[3857],{"type":998,"value":3858},"            yield",{"type":993,"tag":1058,"props":3860,"children":3861},{"style":1073},[3862],{"type":998,"value":1194},{"type":993,"tag":1058,"props":3864,"children":3865},{"style":1197},[3866],{"type":998,"value":1579},{"type":993,"tag":1058,"props":3868,"children":3869},{"style":1099},[3870],{"type":998,"value":1614},{"type":993,"tag":1058,"props":3872,"children":3873},{"style":1085},[3874],{"type":998,"value":3713},{"type":993,"tag":1058,"props":3876,"children":3877},{"style":1099},[3878],{"type":998,"value":1215},{"type":993,"tag":1058,"props":3880,"children":3881},{"style":1197},[3882],{"type":998,"value":3722},{"type":993,"tag":1058,"props":3884,"children":3885},{"style":1099},[3886],{"type":998,"value":1205},{"type":993,"tag":1058,"props":3888,"children":3889},{"style":1085},[3890],{"type":998,"value":3731},{"type":993,"tag":1058,"props":3892,"children":3893},{"style":1099},[3894],{"type":998,"value":1215},{"type":993,"tag":1058,"props":3896,"children":3897},{"style":1197},[3898],{"type":998,"value":2657},{"type":993,"tag":1058,"props":3900,"children":3901},{"class":1060,"line":284},[3902],{"type":993,"tag":1058,"props":3903,"children":3904},{"style":1085},[3905],{"type":998,"value":1159},{"type":993,"tag":1058,"props":3907,"children":3908},{"class":1060,"line":293},[3909,3913,3917],{"type":993,"tag":1058,"props":3910,"children":3911},{"style":1073},[3912],{"type":998,"value":1096},{"type":993,"tag":1058,"props":3914,"children":3915},{"style":1099},[3916],{"type":998,"value":1171},{"type":993,"tag":1058,"props":3918,"children":3919},{"style":1085},[3920],{"type":998,"value":2103},{"type":993,"tag":1058,"props":3922,"children":3923},{"class":1060,"line":302},[3924,3928,3932,3937,3941,3945,3949,3954,3958],{"type":993,"tag":1058,"props":3925,"children":3926},{"style":1073},[3927],{"type":998,"value":1189},{"type":993,"tag":1058,"props":3929,"children":3930},{"style":1073},[3931],{"type":998,"value":1194},{"type":993,"tag":1058,"props":3933,"children":3934},{"style":1197},[3935],{"type":998,"value":3936},"\"Shopping Cart: ",{"type":993,"tag":1058,"props":3938,"children":3939},{"style":1099},[3940],{"type":998,"value":1225},{"type":993,"tag":1058,"props":3942,"children":3943},{"style":1085},[3944],{"type":998,"value":1230},{"type":993,"tag":1058,"props":3946,"children":3947},{"style":1099},[3948],{"type":998,"value":1235},{"type":993,"tag":1058,"props":3950,"children":3951},{"style":1085},[3952],{"type":998,"value":3953},")",{"type":993,"tag":1058,"props":3955,"children":3956},{"style":1099},[3957],{"type":998,"value":1215},{"type":993,"tag":1058,"props":3959,"children":3960},{"style":1197},[3961],{"type":998,"value":3962}," items\"\n",{"type":993,"tag":1058,"props":3964,"children":3965},{"class":1060,"line":311},[3966],{"type":993,"tag":1058,"props":3967,"children":3968},{"emptyLinePlaceholder":13},[3969],{"type":998,"value":1447},{"type":993,"tag":1058,"props":3971,"children":3972},{"class":1060,"line":320},[3973],{"type":993,"tag":1058,"props":3974,"children":3975},{"style":1064},[3976],{"type":998,"value":3977},"# Container methods enable natural usage\n",{"type":993,"tag":1058,"props":3979,"children":3980},{"class":1060,"line":329},[3981,3986,3990],{"type":993,"tag":1058,"props":3982,"children":3983},{"style":1085},[3984],{"type":998,"value":3985},"cart ",{"type":993,"tag":1058,"props":3987,"children":3988},{"style":1073},[3989],{"type":998,"value":1125},{"type":993,"tag":1058,"props":3991,"children":3992},{"style":1085},[3993],{"type":998,"value":3994}," ShoppingCart()\n",{"type":993,"tag":1058,"props":3996,"children":3997},{"class":1060,"line":338},[3998,4003,4008,4012,4017],{"type":993,"tag":1058,"props":3999,"children":4000},{"style":1085},[4001],{"type":998,"value":4002},"cart.add_item(",{"type":993,"tag":1058,"props":4004,"children":4005},{"style":1197},[4006],{"type":998,"value":4007},"\"Apple\"",{"type":993,"tag":1058,"props":4009,"children":4010},{"style":1085},[4011],{"type":998,"value":1014},{"type":993,"tag":1058,"props":4013,"children":4014},{"style":1099},[4015],{"type":998,"value":4016},"3",{"type":993,"tag":1058,"props":4018,"children":4019},{"style":1085},[4020],{"type":998,"value":1482},{"type":993,"tag":1058,"props":4022,"children":4023},{"class":1060,"line":347},[4024,4028,4033,4037,4042],{"type":993,"tag":1058,"props":4025,"children":4026},{"style":1085},[4027],{"type":998,"value":4002},{"type":993,"tag":1058,"props":4029,"children":4030},{"style":1197},[4031],{"type":998,"value":4032},"\"Banana\"",{"type":993,"tag":1058,"props":4034,"children":4035},{"style":1085},[4036],{"type":998,"value":1014},{"type":993,"tag":1058,"props":4038,"children":4039},{"style":1099},[4040],{"type":998,"value":4041},"2",{"type":993,"tag":1058,"props":4043,"children":4044},{"style":1085},[4045],{"type":998,"value":1482},{"type":993,"tag":1058,"props":4047,"children":4048},{"class":1060,"line":356},[4049,4053,4058,4062,4066],{"type":993,"tag":1058,"props":4050,"children":4051},{"style":1085},[4052],{"type":998,"value":4002},{"type":993,"tag":1058,"props":4054,"children":4055},{"style":1197},[4056],{"type":998,"value":4057},"\"Orange\"",{"type":993,"tag":1058,"props":4059,"children":4060},{"style":1085},[4061],{"type":998,"value":1014},{"type":993,"tag":1058,"props":4063,"children":4064},{"style":1099},[4065],{"type":998,"value":3487},{"type":993,"tag":1058,"props":4067,"children":4068},{"style":1085},[4069],{"type":998,"value":1482},{"type":993,"tag":1058,"props":4071,"children":4072},{"class":1060,"line":365},[4073],{"type":993,"tag":1058,"props":4074,"children":4075},{"emptyLinePlaceholder":13},[4076],{"type":998,"value":1447},{"type":993,"tag":1058,"props":4078,"children":4079},{"class":1060,"line":374},[4080,4084,4088,4092,4097,4101,4106,4110,4114,4119],{"type":993,"tag":1058,"props":4081,"children":4082},{"style":1099},[4083],{"type":998,"value":1530},{"type":993,"tag":1058,"props":4085,"children":4086},{"style":1085},[4087],{"type":998,"value":1230},{"type":993,"tag":1058,"props":4089,"children":4090},{"style":1073},[4091],{"type":998,"value":1556},{"type":993,"tag":1058,"props":4093,"children":4094},{"style":1197},[4095],{"type":998,"value":4096},"\"Cart size: ",{"type":993,"tag":1058,"props":4098,"children":4099},{"style":1099},[4100],{"type":998,"value":1225},{"type":993,"tag":1058,"props":4102,"children":4103},{"style":1085},[4104],{"type":998,"value":4105},"(cart)",{"type":993,"tag":1058,"props":4107,"children":4108},{"style":1099},[4109],{"type":998,"value":1215},{"type":993,"tag":1058,"props":4111,"children":4112},{"style":1197},[4113],{"type":998,"value":1579},{"type":993,"tag":1058,"props":4115,"children":4116},{"style":1085},[4117],{"type":998,"value":4118},")      ",{"type":993,"tag":1058,"props":4120,"children":4121},{"style":1064},[4122],{"type":998,"value":1589},{"type":993,"tag":1058,"props":4124,"children":4125},{"class":1060,"line":384},[4126,4130,4134,4138,4143,4147,4152,4156,4160,4164,4168,4173],{"type":993,"tag":1058,"props":4127,"children":4128},{"style":1099},[4129],{"type":998,"value":1530},{"type":993,"tag":1058,"props":4131,"children":4132},{"style":1085},[4133],{"type":998,"value":1230},{"type":993,"tag":1058,"props":4135,"children":4136},{"style":1073},[4137],{"type":998,"value":1556},{"type":993,"tag":1058,"props":4139,"children":4140},{"style":1197},[4141],{"type":998,"value":4142},"\"First item: ",{"type":993,"tag":1058,"props":4144,"children":4145},{"style":1099},[4146],{"type":998,"value":1614},{"type":993,"tag":1058,"props":4148,"children":4149},{"style":1085},[4150],{"type":998,"value":4151},"cart[",{"type":993,"tag":1058,"props":4153,"children":4154},{"style":1099},[4155],{"type":998,"value":1624},{"type":993,"tag":1058,"props":4157,"children":4158},{"style":1085},[4159],{"type":998,"value":1629},{"type":993,"tag":1058,"props":4161,"children":4162},{"style":1099},[4163],{"type":998,"value":1215},{"type":993,"tag":1058,"props":4165,"children":4166},{"style":1197},[4167],{"type":998,"value":1579},{"type":993,"tag":1058,"props":4169,"children":4170},{"style":1085},[4171],{"type":998,"value":4172},")       ",{"type":993,"tag":1058,"props":4174,"children":4175},{"style":1064},[4176],{"type":998,"value":1646},{"type":993,"tag":1058,"props":4178,"children":4179},{"class":1060,"line":393},[4180,4184,4188,4192,4196,4201],{"type":993,"tag":1058,"props":4181,"children":4182},{"style":1099},[4183],{"type":998,"value":1530},{"type":993,"tag":1058,"props":4185,"children":4186},{"style":1085},[4187],{"type":998,"value":1230},{"type":993,"tag":1058,"props":4189,"children":4190},{"style":1197},[4191],{"type":998,"value":4007},{"type":993,"tag":1058,"props":4193,"children":4194},{"style":1073},[4195],{"type":998,"value":1666},{"type":993,"tag":1058,"props":4197,"children":4198},{"style":1085},[4199],{"type":998,"value":4200}," cart)                ",{"type":993,"tag":1058,"props":4202,"children":4203},{"style":1064},[4204],{"type":998,"value":1676},{"type":993,"tag":1058,"props":4206,"children":4207},{"class":1060,"line":402},[4208],{"type":993,"tag":1058,"props":4209,"children":4210},{"emptyLinePlaceholder":13},[4211],{"type":998,"value":1447},{"type":993,"tag":1058,"props":4213,"children":4214},{"class":1060,"line":411},[4215,4219,4223,4228],{"type":993,"tag":1058,"props":4216,"children":4217},{"style":1099},[4218],{"type":998,"value":1530},{"type":993,"tag":1058,"props":4220,"children":4221},{"style":1085},[4222],{"type":998,"value":1230},{"type":993,"tag":1058,"props":4224,"children":4225},{"style":1197},[4226],{"type":998,"value":4227},"\"All items:\"",{"type":993,"tag":1058,"props":4229,"children":4230},{"style":1085},[4231],{"type":998,"value":1482},{"type":993,"tag":1058,"props":4233,"children":4234},{"class":1060,"line":420},[4235,4239,4243,4247,4252],{"type":993,"tag":1058,"props":4236,"children":4237},{"style":1073},[4238],{"type":998,"value":3294},{"type":993,"tag":1058,"props":4240,"children":4241},{"style":1085},[4242],{"type":998,"value":3504},{"type":993,"tag":1058,"props":4244,"children":4245},{"style":1073},[4246],{"type":998,"value":1394},{"type":993,"tag":1058,"props":4248,"children":4249},{"style":1085},[4250],{"type":998,"value":4251}," cart:                     ",{"type":993,"tag":1058,"props":4253,"children":4254},{"style":1064},[4255],{"type":998,"value":4256},"# Uses __iter__\n",{"type":993,"tag":1058,"props":4258,"children":4259},{"class":1060,"line":429},[4260,4264,4268,4272,4276,4280,4284,4288,4292],{"type":993,"tag":1058,"props":4261,"children":4262},{"style":1099},[4263],{"type":998,"value":3316},{"type":993,"tag":1058,"props":4265,"children":4266},{"style":1085},[4267],{"type":998,"value":1230},{"type":993,"tag":1058,"props":4269,"children":4270},{"style":1073},[4271],{"type":998,"value":1556},{"type":993,"tag":1058,"props":4273,"children":4274},{"style":1197},[4275],{"type":998,"value":3329},{"type":993,"tag":1058,"props":4277,"children":4278},{"style":1099},[4279],{"type":998,"value":1614},{"type":993,"tag":1058,"props":4281,"children":4282},{"style":1085},[4283],{"type":998,"value":3713},{"type":993,"tag":1058,"props":4285,"children":4286},{"style":1099},[4287],{"type":998,"value":1215},{"type":993,"tag":1058,"props":4289,"children":4290},{"style":1197},[4291],{"type":998,"value":1579},{"type":993,"tag":1058,"props":4293,"children":4294},{"style":1085},[4295],{"type":998,"value":1482},{"type":993,"tag":1678,"props":4297,"children":4299},{"id":4298},"arithmetic-operations",[4300],{"type":998,"value":4301},"🚀 Arithmetic Operations",{"type":993,"tag":1001,"props":4303,"children":4304},{},[4305],{"type":998,"value":4306},"Arithmetic special methods allow your objects to work with mathematical operators, creating intuitive interfaces for numeric-like classes.",{"type":993,"tag":1931,"props":4308,"children":4310},{"id":4309},"basic-arithmetic",[4311],{"type":998,"value":4312},"Basic Arithmetic",{"type":993,"tag":1001,"props":4314,"children":4315},{},[4316],{"type":998,"value":4317},"Implementing arithmetic methods lets you use standard operators with your custom objects.",{"type":993,"tag":1045,"props":4319,"children":4320},{},[4321],{"type":993,"tag":1049,"props":4322,"children":4324},{"className":1051,"code":4323,"language":6,"meta":8,"style":8},"class Vector2D:\n    def __init__(self, x, y):\n        self.x = x\n        self.y = y\n    \n    def __str__(self):\n        return f\"Vector({self.x}, {self.y})\"\n    \n    def __add__(self, other):\n        # Vector addition: v1 + v2\n        return Vector2D(self.x + other.x, self.y + other.y)\n    \n    def __sub__(self, other):\n        # Vector subtraction: v1 - v2\n        return Vector2D(self.x - other.x, self.y - other.y)\n    \n    def __mul__(self, scalar):\n        # Scalar multiplication: v * 3\n        return Vector2D(self.x * scalar, self.y * scalar)\n    \n    def __eq__(self, other):\n        # Vector equality\n        return self.x == other.x and self.y == other.y\n    \n    def __abs__(self):\n        # Vector magnitude\n        return (self.x ** 2 + self.y ** 2) ** 0.5\n\n# Arithmetic operations work naturally\nv1 = Vector2D(3, 4)\nv2 = Vector2D(1, 2)\n\nprint(f\"v1: {v1}\")\nprint(f\"v2: {v2}\")\nprint(f\"v1 + v2: {v1 + v2}\")\nprint(f\"v1 - v2: {v1 - v2}\")\nprint(f\"v1 * 2: {v1 * 2}\")\nprint(f\"Magnitude of v1: {abs(v1):.2f}\")\nprint(f\"v1 == v2: {v1 == v2}\")\n",[4325],{"type":993,"tag":1007,"props":4326,"children":4327},{"__ignoreMap":8},[4328,4344,4360,4381,4402,4409,4424,4474,4481,4497,4505,4552,4559,4575,4583,4627,4634,4651,4659,4705,4712,4727,4735,4781,4788,4804,4812,4876,4883,4891,4924,4956,4963,5004,5045,5094,5142,5187,5234],{"type":993,"tag":1058,"props":4329,"children":4330},{"class":1060,"line":12},[4331,4335,4340],{"type":993,"tag":1058,"props":4332,"children":4333},{"style":1073},[4334],{"type":998,"value":1076},{"type":993,"tag":1058,"props":4336,"children":4337},{"style":1079},[4338],{"type":998,"value":4339}," Vector2D",{"type":993,"tag":1058,"props":4341,"children":4342},{"style":1085},[4343],{"type":998,"value":1088},{"type":993,"tag":1058,"props":4345,"children":4346},{"class":1060,"line":27},[4347,4351,4355],{"type":993,"tag":1058,"props":4348,"children":4349},{"style":1073},[4350],{"type":998,"value":1096},{"type":993,"tag":1058,"props":4352,"children":4353},{"style":1099},[4354],{"type":998,"value":1102},{"type":993,"tag":1058,"props":4356,"children":4357},{"style":1085},[4358],{"type":998,"value":4359},"(self, x, y):\n",{"type":993,"tag":1058,"props":4361,"children":4362},{"class":1060,"line":36},[4363,4367,4372,4376],{"type":993,"tag":1058,"props":4364,"children":4365},{"style":1099},[4366],{"type":998,"value":1115},{"type":993,"tag":1058,"props":4368,"children":4369},{"style":1085},[4370],{"type":998,"value":4371},".x ",{"type":993,"tag":1058,"props":4373,"children":4374},{"style":1073},[4375],{"type":998,"value":1125},{"type":993,"tag":1058,"props":4377,"children":4378},{"style":1085},[4379],{"type":998,"value":4380}," x\n",{"type":993,"tag":1058,"props":4382,"children":4383},{"class":1060,"line":45},[4384,4388,4393,4397],{"type":993,"tag":1058,"props":4385,"children":4386},{"style":1099},[4387],{"type":998,"value":1115},{"type":993,"tag":1058,"props":4389,"children":4390},{"style":1085},[4391],{"type":998,"value":4392},".y ",{"type":993,"tag":1058,"props":4394,"children":4395},{"style":1073},[4396],{"type":998,"value":1125},{"type":993,"tag":1058,"props":4398,"children":4399},{"style":1085},[4400],{"type":998,"value":4401}," y\n",{"type":993,"tag":1058,"props":4403,"children":4404},{"class":1060,"line":54},[4405],{"type":993,"tag":1058,"props":4406,"children":4407},{"style":1085},[4408],{"type":998,"value":1159},{"type":993,"tag":1058,"props":4410,"children":4411},{"class":1060,"line":63},[4412,4416,4420],{"type":993,"tag":1058,"props":4413,"children":4414},{"style":1073},[4415],{"type":998,"value":1096},{"type":993,"tag":1058,"props":4417,"children":4418},{"style":1099},[4419],{"type":998,"value":1171},{"type":993,"tag":1058,"props":4421,"children":4422},{"style":1085},[4423],{"type":998,"value":2103},{"type":993,"tag":1058,"props":4425,"children":4426},{"class":1060,"line":72},[4427,4431,4435,4440,4444,4449,4453,4457,4461,4466,4470],{"type":993,"tag":1058,"props":4428,"children":4429},{"style":1073},[4430],{"type":998,"value":1189},{"type":993,"tag":1058,"props":4432,"children":4433},{"style":1073},[4434],{"type":998,"value":1194},{"type":993,"tag":1058,"props":4436,"children":4437},{"style":1197},[4438],{"type":998,"value":4439},"\"Vector(",{"type":993,"tag":1058,"props":4441,"children":4442},{"style":1099},[4443],{"type":998,"value":1205},{"type":993,"tag":1058,"props":4445,"children":4446},{"style":1085},[4447],{"type":998,"value":4448},".x",{"type":993,"tag":1058,"props":4450,"children":4451},{"style":1099},[4452],{"type":998,"value":1215},{"type":993,"tag":1058,"props":4454,"children":4455},{"style":1197},[4456],{"type":998,"value":1014},{"type":993,"tag":1058,"props":4458,"children":4459},{"style":1099},[4460],{"type":998,"value":1205},{"type":993,"tag":1058,"props":4462,"children":4463},{"style":1085},[4464],{"type":998,"value":4465},".y",{"type":993,"tag":1058,"props":4467,"children":4468},{"style":1099},[4469],{"type":998,"value":1215},{"type":993,"tag":1058,"props":4471,"children":4472},{"style":1197},[4473],{"type":998,"value":2657},{"type":993,"tag":1058,"props":4475,"children":4476},{"class":1060,"line":81},[4477],{"type":993,"tag":1058,"props":4478,"children":4479},{"style":1085},[4480],{"type":998,"value":1159},{"type":993,"tag":1058,"props":4482,"children":4483},{"class":1060,"line":91},[4484,4488,4493],{"type":993,"tag":1058,"props":4485,"children":4486},{"style":1073},[4487],{"type":998,"value":1096},{"type":993,"tag":1058,"props":4489,"children":4490},{"style":1099},[4491],{"type":998,"value":4492}," __add__",{"type":993,"tag":1058,"props":4494,"children":4495},{"style":1085},[4496],{"type":998,"value":2681},{"type":993,"tag":1058,"props":4498,"children":4499},{"class":1060,"line":100},[4500],{"type":993,"tag":1058,"props":4501,"children":4502},{"style":1064},[4503],{"type":998,"value":4504},"        # Vector addition: v1 + v2\n",{"type":993,"tag":1058,"props":4506,"children":4507},{"class":1060,"line":109},[4508,4512,4517,4521,4525,4530,4535,4539,4543,4547],{"type":993,"tag":1058,"props":4509,"children":4510},{"style":1073},[4511],{"type":998,"value":1189},{"type":993,"tag":1058,"props":4513,"children":4514},{"style":1085},[4515],{"type":998,"value":4516}," Vector2D(",{"type":993,"tag":1058,"props":4518,"children":4519},{"style":1099},[4520],{"type":998,"value":1235},{"type":993,"tag":1058,"props":4522,"children":4523},{"style":1085},[4524],{"type":998,"value":4371},{"type":993,"tag":1058,"props":4526,"children":4527},{"style":1073},[4528],{"type":998,"value":4529},"+",{"type":993,"tag":1058,"props":4531,"children":4532},{"style":1085},[4533],{"type":998,"value":4534}," other.x, ",{"type":993,"tag":1058,"props":4536,"children":4537},{"style":1099},[4538],{"type":998,"value":1235},{"type":993,"tag":1058,"props":4540,"children":4541},{"style":1085},[4542],{"type":998,"value":4392},{"type":993,"tag":1058,"props":4544,"children":4545},{"style":1073},[4546],{"type":998,"value":4529},{"type":993,"tag":1058,"props":4548,"children":4549},{"style":1085},[4550],{"type":998,"value":4551}," other.y)\n",{"type":993,"tag":1058,"props":4553,"children":4554},{"class":1060,"line":118},[4555],{"type":993,"tag":1058,"props":4556,"children":4557},{"style":1085},[4558],{"type":998,"value":1159},{"type":993,"tag":1058,"props":4560,"children":4561},{"class":1060,"line":127},[4562,4566,4571],{"type":993,"tag":1058,"props":4563,"children":4564},{"style":1073},[4565],{"type":998,"value":1096},{"type":993,"tag":1058,"props":4567,"children":4568},{"style":1099},[4569],{"type":998,"value":4570}," __sub__",{"type":993,"tag":1058,"props":4572,"children":4573},{"style":1085},[4574],{"type":998,"value":2681},{"type":993,"tag":1058,"props":4576,"children":4577},{"class":1060,"line":136},[4578],{"type":993,"tag":1058,"props":4579,"children":4580},{"style":1064},[4581],{"type":998,"value":4582},"        # Vector subtraction: v1 - v2\n",{"type":993,"tag":1058,"props":4584,"children":4585},{"class":1060,"line":146},[4586,4590,4594,4598,4602,4607,4611,4615,4619,4623],{"type":993,"tag":1058,"props":4587,"children":4588},{"style":1073},[4589],{"type":998,"value":1189},{"type":993,"tag":1058,"props":4591,"children":4592},{"style":1085},[4593],{"type":998,"value":4516},{"type":993,"tag":1058,"props":4595,"children":4596},{"style":1099},[4597],{"type":998,"value":1235},{"type":993,"tag":1058,"props":4599,"children":4600},{"style":1085},[4601],{"type":998,"value":4371},{"type":993,"tag":1058,"props":4603,"children":4604},{"style":1073},[4605],{"type":998,"value":4606},"-",{"type":993,"tag":1058,"props":4608,"children":4609},{"style":1085},[4610],{"type":998,"value":4534},{"type":993,"tag":1058,"props":4612,"children":4613},{"style":1099},[4614],{"type":998,"value":1235},{"type":993,"tag":1058,"props":4616,"children":4617},{"style":1085},[4618],{"type":998,"value":4392},{"type":993,"tag":1058,"props":4620,"children":4621},{"style":1073},[4622],{"type":998,"value":4606},{"type":993,"tag":1058,"props":4624,"children":4625},{"style":1085},[4626],{"type":998,"value":4551},{"type":993,"tag":1058,"props":4628,"children":4629},{"class":1060,"line":155},[4630],{"type":993,"tag":1058,"props":4631,"children":4632},{"style":1085},[4633],{"type":998,"value":1159},{"type":993,"tag":1058,"props":4635,"children":4636},{"class":1060,"line":164},[4637,4641,4646],{"type":993,"tag":1058,"props":4638,"children":4639},{"style":1073},[4640],{"type":998,"value":1096},{"type":993,"tag":1058,"props":4642,"children":4643},{"style":1099},[4644],{"type":998,"value":4645}," __mul__",{"type":993,"tag":1058,"props":4647,"children":4648},{"style":1085},[4649],{"type":998,"value":4650},"(self, scalar):\n",{"type":993,"tag":1058,"props":4652,"children":4653},{"class":1060,"line":173},[4654],{"type":993,"tag":1058,"props":4655,"children":4656},{"style":1064},[4657],{"type":998,"value":4658},"        # Scalar multiplication: v * 3\n",{"type":993,"tag":1058,"props":4660,"children":4661},{"class":1060,"line":182},[4662,4666,4670,4674,4678,4683,4688,4692,4696,4700],{"type":993,"tag":1058,"props":4663,"children":4664},{"style":1073},[4665],{"type":998,"value":1189},{"type":993,"tag":1058,"props":4667,"children":4668},{"style":1085},[4669],{"type":998,"value":4516},{"type":993,"tag":1058,"props":4671,"children":4672},{"style":1099},[4673],{"type":998,"value":1235},{"type":993,"tag":1058,"props":4675,"children":4676},{"style":1085},[4677],{"type":998,"value":4371},{"type":993,"tag":1058,"props":4679,"children":4680},{"style":1073},[4681],{"type":998,"value":4682},"*",{"type":993,"tag":1058,"props":4684,"children":4685},{"style":1085},[4686],{"type":998,"value":4687}," scalar, ",{"type":993,"tag":1058,"props":4689,"children":4690},{"style":1099},[4691],{"type":998,"value":1235},{"type":993,"tag":1058,"props":4693,"children":4694},{"style":1085},[4695],{"type":998,"value":4392},{"type":993,"tag":1058,"props":4697,"children":4698},{"style":1073},[4699],{"type":998,"value":4682},{"type":993,"tag":1058,"props":4701,"children":4702},{"style":1085},[4703],{"type":998,"value":4704}," scalar)\n",{"type":993,"tag":1058,"props":4706,"children":4707},{"class":1060,"line":191},[4708],{"type":993,"tag":1058,"props":4709,"children":4710},{"style":1085},[4711],{"type":998,"value":1159},{"type":993,"tag":1058,"props":4713,"children":4714},{"class":1060,"line":201},[4715,4719,4723],{"type":993,"tag":1058,"props":4716,"children":4717},{"style":1073},[4718],{"type":998,"value":1096},{"type":993,"tag":1058,"props":4720,"children":4721},{"style":1099},[4722],{"type":998,"value":2676},{"type":993,"tag":1058,"props":4724,"children":4725},{"style":1085},[4726],{"type":998,"value":2681},{"type":993,"tag":1058,"props":4728,"children":4729},{"class":1060,"line":210},[4730],{"type":993,"tag":1058,"props":4731,"children":4732},{"style":1064},[4733],{"type":998,"value":4734},"        # Vector equality\n",{"type":993,"tag":1058,"props":4736,"children":4737},{"class":1060,"line":219},[4738,4742,4746,4750,4754,4759,4764,4768,4772,4776],{"type":993,"tag":1058,"props":4739,"children":4740},{"style":1073},[4741],{"type":998,"value":1189},{"type":993,"tag":1058,"props":4743,"children":4744},{"style":1099},[4745],{"type":998,"value":1343},{"type":993,"tag":1058,"props":4747,"children":4748},{"style":1085},[4749],{"type":998,"value":4371},{"type":993,"tag":1058,"props":4751,"children":4752},{"style":1073},[4753],{"type":998,"value":2728},{"type":993,"tag":1058,"props":4755,"children":4756},{"style":1085},[4757],{"type":998,"value":4758}," other.x ",{"type":993,"tag":1058,"props":4760,"children":4761},{"style":1073},[4762],{"type":998,"value":4763},"and",{"type":993,"tag":1058,"props":4765,"children":4766},{"style":1099},[4767],{"type":998,"value":1343},{"type":993,"tag":1058,"props":4769,"children":4770},{"style":1085},[4771],{"type":998,"value":4392},{"type":993,"tag":1058,"props":4773,"children":4774},{"style":1073},[4775],{"type":998,"value":2728},{"type":993,"tag":1058,"props":4777,"children":4778},{"style":1085},[4779],{"type":998,"value":4780}," other.y\n",{"type":993,"tag":1058,"props":4782,"children":4783},{"class":1060,"line":228},[4784],{"type":993,"tag":1058,"props":4785,"children":4786},{"style":1085},[4787],{"type":998,"value":1159},{"type":993,"tag":1058,"props":4789,"children":4790},{"class":1060,"line":238},[4791,4795,4800],{"type":993,"tag":1058,"props":4792,"children":4793},{"style":1073},[4794],{"type":998,"value":1096},{"type":993,"tag":1058,"props":4796,"children":4797},{"style":1099},[4798],{"type":998,"value":4799}," __abs__",{"type":993,"tag":1058,"props":4801,"children":4802},{"style":1085},[4803],{"type":998,"value":2103},{"type":993,"tag":1058,"props":4805,"children":4806},{"class":1060,"line":247},[4807],{"type":993,"tag":1058,"props":4808,"children":4809},{"style":1064},[4810],{"type":998,"value":4811},"        # Vector magnitude\n",{"type":993,"tag":1058,"props":4813,"children":4814},{"class":1060,"line":256},[4815,4819,4823,4827,4831,4836,4841,4846,4850,4854,4858,4862,4867,4871],{"type":993,"tag":1058,"props":4816,"children":4817},{"style":1073},[4818],{"type":998,"value":1189},{"type":993,"tag":1058,"props":4820,"children":4821},{"style":1085},[4822],{"type":998,"value":1220},{"type":993,"tag":1058,"props":4824,"children":4825},{"style":1099},[4826],{"type":998,"value":1235},{"type":993,"tag":1058,"props":4828,"children":4829},{"style":1085},[4830],{"type":998,"value":4371},{"type":993,"tag":1058,"props":4832,"children":4833},{"style":1073},[4834],{"type":998,"value":4835},"**",{"type":993,"tag":1058,"props":4837,"children":4838},{"style":1099},[4839],{"type":998,"value":4840}," 2",{"type":993,"tag":1058,"props":4842,"children":4843},{"style":1073},[4844],{"type":998,"value":4845}," +",{"type":993,"tag":1058,"props":4847,"children":4848},{"style":1099},[4849],{"type":998,"value":1343},{"type":993,"tag":1058,"props":4851,"children":4852},{"style":1085},[4853],{"type":998,"value":4392},{"type":993,"tag":1058,"props":4855,"children":4856},{"style":1073},[4857],{"type":998,"value":4835},{"type":993,"tag":1058,"props":4859,"children":4860},{"style":1099},[4861],{"type":998,"value":4840},{"type":993,"tag":1058,"props":4863,"children":4864},{"style":1085},[4865],{"type":998,"value":4866},") ",{"type":993,"tag":1058,"props":4868,"children":4869},{"style":1073},[4870],{"type":998,"value":4835},{"type":993,"tag":1058,"props":4872,"children":4873},{"style":1099},[4874],{"type":998,"value":4875}," 0.5\n",{"type":993,"tag":1058,"props":4877,"children":4878},{"class":1060,"line":265},[4879],{"type":993,"tag":1058,"props":4880,"children":4881},{"emptyLinePlaceholder":13},[4882],{"type":998,"value":1447},{"type":993,"tag":1058,"props":4884,"children":4885},{"class":1060,"line":274},[4886],{"type":993,"tag":1058,"props":4887,"children":4888},{"style":1064},[4889],{"type":998,"value":4890},"# Arithmetic operations work naturally\n",{"type":993,"tag":1058,"props":4892,"children":4893},{"class":1060,"line":284},[4894,4899,4903,4907,4911,4915,4920],{"type":993,"tag":1058,"props":4895,"children":4896},{"style":1085},[4897],{"type":998,"value":4898},"v1 ",{"type":993,"tag":1058,"props":4900,"children":4901},{"style":1073},[4902],{"type":998,"value":1125},{"type":993,"tag":1058,"props":4904,"children":4905},{"style":1085},[4906],{"type":998,"value":4516},{"type":993,"tag":1058,"props":4908,"children":4909},{"style":1099},[4910],{"type":998,"value":4016},{"type":993,"tag":1058,"props":4912,"children":4913},{"style":1085},[4914],{"type":998,"value":1014},{"type":993,"tag":1058,"props":4916,"children":4917},{"style":1099},[4918],{"type":998,"value":4919},"4",{"type":993,"tag":1058,"props":4921,"children":4922},{"style":1085},[4923],{"type":998,"value":1482},{"type":993,"tag":1058,"props":4925,"children":4926},{"class":1060,"line":293},[4927,4932,4936,4940,4944,4948,4952],{"type":993,"tag":1058,"props":4928,"children":4929},{"style":1085},[4930],{"type":998,"value":4931},"v2 ",{"type":993,"tag":1058,"props":4933,"children":4934},{"style":1073},[4935],{"type":998,"value":1125},{"type":993,"tag":1058,"props":4937,"children":4938},{"style":1085},[4939],{"type":998,"value":4516},{"type":993,"tag":1058,"props":4941,"children":4942},{"style":1099},[4943],{"type":998,"value":3487},{"type":993,"tag":1058,"props":4945,"children":4946},{"style":1085},[4947],{"type":998,"value":1014},{"type":993,"tag":1058,"props":4949,"children":4950},{"style":1099},[4951],{"type":998,"value":4041},{"type":993,"tag":1058,"props":4953,"children":4954},{"style":1085},[4955],{"type":998,"value":1482},{"type":993,"tag":1058,"props":4957,"children":4958},{"class":1060,"line":302},[4959],{"type":993,"tag":1058,"props":4960,"children":4961},{"emptyLinePlaceholder":13},[4962],{"type":998,"value":1447},{"type":993,"tag":1058,"props":4964,"children":4965},{"class":1060,"line":311},[4966,4970,4974,4978,4983,4987,4992,4996,5000],{"type":993,"tag":1058,"props":4967,"children":4968},{"style":1099},[4969],{"type":998,"value":1530},{"type":993,"tag":1058,"props":4971,"children":4972},{"style":1085},[4973],{"type":998,"value":1230},{"type":993,"tag":1058,"props":4975,"children":4976},{"style":1073},[4977],{"type":998,"value":1556},{"type":993,"tag":1058,"props":4979,"children":4980},{"style":1197},[4981],{"type":998,"value":4982},"\"v1: ",{"type":993,"tag":1058,"props":4984,"children":4985},{"style":1099},[4986],{"type":998,"value":1614},{"type":993,"tag":1058,"props":4988,"children":4989},{"style":1085},[4990],{"type":998,"value":4991},"v1",{"type":993,"tag":1058,"props":4993,"children":4994},{"style":1099},[4995],{"type":998,"value":1215},{"type":993,"tag":1058,"props":4997,"children":4998},{"style":1197},[4999],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5001,"children":5002},{"style":1085},[5003],{"type":998,"value":1482},{"type":993,"tag":1058,"props":5005,"children":5006},{"class":1060,"line":320},[5007,5011,5015,5019,5024,5028,5033,5037,5041],{"type":993,"tag":1058,"props":5008,"children":5009},{"style":1099},[5010],{"type":998,"value":1530},{"type":993,"tag":1058,"props":5012,"children":5013},{"style":1085},[5014],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5016,"children":5017},{"style":1073},[5018],{"type":998,"value":1556},{"type":993,"tag":1058,"props":5020,"children":5021},{"style":1197},[5022],{"type":998,"value":5023},"\"v2: ",{"type":993,"tag":1058,"props":5025,"children":5026},{"style":1099},[5027],{"type":998,"value":1614},{"type":993,"tag":1058,"props":5029,"children":5030},{"style":1085},[5031],{"type":998,"value":5032},"v2",{"type":993,"tag":1058,"props":5034,"children":5035},{"style":1099},[5036],{"type":998,"value":1215},{"type":993,"tag":1058,"props":5038,"children":5039},{"style":1197},[5040],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5042,"children":5043},{"style":1085},[5044],{"type":998,"value":1482},{"type":993,"tag":1058,"props":5046,"children":5047},{"class":1060,"line":329},[5048,5052,5056,5060,5065,5069,5073,5077,5082,5086,5090],{"type":993,"tag":1058,"props":5049,"children":5050},{"style":1099},[5051],{"type":998,"value":1530},{"type":993,"tag":1058,"props":5053,"children":5054},{"style":1085},[5055],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5057,"children":5058},{"style":1073},[5059],{"type":998,"value":1556},{"type":993,"tag":1058,"props":5061,"children":5062},{"style":1197},[5063],{"type":998,"value":5064},"\"v1 + v2: ",{"type":993,"tag":1058,"props":5066,"children":5067},{"style":1099},[5068],{"type":998,"value":1614},{"type":993,"tag":1058,"props":5070,"children":5071},{"style":1085},[5072],{"type":998,"value":4898},{"type":993,"tag":1058,"props":5074,"children":5075},{"style":1073},[5076],{"type":998,"value":4529},{"type":993,"tag":1058,"props":5078,"children":5079},{"style":1085},[5080],{"type":998,"value":5081}," v2",{"type":993,"tag":1058,"props":5083,"children":5084},{"style":1099},[5085],{"type":998,"value":1215},{"type":993,"tag":1058,"props":5087,"children":5088},{"style":1197},[5089],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5091,"children":5092},{"style":1085},[5093],{"type":998,"value":1482},{"type":993,"tag":1058,"props":5095,"children":5096},{"class":1060,"line":338},[5097,5101,5105,5109,5114,5118,5122,5126,5130,5134,5138],{"type":993,"tag":1058,"props":5098,"children":5099},{"style":1099},[5100],{"type":998,"value":1530},{"type":993,"tag":1058,"props":5102,"children":5103},{"style":1085},[5104],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5106,"children":5107},{"style":1073},[5108],{"type":998,"value":1556},{"type":993,"tag":1058,"props":5110,"children":5111},{"style":1197},[5112],{"type":998,"value":5113},"\"v1 - v2: ",{"type":993,"tag":1058,"props":5115,"children":5116},{"style":1099},[5117],{"type":998,"value":1614},{"type":993,"tag":1058,"props":5119,"children":5120},{"style":1085},[5121],{"type":998,"value":4898},{"type":993,"tag":1058,"props":5123,"children":5124},{"style":1073},[5125],{"type":998,"value":4606},{"type":993,"tag":1058,"props":5127,"children":5128},{"style":1085},[5129],{"type":998,"value":5081},{"type":993,"tag":1058,"props":5131,"children":5132},{"style":1099},[5133],{"type":998,"value":1215},{"type":993,"tag":1058,"props":5135,"children":5136},{"style":1197},[5137],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5139,"children":5140},{"style":1085},[5141],{"type":998,"value":1482},{"type":993,"tag":1058,"props":5143,"children":5144},{"class":1060,"line":347},[5145,5149,5153,5157,5162,5166,5170,5174,5179,5183],{"type":993,"tag":1058,"props":5146,"children":5147},{"style":1099},[5148],{"type":998,"value":1530},{"type":993,"tag":1058,"props":5150,"children":5151},{"style":1085},[5152],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5154,"children":5155},{"style":1073},[5156],{"type":998,"value":1556},{"type":993,"tag":1058,"props":5158,"children":5159},{"style":1197},[5160],{"type":998,"value":5161},"\"v1 * 2: ",{"type":993,"tag":1058,"props":5163,"children":5164},{"style":1099},[5165],{"type":998,"value":1614},{"type":993,"tag":1058,"props":5167,"children":5168},{"style":1085},[5169],{"type":998,"value":4898},{"type":993,"tag":1058,"props":5171,"children":5172},{"style":1073},[5173],{"type":998,"value":4682},{"type":993,"tag":1058,"props":5175,"children":5176},{"style":1099},[5177],{"type":998,"value":5178}," 2}",{"type":993,"tag":1058,"props":5180,"children":5181},{"style":1197},[5182],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5184,"children":5185},{"style":1085},[5186],{"type":998,"value":1482},{"type":993,"tag":1058,"props":5188,"children":5189},{"class":1060,"line":356},[5190,5194,5198,5202,5207,5212,5217,5222,5226,5230],{"type":993,"tag":1058,"props":5191,"children":5192},{"style":1099},[5193],{"type":998,"value":1530},{"type":993,"tag":1058,"props":5195,"children":5196},{"style":1085},[5197],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5199,"children":5200},{"style":1073},[5201],{"type":998,"value":1556},{"type":993,"tag":1058,"props":5203,"children":5204},{"style":1197},[5205],{"type":998,"value":5206},"\"Magnitude of v1: ",{"type":993,"tag":1058,"props":5208,"children":5209},{"style":1099},[5210],{"type":998,"value":5211},"{abs",{"type":993,"tag":1058,"props":5213,"children":5214},{"style":1085},[5215],{"type":998,"value":5216},"(v1)",{"type":993,"tag":1058,"props":5218,"children":5219},{"style":1073},[5220],{"type":998,"value":5221},":.2f",{"type":993,"tag":1058,"props":5223,"children":5224},{"style":1099},[5225],{"type":998,"value":1215},{"type":993,"tag":1058,"props":5227,"children":5228},{"style":1197},[5229],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5231,"children":5232},{"style":1085},[5233],{"type":998,"value":1482},{"type":993,"tag":1058,"props":5235,"children":5236},{"class":1060,"line":365},[5237,5241,5245,5249,5254,5258,5262,5266,5270,5274,5278],{"type":993,"tag":1058,"props":5238,"children":5239},{"style":1099},[5240],{"type":998,"value":1530},{"type":993,"tag":1058,"props":5242,"children":5243},{"style":1085},[5244],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5246,"children":5247},{"style":1073},[5248],{"type":998,"value":1556},{"type":993,"tag":1058,"props":5250,"children":5251},{"style":1197},[5252],{"type":998,"value":5253},"\"v1 == v2: ",{"type":993,"tag":1058,"props":5255,"children":5256},{"style":1099},[5257],{"type":998,"value":1614},{"type":993,"tag":1058,"props":5259,"children":5260},{"style":1085},[5261],{"type":998,"value":4898},{"type":993,"tag":1058,"props":5263,"children":5264},{"style":1073},[5265],{"type":998,"value":2728},{"type":993,"tag":1058,"props":5267,"children":5268},{"style":1085},[5269],{"type":998,"value":5081},{"type":993,"tag":1058,"props":5271,"children":5272},{"style":1099},[5273],{"type":998,"value":1215},{"type":993,"tag":1058,"props":5275,"children":5276},{"style":1197},[5277],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5279,"children":5280},{"style":1085},[5281],{"type":998,"value":1482},{"type":993,"tag":1678,"props":5283,"children":5285},{"id":5284},"advanced-special-methods",[5286],{"type":998,"value":5287},"🌟 Advanced Special Methods",{"type":993,"tag":1931,"props":5289,"children":5291},{"id":5290},"context-managers",[5292],{"type":998,"value":5293},"Context Managers",{"type":993,"tag":1001,"props":5295,"children":5296},{},[5297,5299,5305,5306,5312,5314,5320],{"type":998,"value":5298},"Implement ",{"type":993,"tag":1007,"props":5300,"children":5302},{"className":5301},[],[5303],{"type":998,"value":5304},"__enter__",{"type":998,"value":1954},{"type":993,"tag":1007,"props":5307,"children":5309},{"className":5308},[],[5310],{"type":998,"value":5311},"__exit__",{"type":998,"value":5313}," to create objects that work with the ",{"type":993,"tag":1007,"props":5315,"children":5317},{"className":5316},[],[5318],{"type":998,"value":5319},"with",{"type":998,"value":5321}," statement.",{"type":993,"tag":1045,"props":5323,"children":5324},{},[5325],{"type":993,"tag":1049,"props":5326,"children":5328},{"className":1051,"code":5327,"language":6,"meta":8,"style":8},"class FileManager:\n    def __init__(self, filename, mode='r'):\n        self.filename = filename\n        self.mode = mode\n        self.file = None\n    \n    def __enter__(self):\n        print(f\"Opening file: {self.filename}\")\n        self.file = open(self.filename, self.mode)\n        return self.file\n    \n    def __exit__(self, exc_type, exc_value, traceback):\n        print(f\"Closing file: {self.filename}\")\n        if self.file:\n            self.file.close()\n        return False  # Don't suppress exceptions\n\nclass DatabaseConnection:\n    def __init__(self, database):\n        self.database = database\n        self.connected = False\n    \n    def __enter__(self):\n        print(f\"Connecting to database: {self.database}\")\n        self.connected = True\n        return self\n    \n    def __exit__(self, exc_type, exc_value, traceback):\n        print(f\"Closing database connection: {self.database}\")\n        self.connected = False\n        return False\n    \n    def query(self, sql):\n        if self.connected:\n            return f\"Executing: {sql}\"\n        return \"Not connected\"\n\n# Context managers in action\ntry:\n    with open('example.txt', 'w') as f:\n        f.write(\"Hello, World!\")\n    \n    # Custom context manager\n    with DatabaseConnection(\"myapp.db\") as db:\n        result = db.query(\"SELECT * FROM users\")\n        print(result)\nexcept FileNotFoundError:\n    print(\"File operations would work with existing files\")\n",[5329],{"type":993,"tag":1007,"props":5330,"children":5331},{"__ignoreMap":8},[5332,5348,5377,5398,5419,5440,5447,5463,5505,5547,5563,5570,5587,5627,5643,5655,5672,5679,5695,5711,5732,5752,5759,5774,5815,5835,5847,5854,5869,5909,5928,5939,5946,5963,5979,6012,6024,6031,6039,6051,6095,6112,6119,6127,6157,6183,6195,6212],{"type":993,"tag":1058,"props":5333,"children":5334},{"class":1060,"line":12},[5335,5339,5344],{"type":993,"tag":1058,"props":5336,"children":5337},{"style":1073},[5338],{"type":998,"value":1076},{"type":993,"tag":1058,"props":5340,"children":5341},{"style":1079},[5342],{"type":998,"value":5343}," FileManager",{"type":993,"tag":1058,"props":5345,"children":5346},{"style":1085},[5347],{"type":998,"value":1088},{"type":993,"tag":1058,"props":5349,"children":5350},{"class":1060,"line":27},[5351,5355,5359,5364,5368,5373],{"type":993,"tag":1058,"props":5352,"children":5353},{"style":1073},[5354],{"type":998,"value":1096},{"type":993,"tag":1058,"props":5356,"children":5357},{"style":1099},[5358],{"type":998,"value":1102},{"type":993,"tag":1058,"props":5360,"children":5361},{"style":1085},[5362],{"type":998,"value":5363},"(self, filename, mode",{"type":993,"tag":1058,"props":5365,"children":5366},{"style":1073},[5367],{"type":998,"value":1125},{"type":993,"tag":1058,"props":5369,"children":5370},{"style":1197},[5371],{"type":998,"value":5372},"'r'",{"type":993,"tag":1058,"props":5374,"children":5375},{"style":1085},[5376],{"type":998,"value":3492},{"type":993,"tag":1058,"props":5378,"children":5379},{"class":1060,"line":36},[5380,5384,5389,5393],{"type":993,"tag":1058,"props":5381,"children":5382},{"style":1099},[5383],{"type":998,"value":1115},{"type":993,"tag":1058,"props":5385,"children":5386},{"style":1085},[5387],{"type":998,"value":5388},".filename ",{"type":993,"tag":1058,"props":5390,"children":5391},{"style":1073},[5392],{"type":998,"value":1125},{"type":993,"tag":1058,"props":5394,"children":5395},{"style":1085},[5396],{"type":998,"value":5397}," filename\n",{"type":993,"tag":1058,"props":5399,"children":5400},{"class":1060,"line":45},[5401,5405,5410,5414],{"type":993,"tag":1058,"props":5402,"children":5403},{"style":1099},[5404],{"type":998,"value":1115},{"type":993,"tag":1058,"props":5406,"children":5407},{"style":1085},[5408],{"type":998,"value":5409},".mode ",{"type":993,"tag":1058,"props":5411,"children":5412},{"style":1073},[5413],{"type":998,"value":1125},{"type":993,"tag":1058,"props":5415,"children":5416},{"style":1085},[5417],{"type":998,"value":5418}," mode\n",{"type":993,"tag":1058,"props":5420,"children":5421},{"class":1060,"line":54},[5422,5426,5431,5435],{"type":993,"tag":1058,"props":5423,"children":5424},{"style":1099},[5425],{"type":998,"value":1115},{"type":993,"tag":1058,"props":5427,"children":5428},{"style":1085},[5429],{"type":998,"value":5430},".file ",{"type":993,"tag":1058,"props":5432,"children":5433},{"style":1073},[5434],{"type":998,"value":1125},{"type":993,"tag":1058,"props":5436,"children":5437},{"style":1099},[5438],{"type":998,"value":5439}," None\n",{"type":993,"tag":1058,"props":5441,"children":5442},{"class":1060,"line":63},[5443],{"type":993,"tag":1058,"props":5444,"children":5445},{"style":1085},[5446],{"type":998,"value":1159},{"type":993,"tag":1058,"props":5448,"children":5449},{"class":1060,"line":72},[5450,5454,5459],{"type":993,"tag":1058,"props":5451,"children":5452},{"style":1073},[5453],{"type":998,"value":1096},{"type":993,"tag":1058,"props":5455,"children":5456},{"style":1099},[5457],{"type":998,"value":5458}," __enter__",{"type":993,"tag":1058,"props":5460,"children":5461},{"style":1085},[5462],{"type":998,"value":2103},{"type":993,"tag":1058,"props":5464,"children":5465},{"class":1060,"line":81},[5466,5471,5475,5479,5484,5488,5493,5497,5501],{"type":993,"tag":1058,"props":5467,"children":5468},{"style":1099},[5469],{"type":998,"value":5470},"        print",{"type":993,"tag":1058,"props":5472,"children":5473},{"style":1085},[5474],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5476,"children":5477},{"style":1073},[5478],{"type":998,"value":1556},{"type":993,"tag":1058,"props":5480,"children":5481},{"style":1197},[5482],{"type":998,"value":5483},"\"Opening file: ",{"type":993,"tag":1058,"props":5485,"children":5486},{"style":1099},[5487],{"type":998,"value":1205},{"type":993,"tag":1058,"props":5489,"children":5490},{"style":1085},[5491],{"type":998,"value":5492},".filename",{"type":993,"tag":1058,"props":5494,"children":5495},{"style":1099},[5496],{"type":998,"value":1215},{"type":993,"tag":1058,"props":5498,"children":5499},{"style":1197},[5500],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5502,"children":5503},{"style":1085},[5504],{"type":998,"value":1482},{"type":993,"tag":1058,"props":5506,"children":5507},{"class":1060,"line":91},[5508,5512,5516,5520,5525,5529,5533,5538,5542],{"type":993,"tag":1058,"props":5509,"children":5510},{"style":1099},[5511],{"type":998,"value":1115},{"type":993,"tag":1058,"props":5513,"children":5514},{"style":1085},[5515],{"type":998,"value":5430},{"type":993,"tag":1058,"props":5517,"children":5518},{"style":1073},[5519],{"type":998,"value":1125},{"type":993,"tag":1058,"props":5521,"children":5522},{"style":1099},[5523],{"type":998,"value":5524}," open",{"type":993,"tag":1058,"props":5526,"children":5527},{"style":1085},[5528],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5530,"children":5531},{"style":1099},[5532],{"type":998,"value":1235},{"type":993,"tag":1058,"props":5534,"children":5535},{"style":1085},[5536],{"type":998,"value":5537},".filename, ",{"type":993,"tag":1058,"props":5539,"children":5540},{"style":1099},[5541],{"type":998,"value":1235},{"type":993,"tag":1058,"props":5543,"children":5544},{"style":1085},[5545],{"type":998,"value":5546},".mode)\n",{"type":993,"tag":1058,"props":5548,"children":5549},{"class":1060,"line":100},[5550,5554,5558],{"type":993,"tag":1058,"props":5551,"children":5552},{"style":1073},[5553],{"type":998,"value":1189},{"type":993,"tag":1058,"props":5555,"children":5556},{"style":1099},[5557],{"type":998,"value":1343},{"type":993,"tag":1058,"props":5559,"children":5560},{"style":1085},[5561],{"type":998,"value":5562},".file\n",{"type":993,"tag":1058,"props":5564,"children":5565},{"class":1060,"line":109},[5566],{"type":993,"tag":1058,"props":5567,"children":5568},{"style":1085},[5569],{"type":998,"value":1159},{"type":993,"tag":1058,"props":5571,"children":5572},{"class":1060,"line":118},[5573,5577,5582],{"type":993,"tag":1058,"props":5574,"children":5575},{"style":1073},[5576],{"type":998,"value":1096},{"type":993,"tag":1058,"props":5578,"children":5579},{"style":1099},[5580],{"type":998,"value":5581}," __exit__",{"type":993,"tag":1058,"props":5583,"children":5584},{"style":1085},[5585],{"type":998,"value":5586},"(self, exc_type, exc_value, traceback):\n",{"type":993,"tag":1058,"props":5588,"children":5589},{"class":1060,"line":127},[5590,5594,5598,5602,5607,5611,5615,5619,5623],{"type":993,"tag":1058,"props":5591,"children":5592},{"style":1099},[5593],{"type":998,"value":5470},{"type":993,"tag":1058,"props":5595,"children":5596},{"style":1085},[5597],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5599,"children":5600},{"style":1073},[5601],{"type":998,"value":1556},{"type":993,"tag":1058,"props":5603,"children":5604},{"style":1197},[5605],{"type":998,"value":5606},"\"Closing file: ",{"type":993,"tag":1058,"props":5608,"children":5609},{"style":1099},[5610],{"type":998,"value":1205},{"type":993,"tag":1058,"props":5612,"children":5613},{"style":1085},[5614],{"type":998,"value":5492},{"type":993,"tag":1058,"props":5616,"children":5617},{"style":1099},[5618],{"type":998,"value":1215},{"type":993,"tag":1058,"props":5620,"children":5621},{"style":1197},[5622],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5624,"children":5625},{"style":1085},[5626],{"type":998,"value":1482},{"type":993,"tag":1058,"props":5628,"children":5629},{"class":1060,"line":136},[5630,5634,5638],{"type":993,"tag":1058,"props":5631,"children":5632},{"style":1073},[5633],{"type":998,"value":2697},{"type":993,"tag":1058,"props":5635,"children":5636},{"style":1099},[5637],{"type":998,"value":1343},{"type":993,"tag":1058,"props":5639,"children":5640},{"style":1085},[5641],{"type":998,"value":5642},".file:\n",{"type":993,"tag":1058,"props":5644,"children":5645},{"class":1060,"line":146},[5646,5650],{"type":993,"tag":1058,"props":5647,"children":5648},{"style":1099},[5649],{"type":998,"value":3525},{"type":993,"tag":1058,"props":5651,"children":5652},{"style":1085},[5653],{"type":998,"value":5654},".file.close()\n",{"type":993,"tag":1058,"props":5656,"children":5657},{"class":1060,"line":155},[5658,5662,5667],{"type":993,"tag":1058,"props":5659,"children":5660},{"style":1073},[5661],{"type":998,"value":1189},{"type":993,"tag":1058,"props":5663,"children":5664},{"style":1099},[5665],{"type":998,"value":5666}," False",{"type":993,"tag":1058,"props":5668,"children":5669},{"style":1064},[5670],{"type":998,"value":5671},"  # Don't suppress exceptions\n",{"type":993,"tag":1058,"props":5673,"children":5674},{"class":1060,"line":164},[5675],{"type":993,"tag":1058,"props":5676,"children":5677},{"emptyLinePlaceholder":13},[5678],{"type":998,"value":1447},{"type":993,"tag":1058,"props":5680,"children":5681},{"class":1060,"line":173},[5682,5686,5691],{"type":993,"tag":1058,"props":5683,"children":5684},{"style":1073},[5685],{"type":998,"value":1076},{"type":993,"tag":1058,"props":5687,"children":5688},{"style":1079},[5689],{"type":998,"value":5690}," DatabaseConnection",{"type":993,"tag":1058,"props":5692,"children":5693},{"style":1085},[5694],{"type":998,"value":1088},{"type":993,"tag":1058,"props":5696,"children":5697},{"class":1060,"line":182},[5698,5702,5706],{"type":993,"tag":1058,"props":5699,"children":5700},{"style":1073},[5701],{"type":998,"value":1096},{"type":993,"tag":1058,"props":5703,"children":5704},{"style":1099},[5705],{"type":998,"value":1102},{"type":993,"tag":1058,"props":5707,"children":5708},{"style":1085},[5709],{"type":998,"value":5710},"(self, database):\n",{"type":993,"tag":1058,"props":5712,"children":5713},{"class":1060,"line":191},[5714,5718,5723,5727],{"type":993,"tag":1058,"props":5715,"children":5716},{"style":1099},[5717],{"type":998,"value":1115},{"type":993,"tag":1058,"props":5719,"children":5720},{"style":1085},[5721],{"type":998,"value":5722},".database ",{"type":993,"tag":1058,"props":5724,"children":5725},{"style":1073},[5726],{"type":998,"value":1125},{"type":993,"tag":1058,"props":5728,"children":5729},{"style":1085},[5730],{"type":998,"value":5731}," database\n",{"type":993,"tag":1058,"props":5733,"children":5734},{"class":1060,"line":201},[5735,5739,5744,5748],{"type":993,"tag":1058,"props":5736,"children":5737},{"style":1099},[5738],{"type":998,"value":1115},{"type":993,"tag":1058,"props":5740,"children":5741},{"style":1085},[5742],{"type":998,"value":5743},".connected ",{"type":993,"tag":1058,"props":5745,"children":5746},{"style":1073},[5747],{"type":998,"value":1125},{"type":993,"tag":1058,"props":5749,"children":5750},{"style":1099},[5751],{"type":998,"value":2745},{"type":993,"tag":1058,"props":5753,"children":5754},{"class":1060,"line":210},[5755],{"type":993,"tag":1058,"props":5756,"children":5757},{"style":1085},[5758],{"type":998,"value":1159},{"type":993,"tag":1058,"props":5760,"children":5761},{"class":1060,"line":219},[5762,5766,5770],{"type":993,"tag":1058,"props":5763,"children":5764},{"style":1073},[5765],{"type":998,"value":1096},{"type":993,"tag":1058,"props":5767,"children":5768},{"style":1099},[5769],{"type":998,"value":5458},{"type":993,"tag":1058,"props":5771,"children":5772},{"style":1085},[5773],{"type":998,"value":2103},{"type":993,"tag":1058,"props":5775,"children":5776},{"class":1060,"line":228},[5777,5781,5785,5789,5794,5798,5803,5807,5811],{"type":993,"tag":1058,"props":5778,"children":5779},{"style":1099},[5780],{"type":998,"value":5470},{"type":993,"tag":1058,"props":5782,"children":5783},{"style":1085},[5784],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5786,"children":5787},{"style":1073},[5788],{"type":998,"value":1556},{"type":993,"tag":1058,"props":5790,"children":5791},{"style":1197},[5792],{"type":998,"value":5793},"\"Connecting to database: ",{"type":993,"tag":1058,"props":5795,"children":5796},{"style":1099},[5797],{"type":998,"value":1205},{"type":993,"tag":1058,"props":5799,"children":5800},{"style":1085},[5801],{"type":998,"value":5802},".database",{"type":993,"tag":1058,"props":5804,"children":5805},{"style":1099},[5806],{"type":998,"value":1215},{"type":993,"tag":1058,"props":5808,"children":5809},{"style":1197},[5810],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5812,"children":5813},{"style":1085},[5814],{"type":998,"value":1482},{"type":993,"tag":1058,"props":5816,"children":5817},{"class":1060,"line":238},[5818,5822,5826,5830],{"type":993,"tag":1058,"props":5819,"children":5820},{"style":1099},[5821],{"type":998,"value":1115},{"type":993,"tag":1058,"props":5823,"children":5824},{"style":1085},[5825],{"type":998,"value":5743},{"type":993,"tag":1058,"props":5827,"children":5828},{"style":1073},[5829],{"type":998,"value":1125},{"type":993,"tag":1058,"props":5831,"children":5832},{"style":1099},[5833],{"type":998,"value":5834}," True\n",{"type":993,"tag":1058,"props":5836,"children":5837},{"class":1060,"line":247},[5838,5842],{"type":993,"tag":1058,"props":5839,"children":5840},{"style":1073},[5841],{"type":998,"value":1189},{"type":993,"tag":1058,"props":5843,"children":5844},{"style":1099},[5845],{"type":998,"value":5846}," self\n",{"type":993,"tag":1058,"props":5848,"children":5849},{"class":1060,"line":256},[5850],{"type":993,"tag":1058,"props":5851,"children":5852},{"style":1085},[5853],{"type":998,"value":1159},{"type":993,"tag":1058,"props":5855,"children":5856},{"class":1060,"line":265},[5857,5861,5865],{"type":993,"tag":1058,"props":5858,"children":5859},{"style":1073},[5860],{"type":998,"value":1096},{"type":993,"tag":1058,"props":5862,"children":5863},{"style":1099},[5864],{"type":998,"value":5581},{"type":993,"tag":1058,"props":5866,"children":5867},{"style":1085},[5868],{"type":998,"value":5586},{"type":993,"tag":1058,"props":5870,"children":5871},{"class":1060,"line":274},[5872,5876,5880,5884,5889,5893,5897,5901,5905],{"type":993,"tag":1058,"props":5873,"children":5874},{"style":1099},[5875],{"type":998,"value":5470},{"type":993,"tag":1058,"props":5877,"children":5878},{"style":1085},[5879],{"type":998,"value":1230},{"type":993,"tag":1058,"props":5881,"children":5882},{"style":1073},[5883],{"type":998,"value":1556},{"type":993,"tag":1058,"props":5885,"children":5886},{"style":1197},[5887],{"type":998,"value":5888},"\"Closing database connection: ",{"type":993,"tag":1058,"props":5890,"children":5891},{"style":1099},[5892],{"type":998,"value":1205},{"type":993,"tag":1058,"props":5894,"children":5895},{"style":1085},[5896],{"type":998,"value":5802},{"type":993,"tag":1058,"props":5898,"children":5899},{"style":1099},[5900],{"type":998,"value":1215},{"type":993,"tag":1058,"props":5902,"children":5903},{"style":1197},[5904],{"type":998,"value":1579},{"type":993,"tag":1058,"props":5906,"children":5907},{"style":1085},[5908],{"type":998,"value":1482},{"type":993,"tag":1058,"props":5910,"children":5911},{"class":1060,"line":284},[5912,5916,5920,5924],{"type":993,"tag":1058,"props":5913,"children":5914},{"style":1099},[5915],{"type":998,"value":1115},{"type":993,"tag":1058,"props":5917,"children":5918},{"style":1085},[5919],{"type":998,"value":5743},{"type":993,"tag":1058,"props":5921,"children":5922},{"style":1073},[5923],{"type":998,"value":1125},{"type":993,"tag":1058,"props":5925,"children":5926},{"style":1099},[5927],{"type":998,"value":2745},{"type":993,"tag":1058,"props":5929,"children":5930},{"class":1060,"line":293},[5931,5935],{"type":993,"tag":1058,"props":5932,"children":5933},{"style":1073},[5934],{"type":998,"value":1189},{"type":993,"tag":1058,"props":5936,"children":5937},{"style":1099},[5938],{"type":998,"value":2745},{"type":993,"tag":1058,"props":5940,"children":5941},{"class":1060,"line":302},[5942],{"type":993,"tag":1058,"props":5943,"children":5944},{"style":1085},[5945],{"type":998,"value":1159},{"type":993,"tag":1058,"props":5947,"children":5948},{"class":1060,"line":311},[5949,5953,5958],{"type":993,"tag":1058,"props":5950,"children":5951},{"style":1073},[5952],{"type":998,"value":1096},{"type":993,"tag":1058,"props":5954,"children":5955},{"style":1079},[5956],{"type":998,"value":5957}," query",{"type":993,"tag":1058,"props":5959,"children":5960},{"style":1085},[5961],{"type":998,"value":5962},"(self, sql):\n",{"type":993,"tag":1058,"props":5964,"children":5965},{"class":1060,"line":320},[5966,5970,5974],{"type":993,"tag":1058,"props":5967,"children":5968},{"style":1073},[5969],{"type":998,"value":2697},{"type":993,"tag":1058,"props":5971,"children":5972},{"style":1099},[5973],{"type":998,"value":1343},{"type":993,"tag":1058,"props":5975,"children":5976},{"style":1085},[5977],{"type":998,"value":5978},".connected:\n",{"type":993,"tag":1058,"props":5980,"children":5981},{"class":1060,"line":329},[5982,5986,5990,5995,5999,6004,6008],{"type":993,"tag":1058,"props":5983,"children":5984},{"style":1073},[5985],{"type":998,"value":2715},{"type":993,"tag":1058,"props":5987,"children":5988},{"style":1073},[5989],{"type":998,"value":1194},{"type":993,"tag":1058,"props":5991,"children":5992},{"style":1197},[5993],{"type":998,"value":5994},"\"Executing: ",{"type":993,"tag":1058,"props":5996,"children":5997},{"style":1099},[5998],{"type":998,"value":1614},{"type":993,"tag":1058,"props":6000,"children":6001},{"style":1085},[6002],{"type":998,"value":6003},"sql",{"type":993,"tag":1058,"props":6005,"children":6006},{"style":1099},[6007],{"type":998,"value":1215},{"type":993,"tag":1058,"props":6009,"children":6010},{"style":1197},[6011],{"type":998,"value":2161},{"type":993,"tag":1058,"props":6013,"children":6014},{"class":1060,"line":338},[6015,6019],{"type":993,"tag":1058,"props":6016,"children":6017},{"style":1073},[6018],{"type":998,"value":1189},{"type":993,"tag":1058,"props":6020,"children":6021},{"style":1197},[6022],{"type":998,"value":6023}," \"Not connected\"\n",{"type":993,"tag":1058,"props":6025,"children":6026},{"class":1060,"line":347},[6027],{"type":993,"tag":1058,"props":6028,"children":6029},{"emptyLinePlaceholder":13},[6030],{"type":998,"value":1447},{"type":993,"tag":1058,"props":6032,"children":6033},{"class":1060,"line":356},[6034],{"type":993,"tag":1058,"props":6035,"children":6036},{"style":1064},[6037],{"type":998,"value":6038},"# Context managers in action\n",{"type":993,"tag":1058,"props":6040,"children":6041},{"class":1060,"line":365},[6042,6047],{"type":993,"tag":1058,"props":6043,"children":6044},{"style":1073},[6045],{"type":998,"value":6046},"try",{"type":993,"tag":1058,"props":6048,"children":6049},{"style":1085},[6050],{"type":998,"value":1088},{"type":993,"tag":1058,"props":6052,"children":6053},{"class":1060,"line":374},[6054,6059,6063,6067,6072,6076,6081,6085,6090],{"type":993,"tag":1058,"props":6055,"children":6056},{"style":1073},[6057],{"type":998,"value":6058},"    with",{"type":993,"tag":1058,"props":6060,"children":6061},{"style":1099},[6062],{"type":998,"value":5524},{"type":993,"tag":1058,"props":6064,"children":6065},{"style":1085},[6066],{"type":998,"value":1230},{"type":993,"tag":1058,"props":6068,"children":6069},{"style":1197},[6070],{"type":998,"value":6071},"'example.txt'",{"type":993,"tag":1058,"props":6073,"children":6074},{"style":1085},[6075],{"type":998,"value":1014},{"type":993,"tag":1058,"props":6077,"children":6078},{"style":1197},[6079],{"type":998,"value":6080},"'w'",{"type":993,"tag":1058,"props":6082,"children":6083},{"style":1085},[6084],{"type":998,"value":4866},{"type":993,"tag":1058,"props":6086,"children":6087},{"style":1073},[6088],{"type":998,"value":6089},"as",{"type":993,"tag":1058,"props":6091,"children":6092},{"style":1085},[6093],{"type":998,"value":6094}," f:\n",{"type":993,"tag":1058,"props":6096,"children":6097},{"class":1060,"line":384},[6098,6103,6108],{"type":993,"tag":1058,"props":6099,"children":6100},{"style":1085},[6101],{"type":998,"value":6102},"        f.write(",{"type":993,"tag":1058,"props":6104,"children":6105},{"style":1197},[6106],{"type":998,"value":6107},"\"Hello, World!\"",{"type":993,"tag":1058,"props":6109,"children":6110},{"style":1085},[6111],{"type":998,"value":1482},{"type":993,"tag":1058,"props":6113,"children":6114},{"class":1060,"line":393},[6115],{"type":993,"tag":1058,"props":6116,"children":6117},{"style":1085},[6118],{"type":998,"value":1159},{"type":993,"tag":1058,"props":6120,"children":6121},{"class":1060,"line":402},[6122],{"type":993,"tag":1058,"props":6123,"children":6124},{"style":1064},[6125],{"type":998,"value":6126},"    # Custom context manager\n",{"type":993,"tag":1058,"props":6128,"children":6129},{"class":1060,"line":411},[6130,6134,6139,6144,6148,6152],{"type":993,"tag":1058,"props":6131,"children":6132},{"style":1073},[6133],{"type":998,"value":6058},{"type":993,"tag":1058,"props":6135,"children":6136},{"style":1085},[6137],{"type":998,"value":6138}," DatabaseConnection(",{"type":993,"tag":1058,"props":6140,"children":6141},{"style":1197},[6142],{"type":998,"value":6143},"\"myapp.db\"",{"type":993,"tag":1058,"props":6145,"children":6146},{"style":1085},[6147],{"type":998,"value":4866},{"type":993,"tag":1058,"props":6149,"children":6150},{"style":1073},[6151],{"type":998,"value":6089},{"type":993,"tag":1058,"props":6153,"children":6154},{"style":1085},[6155],{"type":998,"value":6156}," db:\n",{"type":993,"tag":1058,"props":6158,"children":6159},{"class":1060,"line":420},[6160,6165,6169,6174,6179],{"type":993,"tag":1058,"props":6161,"children":6162},{"style":1085},[6163],{"type":998,"value":6164},"        result ",{"type":993,"tag":1058,"props":6166,"children":6167},{"style":1073},[6168],{"type":998,"value":1125},{"type":993,"tag":1058,"props":6170,"children":6171},{"style":1085},[6172],{"type":998,"value":6173}," db.query(",{"type":993,"tag":1058,"props":6175,"children":6176},{"style":1197},[6177],{"type":998,"value":6178},"\"SELECT * FROM users\"",{"type":993,"tag":1058,"props":6180,"children":6181},{"style":1085},[6182],{"type":998,"value":1482},{"type":993,"tag":1058,"props":6184,"children":6185},{"class":1060,"line":429},[6186,6190],{"type":993,"tag":1058,"props":6187,"children":6188},{"style":1099},[6189],{"type":998,"value":5470},{"type":993,"tag":1058,"props":6191,"children":6192},{"style":1085},[6193],{"type":998,"value":6194},"(result)\n",{"type":993,"tag":1058,"props":6196,"children":6197},{"class":1060,"line":438},[6198,6203,6208],{"type":993,"tag":1058,"props":6199,"children":6200},{"style":1073},[6201],{"type":998,"value":6202},"except",{"type":993,"tag":1058,"props":6204,"children":6205},{"style":1099},[6206],{"type":998,"value":6207}," FileNotFoundError",{"type":993,"tag":1058,"props":6209,"children":6210},{"style":1085},[6211],{"type":998,"value":1088},{"type":993,"tag":1058,"props":6213,"children":6214},{"class":1060,"line":447},[6215,6219,6223,6228],{"type":993,"tag":1058,"props":6216,"children":6217},{"style":1099},[6218],{"type":998,"value":3316},{"type":993,"tag":1058,"props":6220,"children":6221},{"style":1085},[6222],{"type":998,"value":1230},{"type":993,"tag":1058,"props":6224,"children":6225},{"style":1197},[6226],{"type":998,"value":6227},"\"File operations would work with existing files\"",{"type":993,"tag":1058,"props":6229,"children":6230},{"style":1085},[6231],{"type":998,"value":1482},{"type":993,"tag":1931,"props":6233,"children":6235},{"id":6234},"call-method",[6236],{"type":998,"value":6237},"Call Method",{"type":993,"tag":1001,"props":6239,"children":6240},{},[6241,6243,6249],{"type":998,"value":6242},"The ",{"type":993,"tag":1007,"props":6244,"children":6246},{"className":6245},[],[6247],{"type":998,"value":6248},"__call__",{"type":998,"value":6250}," method makes objects callable like functions.",{"type":993,"tag":1045,"props":6252,"children":6253},{},[6254],{"type":993,"tag":1049,"props":6255,"children":6257},{"className":1051,"code":6256,"language":6,"meta":8,"style":8},"class Multiplier:\n    def __init__(self, factor):\n        self.factor = factor\n    \n    def __call__(self, value):\n        return value * self.factor\n    \n    def __str__(self):\n        return f\"Multiplier(×{self.factor})\"\n\nclass Counter:\n    def __init__(self):\n        self.count = 0\n    \n    def __call__(self):\n        self.count += 1\n        return self.count\n    \n    def __str__(self):\n        return f\"Counter: {self.count}\"\n\n# Callable objects\ndouble = Multiplier(2)\ntriple = Multiplier(3)\n\nprint(f\"Double 5: {double(5)}\")  # Uses __call__\nprint(f\"Triple 4: {triple(4)}\")  # Uses __call__\n\n# Function-like counter\ncounter = Counter()\nprint(f\"Count 1: {counter()}\")  # Uses __call__\nprint(f\"Count 2: {counter()}\")  # Uses __call__\nprint(f\"Count 3: {counter()}\")  # Uses __call__\nprint(counter)  # Current state\n",[6258],{"type":993,"tag":1007,"props":6259,"children":6260},{"__ignoreMap":8},[6261,6277,6293,6314,6321,6338,6363,6370,6385,6418,6425,6441,6456,6477,6484,6499,6519,6535,6542,6557,6590,6597,6605,6630,6654,6661,6716,6769,6776,6784,6801,6846,6890,6934],{"type":993,"tag":1058,"props":6262,"children":6263},{"class":1060,"line":12},[6264,6268,6273],{"type":993,"tag":1058,"props":6265,"children":6266},{"style":1073},[6267],{"type":998,"value":1076},{"type":993,"tag":1058,"props":6269,"children":6270},{"style":1079},[6271],{"type":998,"value":6272}," Multiplier",{"type":993,"tag":1058,"props":6274,"children":6275},{"style":1085},[6276],{"type":998,"value":1088},{"type":993,"tag":1058,"props":6278,"children":6279},{"class":1060,"line":27},[6280,6284,6288],{"type":993,"tag":1058,"props":6281,"children":6282},{"style":1073},[6283],{"type":998,"value":1096},{"type":993,"tag":1058,"props":6285,"children":6286},{"style":1099},[6287],{"type":998,"value":1102},{"type":993,"tag":1058,"props":6289,"children":6290},{"style":1085},[6291],{"type":998,"value":6292},"(self, factor):\n",{"type":993,"tag":1058,"props":6294,"children":6295},{"class":1060,"line":36},[6296,6300,6305,6309],{"type":993,"tag":1058,"props":6297,"children":6298},{"style":1099},[6299],{"type":998,"value":1115},{"type":993,"tag":1058,"props":6301,"children":6302},{"style":1085},[6303],{"type":998,"value":6304},".factor ",{"type":993,"tag":1058,"props":6306,"children":6307},{"style":1073},[6308],{"type":998,"value":1125},{"type":993,"tag":1058,"props":6310,"children":6311},{"style":1085},[6312],{"type":998,"value":6313}," factor\n",{"type":993,"tag":1058,"props":6315,"children":6316},{"class":1060,"line":45},[6317],{"type":993,"tag":1058,"props":6318,"children":6319},{"style":1085},[6320],{"type":998,"value":1159},{"type":993,"tag":1058,"props":6322,"children":6323},{"class":1060,"line":54},[6324,6328,6333],{"type":993,"tag":1058,"props":6325,"children":6326},{"style":1073},[6327],{"type":998,"value":1096},{"type":993,"tag":1058,"props":6329,"children":6330},{"style":1099},[6331],{"type":998,"value":6332}," __call__",{"type":993,"tag":1058,"props":6334,"children":6335},{"style":1085},[6336],{"type":998,"value":6337},"(self, value):\n",{"type":993,"tag":1058,"props":6339,"children":6340},{"class":1060,"line":63},[6341,6345,6350,6354,6358],{"type":993,"tag":1058,"props":6342,"children":6343},{"style":1073},[6344],{"type":998,"value":1189},{"type":993,"tag":1058,"props":6346,"children":6347},{"style":1085},[6348],{"type":998,"value":6349}," value ",{"type":993,"tag":1058,"props":6351,"children":6352},{"style":1073},[6353],{"type":998,"value":4682},{"type":993,"tag":1058,"props":6355,"children":6356},{"style":1099},[6357],{"type":998,"value":1343},{"type":993,"tag":1058,"props":6359,"children":6360},{"style":1085},[6361],{"type":998,"value":6362},".factor\n",{"type":993,"tag":1058,"props":6364,"children":6365},{"class":1060,"line":72},[6366],{"type":993,"tag":1058,"props":6367,"children":6368},{"style":1085},[6369],{"type":998,"value":1159},{"type":993,"tag":1058,"props":6371,"children":6372},{"class":1060,"line":81},[6373,6377,6381],{"type":993,"tag":1058,"props":6374,"children":6375},{"style":1073},[6376],{"type":998,"value":1096},{"type":993,"tag":1058,"props":6378,"children":6379},{"style":1099},[6380],{"type":998,"value":1171},{"type":993,"tag":1058,"props":6382,"children":6383},{"style":1085},[6384],{"type":998,"value":2103},{"type":993,"tag":1058,"props":6386,"children":6387},{"class":1060,"line":91},[6388,6392,6396,6401,6405,6410,6414],{"type":993,"tag":1058,"props":6389,"children":6390},{"style":1073},[6391],{"type":998,"value":1189},{"type":993,"tag":1058,"props":6393,"children":6394},{"style":1073},[6395],{"type":998,"value":1194},{"type":993,"tag":1058,"props":6397,"children":6398},{"style":1197},[6399],{"type":998,"value":6400},"\"Multiplier(×",{"type":993,"tag":1058,"props":6402,"children":6403},{"style":1099},[6404],{"type":998,"value":1205},{"type":993,"tag":1058,"props":6406,"children":6407},{"style":1085},[6408],{"type":998,"value":6409},".factor",{"type":993,"tag":1058,"props":6411,"children":6412},{"style":1099},[6413],{"type":998,"value":1215},{"type":993,"tag":1058,"props":6415,"children":6416},{"style":1197},[6417],{"type":998,"value":2657},{"type":993,"tag":1058,"props":6419,"children":6420},{"class":1060,"line":100},[6421],{"type":993,"tag":1058,"props":6422,"children":6423},{"emptyLinePlaceholder":13},[6424],{"type":998,"value":1447},{"type":993,"tag":1058,"props":6426,"children":6427},{"class":1060,"line":109},[6428,6432,6437],{"type":993,"tag":1058,"props":6429,"children":6430},{"style":1073},[6431],{"type":998,"value":1076},{"type":993,"tag":1058,"props":6433,"children":6434},{"style":1079},[6435],{"type":998,"value":6436}," Counter",{"type":993,"tag":1058,"props":6438,"children":6439},{"style":1085},[6440],{"type":998,"value":1088},{"type":993,"tag":1058,"props":6442,"children":6443},{"class":1060,"line":118},[6444,6448,6452],{"type":993,"tag":1058,"props":6445,"children":6446},{"style":1073},[6447],{"type":998,"value":1096},{"type":993,"tag":1058,"props":6449,"children":6450},{"style":1099},[6451],{"type":998,"value":1102},{"type":993,"tag":1058,"props":6453,"children":6454},{"style":1085},[6455],{"type":998,"value":2103},{"type":993,"tag":1058,"props":6457,"children":6458},{"class":1060,"line":127},[6459,6463,6468,6472],{"type":993,"tag":1058,"props":6460,"children":6461},{"style":1099},[6462],{"type":998,"value":1115},{"type":993,"tag":1058,"props":6464,"children":6465},{"style":1085},[6466],{"type":998,"value":6467},".count ",{"type":993,"tag":1058,"props":6469,"children":6470},{"style":1073},[6471],{"type":998,"value":1125},{"type":993,"tag":1058,"props":6473,"children":6474},{"style":1099},[6475],{"type":998,"value":6476}," 0\n",{"type":993,"tag":1058,"props":6478,"children":6479},{"class":1060,"line":136},[6480],{"type":993,"tag":1058,"props":6481,"children":6482},{"style":1085},[6483],{"type":998,"value":1159},{"type":993,"tag":1058,"props":6485,"children":6486},{"class":1060,"line":146},[6487,6491,6495],{"type":993,"tag":1058,"props":6488,"children":6489},{"style":1073},[6490],{"type":998,"value":1096},{"type":993,"tag":1058,"props":6492,"children":6493},{"style":1099},[6494],{"type":998,"value":6332},{"type":993,"tag":1058,"props":6496,"children":6497},{"style":1085},[6498],{"type":998,"value":2103},{"type":993,"tag":1058,"props":6500,"children":6501},{"class":1060,"line":155},[6502,6506,6510,6514],{"type":993,"tag":1058,"props":6503,"children":6504},{"style":1099},[6505],{"type":998,"value":1115},{"type":993,"tag":1058,"props":6507,"children":6508},{"style":1085},[6509],{"type":998,"value":6467},{"type":993,"tag":1058,"props":6511,"children":6512},{"style":1073},[6513],{"type":998,"value":3535},{"type":993,"tag":1058,"props":6515,"children":6516},{"style":1099},[6517],{"type":998,"value":6518}," 1\n",{"type":993,"tag":1058,"props":6520,"children":6521},{"class":1060,"line":164},[6522,6526,6530],{"type":993,"tag":1058,"props":6523,"children":6524},{"style":1073},[6525],{"type":998,"value":1189},{"type":993,"tag":1058,"props":6527,"children":6528},{"style":1099},[6529],{"type":998,"value":1343},{"type":993,"tag":1058,"props":6531,"children":6532},{"style":1085},[6533],{"type":998,"value":6534},".count\n",{"type":993,"tag":1058,"props":6536,"children":6537},{"class":1060,"line":173},[6538],{"type":993,"tag":1058,"props":6539,"children":6540},{"style":1085},[6541],{"type":998,"value":1159},{"type":993,"tag":1058,"props":6543,"children":6544},{"class":1060,"line":182},[6545,6549,6553],{"type":993,"tag":1058,"props":6546,"children":6547},{"style":1073},[6548],{"type":998,"value":1096},{"type":993,"tag":1058,"props":6550,"children":6551},{"style":1099},[6552],{"type":998,"value":1171},{"type":993,"tag":1058,"props":6554,"children":6555},{"style":1085},[6556],{"type":998,"value":2103},{"type":993,"tag":1058,"props":6558,"children":6559},{"class":1060,"line":191},[6560,6564,6568,6573,6577,6582,6586],{"type":993,"tag":1058,"props":6561,"children":6562},{"style":1073},[6563],{"type":998,"value":1189},{"type":993,"tag":1058,"props":6565,"children":6566},{"style":1073},[6567],{"type":998,"value":1194},{"type":993,"tag":1058,"props":6569,"children":6570},{"style":1197},[6571],{"type":998,"value":6572},"\"Counter: ",{"type":993,"tag":1058,"props":6574,"children":6575},{"style":1099},[6576],{"type":998,"value":1205},{"type":993,"tag":1058,"props":6578,"children":6579},{"style":1085},[6580],{"type":998,"value":6581},".count",{"type":993,"tag":1058,"props":6583,"children":6584},{"style":1099},[6585],{"type":998,"value":1215},{"type":993,"tag":1058,"props":6587,"children":6588},{"style":1197},[6589],{"type":998,"value":2161},{"type":993,"tag":1058,"props":6591,"children":6592},{"class":1060,"line":201},[6593],{"type":993,"tag":1058,"props":6594,"children":6595},{"emptyLinePlaceholder":13},[6596],{"type":998,"value":1447},{"type":993,"tag":1058,"props":6598,"children":6599},{"class":1060,"line":210},[6600],{"type":993,"tag":1058,"props":6601,"children":6602},{"style":1064},[6603],{"type":998,"value":6604},"# Callable objects\n",{"type":993,"tag":1058,"props":6606,"children":6607},{"class":1060,"line":219},[6608,6613,6617,6622,6626],{"type":993,"tag":1058,"props":6609,"children":6610},{"style":1085},[6611],{"type":998,"value":6612},"double ",{"type":993,"tag":1058,"props":6614,"children":6615},{"style":1073},[6616],{"type":998,"value":1125},{"type":993,"tag":1058,"props":6618,"children":6619},{"style":1085},[6620],{"type":998,"value":6621}," Multiplier(",{"type":993,"tag":1058,"props":6623,"children":6624},{"style":1099},[6625],{"type":998,"value":4041},{"type":993,"tag":1058,"props":6627,"children":6628},{"style":1085},[6629],{"type":998,"value":1482},{"type":993,"tag":1058,"props":6631,"children":6632},{"class":1060,"line":228},[6633,6638,6642,6646,6650],{"type":993,"tag":1058,"props":6634,"children":6635},{"style":1085},[6636],{"type":998,"value":6637},"triple ",{"type":993,"tag":1058,"props":6639,"children":6640},{"style":1073},[6641],{"type":998,"value":1125},{"type":993,"tag":1058,"props":6643,"children":6644},{"style":1085},[6645],{"type":998,"value":6621},{"type":993,"tag":1058,"props":6647,"children":6648},{"style":1099},[6649],{"type":998,"value":4016},{"type":993,"tag":1058,"props":6651,"children":6652},{"style":1085},[6653],{"type":998,"value":1482},{"type":993,"tag":1058,"props":6655,"children":6656},{"class":1060,"line":238},[6657],{"type":993,"tag":1058,"props":6658,"children":6659},{"emptyLinePlaceholder":13},[6660],{"type":998,"value":1447},{"type":993,"tag":1058,"props":6662,"children":6663},{"class":1060,"line":247},[6664,6668,6672,6676,6681,6685,6690,6695,6699,6703,6707,6711],{"type":993,"tag":1058,"props":6665,"children":6666},{"style":1099},[6667],{"type":998,"value":1530},{"type":993,"tag":1058,"props":6669,"children":6670},{"style":1085},[6671],{"type":998,"value":1230},{"type":993,"tag":1058,"props":6673,"children":6674},{"style":1073},[6675],{"type":998,"value":1556},{"type":993,"tag":1058,"props":6677,"children":6678},{"style":1197},[6679],{"type":998,"value":6680},"\"Double 5: ",{"type":993,"tag":1058,"props":6682,"children":6683},{"style":1099},[6684],{"type":998,"value":1614},{"type":993,"tag":1058,"props":6686,"children":6687},{"style":1085},[6688],{"type":998,"value":6689},"double(",{"type":993,"tag":1058,"props":6691,"children":6692},{"style":1099},[6693],{"type":998,"value":6694},"5",{"type":993,"tag":1058,"props":6696,"children":6697},{"style":1085},[6698],{"type":998,"value":3953},{"type":993,"tag":1058,"props":6700,"children":6701},{"style":1099},[6702],{"type":998,"value":1215},{"type":993,"tag":1058,"props":6704,"children":6705},{"style":1197},[6706],{"type":998,"value":1579},{"type":993,"tag":1058,"props":6708,"children":6709},{"style":1085},[6710],{"type":998,"value":1584},{"type":993,"tag":1058,"props":6712,"children":6713},{"style":1064},[6714],{"type":998,"value":6715},"# Uses __call__\n",{"type":993,"tag":1058,"props":6717,"children":6718},{"class":1060,"line":256},[6719,6723,6727,6731,6736,6740,6745,6749,6753,6757,6761,6765],{"type":993,"tag":1058,"props":6720,"children":6721},{"style":1099},[6722],{"type":998,"value":1530},{"type":993,"tag":1058,"props":6724,"children":6725},{"style":1085},[6726],{"type":998,"value":1230},{"type":993,"tag":1058,"props":6728,"children":6729},{"style":1073},[6730],{"type":998,"value":1556},{"type":993,"tag":1058,"props":6732,"children":6733},{"style":1197},[6734],{"type":998,"value":6735},"\"Triple 4: ",{"type":993,"tag":1058,"props":6737,"children":6738},{"style":1099},[6739],{"type":998,"value":1614},{"type":993,"tag":1058,"props":6741,"children":6742},{"style":1085},[6743],{"type":998,"value":6744},"triple(",{"type":993,"tag":1058,"props":6746,"children":6747},{"style":1099},[6748],{"type":998,"value":4919},{"type":993,"tag":1058,"props":6750,"children":6751},{"style":1085},[6752],{"type":998,"value":3953},{"type":993,"tag":1058,"props":6754,"children":6755},{"style":1099},[6756],{"type":998,"value":1215},{"type":993,"tag":1058,"props":6758,"children":6759},{"style":1197},[6760],{"type":998,"value":1579},{"type":993,"tag":1058,"props":6762,"children":6763},{"style":1085},[6764],{"type":998,"value":1584},{"type":993,"tag":1058,"props":6766,"children":6767},{"style":1064},[6768],{"type":998,"value":6715},{"type":993,"tag":1058,"props":6770,"children":6771},{"class":1060,"line":265},[6772],{"type":993,"tag":1058,"props":6773,"children":6774},{"emptyLinePlaceholder":13},[6775],{"type":998,"value":1447},{"type":993,"tag":1058,"props":6777,"children":6778},{"class":1060,"line":274},[6779],{"type":993,"tag":1058,"props":6780,"children":6781},{"style":1064},[6782],{"type":998,"value":6783},"# Function-like counter\n",{"type":993,"tag":1058,"props":6785,"children":6786},{"class":1060,"line":284},[6787,6792,6796],{"type":993,"tag":1058,"props":6788,"children":6789},{"style":1085},[6790],{"type":998,"value":6791},"counter ",{"type":993,"tag":1058,"props":6793,"children":6794},{"style":1073},[6795],{"type":998,"value":1125},{"type":993,"tag":1058,"props":6797,"children":6798},{"style":1085},[6799],{"type":998,"value":6800}," Counter()\n",{"type":993,"tag":1058,"props":6802,"children":6803},{"class":1060,"line":293},[6804,6808,6812,6816,6821,6825,6830,6834,6838,6842],{"type":993,"tag":1058,"props":6805,"children":6806},{"style":1099},[6807],{"type":998,"value":1530},{"type":993,"tag":1058,"props":6809,"children":6810},{"style":1085},[6811],{"type":998,"value":1230},{"type":993,"tag":1058,"props":6813,"children":6814},{"style":1073},[6815],{"type":998,"value":1556},{"type":993,"tag":1058,"props":6817,"children":6818},{"style":1197},[6819],{"type":998,"value":6820},"\"Count 1: ",{"type":993,"tag":1058,"props":6822,"children":6823},{"style":1099},[6824],{"type":998,"value":1614},{"type":993,"tag":1058,"props":6826,"children":6827},{"style":1085},[6828],{"type":998,"value":6829},"counter()",{"type":993,"tag":1058,"props":6831,"children":6832},{"style":1099},[6833],{"type":998,"value":1215},{"type":993,"tag":1058,"props":6835,"children":6836},{"style":1197},[6837],{"type":998,"value":1579},{"type":993,"tag":1058,"props":6839,"children":6840},{"style":1085},[6841],{"type":998,"value":1584},{"type":993,"tag":1058,"props":6843,"children":6844},{"style":1064},[6845],{"type":998,"value":6715},{"type":993,"tag":1058,"props":6847,"children":6848},{"class":1060,"line":302},[6849,6853,6857,6861,6866,6870,6874,6878,6882,6886],{"type":993,"tag":1058,"props":6850,"children":6851},{"style":1099},[6852],{"type":998,"value":1530},{"type":993,"tag":1058,"props":6854,"children":6855},{"style":1085},[6856],{"type":998,"value":1230},{"type":993,"tag":1058,"props":6858,"children":6859},{"style":1073},[6860],{"type":998,"value":1556},{"type":993,"tag":1058,"props":6862,"children":6863},{"style":1197},[6864],{"type":998,"value":6865},"\"Count 2: ",{"type":993,"tag":1058,"props":6867,"children":6868},{"style":1099},[6869],{"type":998,"value":1614},{"type":993,"tag":1058,"props":6871,"children":6872},{"style":1085},[6873],{"type":998,"value":6829},{"type":993,"tag":1058,"props":6875,"children":6876},{"style":1099},[6877],{"type":998,"value":1215},{"type":993,"tag":1058,"props":6879,"children":6880},{"style":1197},[6881],{"type":998,"value":1579},{"type":993,"tag":1058,"props":6883,"children":6884},{"style":1085},[6885],{"type":998,"value":1584},{"type":993,"tag":1058,"props":6887,"children":6888},{"style":1064},[6889],{"type":998,"value":6715},{"type":993,"tag":1058,"props":6891,"children":6892},{"class":1060,"line":311},[6893,6897,6901,6905,6910,6914,6918,6922,6926,6930],{"type":993,"tag":1058,"props":6894,"children":6895},{"style":1099},[6896],{"type":998,"value":1530},{"type":993,"tag":1058,"props":6898,"children":6899},{"style":1085},[6900],{"type":998,"value":1230},{"type":993,"tag":1058,"props":6902,"children":6903},{"style":1073},[6904],{"type":998,"value":1556},{"type":993,"tag":1058,"props":6906,"children":6907},{"style":1197},[6908],{"type":998,"value":6909},"\"Count 3: ",{"type":993,"tag":1058,"props":6911,"children":6912},{"style":1099},[6913],{"type":998,"value":1614},{"type":993,"tag":1058,"props":6915,"children":6916},{"style":1085},[6917],{"type":998,"value":6829},{"type":993,"tag":1058,"props":6919,"children":6920},{"style":1099},[6921],{"type":998,"value":1215},{"type":993,"tag":1058,"props":6923,"children":6924},{"style":1197},[6925],{"type":998,"value":1579},{"type":993,"tag":1058,"props":6927,"children":6928},{"style":1085},[6929],{"type":998,"value":1584},{"type":993,"tag":1058,"props":6931,"children":6932},{"style":1064},[6933],{"type":998,"value":6715},{"type":993,"tag":1058,"props":6935,"children":6936},{"class":1060,"line":320},[6937,6941,6946],{"type":993,"tag":1058,"props":6938,"children":6939},{"style":1099},[6940],{"type":998,"value":1530},{"type":993,"tag":1058,"props":6942,"children":6943},{"style":1085},[6944],{"type":998,"value":6945},"(counter)  ",{"type":993,"tag":1058,"props":6947,"children":6948},{"style":1064},[6949],{"type":998,"value":6950},"# Current state\n",{"type":993,"tag":1678,"props":6952,"children":6954},{"id":6953},"essential-special-methods-reference",[6955],{"type":998,"value":6956},"💡 Essential Special Methods Reference",{"type":993,"tag":1001,"props":6958,"children":6959},{},[6960],{"type":998,"value":6961},"Common special methods and their use cases for building professional Python classes.",{"type":993,"tag":6963,"props":6964,"children":6965},"table",{},[6966,6990],{"type":993,"tag":6967,"props":6968,"children":6969},"thead",{},[6970],{"type":993,"tag":6971,"props":6972,"children":6973},"tr",{},[6974,6980,6985],{"type":993,"tag":6975,"props":6976,"children":6977},"th",{},[6978],{"type":998,"value":6979},"Method",{"type":993,"tag":6975,"props":6981,"children":6982},{},[6983],{"type":998,"value":6984},"Purpose",{"type":993,"tag":6975,"props":6986,"children":6987},{},[6988],{"type":998,"value":6989},"Example Usage",{"type":993,"tag":6991,"props":6992,"children":6993},"tbody",{},[6994,7028,7056,7082,7108,7134,7160,7186,7212,7238,7264,7290,7316],{"type":993,"tag":6971,"props":6995,"children":6996},{},[6997,7007,7012],{"type":993,"tag":6998,"props":6999,"children":7000},"td",{},[7001],{"type":993,"tag":1007,"props":7002,"children":7004},{"className":7003},[],[7005],{"type":998,"value":7006},"__str__(self)",{"type":993,"tag":6998,"props":7008,"children":7009},{},[7010],{"type":998,"value":7011},"User-friendly string representation",{"type":993,"tag":6998,"props":7013,"children":7014},{},[7015,7021,7022],{"type":993,"tag":1007,"props":7016,"children":7018},{"className":7017},[],[7019],{"type":998,"value":7020},"print(obj)",{"type":998,"value":1014},{"type":993,"tag":1007,"props":7023,"children":7025},{"className":7024},[],[7026],{"type":998,"value":7027},"str(obj)",{"type":993,"tag":6971,"props":7029,"children":7030},{},[7031,7040,7045],{"type":993,"tag":6998,"props":7032,"children":7033},{},[7034],{"type":993,"tag":1007,"props":7035,"children":7037},{"className":7036},[],[7038],{"type":998,"value":7039},"__repr__(self)",{"type":993,"tag":6998,"props":7041,"children":7042},{},[7043],{"type":998,"value":7044},"Developer string representation",{"type":993,"tag":6998,"props":7046,"children":7047},{},[7048,7054],{"type":993,"tag":1007,"props":7049,"children":7051},{"className":7050},[],[7052],{"type":998,"value":7053},"repr(obj)",{"type":998,"value":7055},", debugging",{"type":993,"tag":6971,"props":7057,"children":7058},{},[7059,7068,7073],{"type":993,"tag":6998,"props":7060,"children":7061},{},[7062],{"type":993,"tag":1007,"props":7063,"children":7065},{"className":7064},[],[7066],{"type":998,"value":7067},"__len__(self)",{"type":993,"tag":6998,"props":7069,"children":7070},{},[7071],{"type":998,"value":7072},"Object length",{"type":993,"tag":6998,"props":7074,"children":7075},{},[7076],{"type":993,"tag":1007,"props":7077,"children":7079},{"className":7078},[],[7080],{"type":998,"value":7081},"len(obj)",{"type":993,"tag":6971,"props":7083,"children":7084},{},[7085,7094,7099],{"type":993,"tag":6998,"props":7086,"children":7087},{},[7088],{"type":993,"tag":1007,"props":7089,"children":7091},{"className":7090},[],[7092],{"type":998,"value":7093},"__getitem__(self, key)",{"type":993,"tag":6998,"props":7095,"children":7096},{},[7097],{"type":998,"value":7098},"Index access",{"type":993,"tag":6998,"props":7100,"children":7101},{},[7102],{"type":993,"tag":1007,"props":7103,"children":7105},{"className":7104},[],[7106],{"type":998,"value":7107},"obj[key]",{"type":993,"tag":6971,"props":7109,"children":7110},{},[7111,7120,7125],{"type":993,"tag":6998,"props":7112,"children":7113},{},[7114],{"type":993,"tag":1007,"props":7115,"children":7117},{"className":7116},[],[7118],{"type":998,"value":7119},"__setitem__(self, key, value)",{"type":993,"tag":6998,"props":7121,"children":7122},{},[7123],{"type":998,"value":7124},"Index assignment",{"type":993,"tag":6998,"props":7126,"children":7127},{},[7128],{"type":993,"tag":1007,"props":7129,"children":7131},{"className":7130},[],[7132],{"type":998,"value":7133},"obj[key] = value",{"type":993,"tag":6971,"props":7135,"children":7136},{},[7137,7146,7151],{"type":993,"tag":6998,"props":7138,"children":7139},{},[7140],{"type":993,"tag":1007,"props":7141,"children":7143},{"className":7142},[],[7144],{"type":998,"value":7145},"__contains__(self, item)",{"type":993,"tag":6998,"props":7147,"children":7148},{},[7149],{"type":998,"value":7150},"Membership testing",{"type":993,"tag":6998,"props":7152,"children":7153},{},[7154],{"type":993,"tag":1007,"props":7155,"children":7157},{"className":7156},[],[7158],{"type":998,"value":7159},"item in obj",{"type":993,"tag":6971,"props":7161,"children":7162},{},[7163,7172,7177],{"type":993,"tag":6998,"props":7164,"children":7165},{},[7166],{"type":993,"tag":1007,"props":7167,"children":7169},{"className":7168},[],[7170],{"type":998,"value":7171},"__iter__(self)",{"type":993,"tag":6998,"props":7173,"children":7174},{},[7175],{"type":998,"value":7176},"Iteration support",{"type":993,"tag":6998,"props":7178,"children":7179},{},[7180],{"type":993,"tag":1007,"props":7181,"children":7183},{"className":7182},[],[7184],{"type":998,"value":7185},"for item in obj",{"type":993,"tag":6971,"props":7187,"children":7188},{},[7189,7198,7203],{"type":993,"tag":6998,"props":7190,"children":7191},{},[7192],{"type":993,"tag":1007,"props":7193,"children":7195},{"className":7194},[],[7196],{"type":998,"value":7197},"__eq__(self, other)",{"type":993,"tag":6998,"props":7199,"children":7200},{},[7201],{"type":998,"value":7202},"Equality comparison",{"type":993,"tag":6998,"props":7204,"children":7205},{},[7206],{"type":993,"tag":1007,"props":7207,"children":7209},{"className":7208},[],[7210],{"type":998,"value":7211},"obj1 == obj2",{"type":993,"tag":6971,"props":7213,"children":7214},{},[7215,7224,7229],{"type":993,"tag":6998,"props":7216,"children":7217},{},[7218],{"type":993,"tag":1007,"props":7219,"children":7221},{"className":7220},[],[7222],{"type":998,"value":7223},"__lt__(self, other)",{"type":993,"tag":6998,"props":7225,"children":7226},{},[7227],{"type":998,"value":7228},"Less than comparison",{"type":993,"tag":6998,"props":7230,"children":7231},{},[7232],{"type":993,"tag":1007,"props":7233,"children":7235},{"className":7234},[],[7236],{"type":998,"value":7237},"obj1 \u003C obj2",{"type":993,"tag":6971,"props":7239,"children":7240},{},[7241,7250,7255],{"type":993,"tag":6998,"props":7242,"children":7243},{},[7244],{"type":993,"tag":1007,"props":7245,"children":7247},{"className":7246},[],[7248],{"type":998,"value":7249},"__add__(self, other)",{"type":993,"tag":6998,"props":7251,"children":7252},{},[7253],{"type":998,"value":7254},"Addition operation",{"type":993,"tag":6998,"props":7256,"children":7257},{},[7258],{"type":993,"tag":1007,"props":7259,"children":7261},{"className":7260},[],[7262],{"type":998,"value":7263},"obj1 + obj2",{"type":993,"tag":6971,"props":7265,"children":7266},{},[7267,7276,7281],{"type":993,"tag":6998,"props":7268,"children":7269},{},[7270],{"type":993,"tag":1007,"props":7271,"children":7273},{"className":7272},[],[7274],{"type":998,"value":7275},"__call__(self, *args)",{"type":993,"tag":6998,"props":7277,"children":7278},{},[7279],{"type":998,"value":7280},"Make object callable",{"type":993,"tag":6998,"props":7282,"children":7283},{},[7284],{"type":993,"tag":1007,"props":7285,"children":7287},{"className":7286},[],[7288],{"type":998,"value":7289},"obj(args)",{"type":993,"tag":6971,"props":7291,"children":7292},{},[7293,7302,7307],{"type":993,"tag":6998,"props":7294,"children":7295},{},[7296],{"type":993,"tag":1007,"props":7297,"children":7299},{"className":7298},[],[7300],{"type":998,"value":7301},"__enter__(self)",{"type":993,"tag":6998,"props":7303,"children":7304},{},[7305],{"type":998,"value":7306},"Context manager entry",{"type":993,"tag":6998,"props":7308,"children":7309},{},[7310],{"type":993,"tag":1007,"props":7311,"children":7313},{"className":7312},[],[7314],{"type":998,"value":7315},"with obj:",{"type":993,"tag":6971,"props":7317,"children":7318},{},[7319,7328,7333],{"type":993,"tag":6998,"props":7320,"children":7321},{},[7322],{"type":993,"tag":1007,"props":7323,"children":7325},{"className":7324},[],[7326],{"type":998,"value":7327},"__exit__(self, ...)",{"type":993,"tag":6998,"props":7329,"children":7330},{},[7331],{"type":998,"value":7332},"Context manager exit",{"type":993,"tag":6998,"props":7334,"children":7335},{},[7336],{"type":993,"tag":1007,"props":7337,"children":7339},{"className":7338},[],[7340],{"type":998,"value":7315},{"type":993,"tag":1690,"props":7342,"children":7346},{"emoji":7343,"title":7344,"type":7345},"✅","Best Practices","success",[7347,7355,7398,7406,7457,7465],{"type":993,"tag":1001,"props":7348,"children":7349},{},[7350],{"type":993,"tag":1700,"props":7351,"children":7352},{},[7353],{"type":998,"value":7354},"Implementation Guidelines:",{"type":993,"tag":1706,"props":7356,"children":7357},{},[7358,7369,7381,7393],{"type":993,"tag":1710,"props":7359,"children":7360},{},[7361,7362,7367],{"type":998,"value":5298},{"type":993,"tag":1007,"props":7363,"children":7365},{"className":7364},[],[7366],{"type":998,"value":1762},{"type":998,"value":7368}," for user-friendly output",{"type":993,"tag":1710,"props":7370,"children":7371},{},[7372,7374,7379],{"type":998,"value":7373},"Add ",{"type":993,"tag":1007,"props":7375,"children":7377},{"className":7376},[],[7378],{"type":998,"value":1769},{"type":998,"value":7380}," for debugging and development",{"type":993,"tag":1710,"props":7382,"children":7383},{},[7384,7386,7391],{"type":998,"value":7385},"Use ",{"type":993,"tag":1007,"props":7387,"children":7389},{"className":7388},[],[7390],{"type":998,"value":1813},{"type":998,"value":7392}," and comparison methods for sortable objects",{"type":993,"tag":1710,"props":7394,"children":7395},{},[7396],{"type":998,"value":7397},"Implement container methods for collection-like classes",{"type":993,"tag":1001,"props":7399,"children":7400},{},[7401],{"type":993,"tag":1700,"props":7402,"children":7403},{},[7404],{"type":998,"value":7405},"Common Patterns:",{"type":993,"tag":1706,"props":7407,"children":7408},{},[7409,7427,7440,7452],{"type":993,"tag":1710,"props":7410,"children":7411},{},[7412,7414,7419,7420,7425],{"type":998,"value":7413},"Always implement ",{"type":993,"tag":1007,"props":7415,"children":7417},{"className":7416},[],[7418],{"type":998,"value":1762},{"type":998,"value":1954},{"type":993,"tag":1007,"props":7421,"children":7423},{"className":7422},[],[7424],{"type":998,"value":1769},{"type":998,"value":7426}," together",{"type":993,"tag":1710,"props":7428,"children":7429},{},[7430,7432,7438],{"type":998,"value":7431},"Return ",{"type":993,"tag":1007,"props":7433,"children":7435},{"className":7434},[],[7436],{"type":998,"value":7437},"NotImplemented",{"type":998,"value":7439}," for unsupported comparison operations",{"type":993,"tag":1710,"props":7441,"children":7442},{},[7443,7444,7450],{"type":998,"value":7385},{"type":993,"tag":1007,"props":7445,"children":7447},{"className":7446},[],[7448],{"type":998,"value":7449},"isinstance()",{"type":998,"value":7451}," checks in comparison methods",{"type":993,"tag":1710,"props":7453,"children":7454},{},[7455],{"type":998,"value":7456},"Make context managers robust with proper error handling",{"type":993,"tag":1001,"props":7458,"children":7459},{},[7460],{"type":993,"tag":1700,"props":7461,"children":7462},{},[7463],{"type":998,"value":7464},"Design Principles:",{"type":993,"tag":1706,"props":7466,"children":7467},{},[7468,7473,7478,7483],{"type":993,"tag":1710,"props":7469,"children":7470},{},[7471],{"type":998,"value":7472},"Special methods should follow Python's conventions",{"type":993,"tag":1710,"props":7474,"children":7475},{},[7476],{"type":998,"value":7477},"Keep implementations simple and focused",{"type":993,"tag":1710,"props":7479,"children":7480},{},[7481],{"type":998,"value":7482},"Document special method behavior clearly",{"type":993,"tag":1710,"props":7484,"children":7485},{},[7486],{"type":998,"value":7487},"Test special methods thoroughly with edge cases",{"type":993,"tag":7489,"props":7490,"children":7492},"content-exercise",{":widget-view":7491,"category":6,"id":729},"true",[],{"type":993,"tag":7494,"props":7495,"children":7498},"exercise",{"hint":7496,"prompt":7497},"Use __str__ for readable output, __eq__ to compare books by title, and __len__ to return number of pages","Create a simple Book class that demonstrates basic special methods. Implement string representation (__str__), equality comparison (__eq__), and length (__len__ for page count). The book should be comparable by title and show user-friendly information.",[7499],{"type":993,"tag":1049,"props":7500,"children":7502},{"className":1051,"code":7501,"language":6,"meta":8,"style":8},"class Book:\n    def __init__(self, title, author, pages):\n        # TODO: Set title, author, and pages attributes\n        pass\n    \n    def __str__(self):\n        # TODO: Return user-friendly string representation\n        pass\n    \n    def __eq__(self, other):\n        # TODO: Compare books by title\n        pass\n    \n    def __len__(self):\n        # TODO: Return number of pages\n        pass\n\n# TODO: Test your Book class\nbook1 = Book(\"Python Programming\", \"John Doe\", 300)\nbook2 = Book(\"Python Programming\", \"Jane Smith\", 250)\nbook3 = Book(\"Java Basics\", \"Bob Wilson\", 400)\n\nprint(book1)  # Uses __str__\nprint(f\"Book length: {len(book1)} pages\")  # Uses __len__\nprint(f\"book1 == book2: {book1 == book2}\")  # Uses __eq__\nprint(f\"book1 == book3: {book1 == book3}\")  # Uses __eq__\n",[7503],{"type":993,"tag":1007,"props":7504,"children":7505},{"__ignoreMap":8},[7506,7522,7538,7556,7564,7571,7586,7602,7609,7616,7631,7647,7654,7661,7676,7692,7699,7706,7723,7767,7809,7852,7859,7875,7921,7975],{"type":993,"tag":1058,"props":7507,"children":7508},{"class":1060,"line":12},[7509,7513,7518],{"type":993,"tag":1058,"props":7510,"children":7511},{"style":1073},[7512],{"type":998,"value":1076},{"type":993,"tag":1058,"props":7514,"children":7515},{"style":1079},[7516],{"type":998,"value":7517}," Book",{"type":993,"tag":1058,"props":7519,"children":7520},{"style":1085},[7521],{"type":998,"value":1088},{"type":993,"tag":1058,"props":7523,"children":7524},{"class":1060,"line":27},[7525,7529,7533],{"type":993,"tag":1058,"props":7526,"children":7527},{"style":1073},[7528],{"type":998,"value":1096},{"type":993,"tag":1058,"props":7530,"children":7531},{"style":1099},[7532],{"type":998,"value":1102},{"type":993,"tag":1058,"props":7534,"children":7535},{"style":1085},[7536],{"type":998,"value":7537},"(self, title, author, pages):\n",{"type":993,"tag":1058,"props":7539,"children":7540},{"class":1060,"line":36},[7541,7546,7551],{"type":993,"tag":1058,"props":7542,"children":7543},{"style":1064},[7544],{"type":998,"value":7545},"        # ",{"type":993,"tag":1058,"props":7547,"children":7548},{"style":1073},[7549],{"type":998,"value":7550},"TODO",{"type":993,"tag":1058,"props":7552,"children":7553},{"style":1064},[7554],{"type":998,"value":7555},": Set title, author, and pages attributes\n",{"type":993,"tag":1058,"props":7557,"children":7558},{"class":1060,"line":45},[7559],{"type":993,"tag":1058,"props":7560,"children":7561},{"style":1073},[7562],{"type":998,"value":7563},"        pass\n",{"type":993,"tag":1058,"props":7565,"children":7566},{"class":1060,"line":54},[7567],{"type":993,"tag":1058,"props":7568,"children":7569},{"style":1085},[7570],{"type":998,"value":1159},{"type":993,"tag":1058,"props":7572,"children":7573},{"class":1060,"line":63},[7574,7578,7582],{"type":993,"tag":1058,"props":7575,"children":7576},{"style":1073},[7577],{"type":998,"value":1096},{"type":993,"tag":1058,"props":7579,"children":7580},{"style":1099},[7581],{"type":998,"value":1171},{"type":993,"tag":1058,"props":7583,"children":7584},{"style":1085},[7585],{"type":998,"value":2103},{"type":993,"tag":1058,"props":7587,"children":7588},{"class":1060,"line":72},[7589,7593,7597],{"type":993,"tag":1058,"props":7590,"children":7591},{"style":1064},[7592],{"type":998,"value":7545},{"type":993,"tag":1058,"props":7594,"children":7595},{"style":1073},[7596],{"type":998,"value":7550},{"type":993,"tag":1058,"props":7598,"children":7599},{"style":1064},[7600],{"type":998,"value":7601},": Return user-friendly string representation\n",{"type":993,"tag":1058,"props":7603,"children":7604},{"class":1060,"line":81},[7605],{"type":993,"tag":1058,"props":7606,"children":7607},{"style":1073},[7608],{"type":998,"value":7563},{"type":993,"tag":1058,"props":7610,"children":7611},{"class":1060,"line":91},[7612],{"type":993,"tag":1058,"props":7613,"children":7614},{"style":1085},[7615],{"type":998,"value":1159},{"type":993,"tag":1058,"props":7617,"children":7618},{"class":1060,"line":100},[7619,7623,7627],{"type":993,"tag":1058,"props":7620,"children":7621},{"style":1073},[7622],{"type":998,"value":1096},{"type":993,"tag":1058,"props":7624,"children":7625},{"style":1099},[7626],{"type":998,"value":2676},{"type":993,"tag":1058,"props":7628,"children":7629},{"style":1085},[7630],{"type":998,"value":2681},{"type":993,"tag":1058,"props":7632,"children":7633},{"class":1060,"line":109},[7634,7638,7642],{"type":993,"tag":1058,"props":7635,"children":7636},{"style":1064},[7637],{"type":998,"value":7545},{"type":993,"tag":1058,"props":7639,"children":7640},{"style":1073},[7641],{"type":998,"value":7550},{"type":993,"tag":1058,"props":7643,"children":7644},{"style":1064},[7645],{"type":998,"value":7646},": Compare books by title\n",{"type":993,"tag":1058,"props":7648,"children":7649},{"class":1060,"line":118},[7650],{"type":993,"tag":1058,"props":7651,"children":7652},{"style":1073},[7653],{"type":998,"value":7563},{"type":993,"tag":1058,"props":7655,"children":7656},{"class":1060,"line":127},[7657],{"type":993,"tag":1058,"props":7658,"children":7659},{"style":1085},[7660],{"type":998,"value":1159},{"type":993,"tag":1058,"props":7662,"children":7663},{"class":1060,"line":136},[7664,7668,7672],{"type":993,"tag":1058,"props":7665,"children":7666},{"style":1073},[7667],{"type":998,"value":1096},{"type":993,"tag":1058,"props":7669,"children":7670},{"style":1099},[7671],{"type":998,"value":1268},{"type":993,"tag":1058,"props":7673,"children":7674},{"style":1085},[7675],{"type":998,"value":2103},{"type":993,"tag":1058,"props":7677,"children":7678},{"class":1060,"line":146},[7679,7683,7687],{"type":993,"tag":1058,"props":7680,"children":7681},{"style":1064},[7682],{"type":998,"value":7545},{"type":993,"tag":1058,"props":7684,"children":7685},{"style":1073},[7686],{"type":998,"value":7550},{"type":993,"tag":1058,"props":7688,"children":7689},{"style":1064},[7690],{"type":998,"value":7691},": Return number of pages\n",{"type":993,"tag":1058,"props":7693,"children":7694},{"class":1060,"line":155},[7695],{"type":993,"tag":1058,"props":7696,"children":7697},{"style":1073},[7698],{"type":998,"value":7563},{"type":993,"tag":1058,"props":7700,"children":7701},{"class":1060,"line":164},[7702],{"type":993,"tag":1058,"props":7703,"children":7704},{"emptyLinePlaceholder":13},[7705],{"type":998,"value":1447},{"type":993,"tag":1058,"props":7707,"children":7708},{"class":1060,"line":173},[7709,7714,7718],{"type":993,"tag":1058,"props":7710,"children":7711},{"style":1064},[7712],{"type":998,"value":7713},"# ",{"type":993,"tag":1058,"props":7715,"children":7716},{"style":1073},[7717],{"type":998,"value":7550},{"type":993,"tag":1058,"props":7719,"children":7720},{"style":1064},[7721],{"type":998,"value":7722},": Test your Book class\n",{"type":993,"tag":1058,"props":7724,"children":7725},{"class":1060,"line":182},[7726,7731,7735,7740,7745,7749,7754,7758,7763],{"type":993,"tag":1058,"props":7727,"children":7728},{"style":1085},[7729],{"type":998,"value":7730},"book1 ",{"type":993,"tag":1058,"props":7732,"children":7733},{"style":1073},[7734],{"type":998,"value":1125},{"type":993,"tag":1058,"props":7736,"children":7737},{"style":1085},[7738],{"type":998,"value":7739}," Book(",{"type":993,"tag":1058,"props":7741,"children":7742},{"style":1197},[7743],{"type":998,"value":7744},"\"Python Programming\"",{"type":993,"tag":1058,"props":7746,"children":7747},{"style":1085},[7748],{"type":998,"value":1014},{"type":993,"tag":1058,"props":7750,"children":7751},{"style":1197},[7752],{"type":998,"value":7753},"\"John Doe\"",{"type":993,"tag":1058,"props":7755,"children":7756},{"style":1085},[7757],{"type":998,"value":1014},{"type":993,"tag":1058,"props":7759,"children":7760},{"style":1099},[7761],{"type":998,"value":7762},"300",{"type":993,"tag":1058,"props":7764,"children":7765},{"style":1085},[7766],{"type":998,"value":1482},{"type":993,"tag":1058,"props":7768,"children":7769},{"class":1060,"line":191},[7770,7775,7779,7783,7787,7791,7796,7800,7805],{"type":993,"tag":1058,"props":7771,"children":7772},{"style":1085},[7773],{"type":998,"value":7774},"book2 ",{"type":993,"tag":1058,"props":7776,"children":7777},{"style":1073},[7778],{"type":998,"value":1125},{"type":993,"tag":1058,"props":7780,"children":7781},{"style":1085},[7782],{"type":998,"value":7739},{"type":993,"tag":1058,"props":7784,"children":7785},{"style":1197},[7786],{"type":998,"value":7744},{"type":993,"tag":1058,"props":7788,"children":7789},{"style":1085},[7790],{"type":998,"value":1014},{"type":993,"tag":1058,"props":7792,"children":7793},{"style":1197},[7794],{"type":998,"value":7795},"\"Jane Smith\"",{"type":993,"tag":1058,"props":7797,"children":7798},{"style":1085},[7799],{"type":998,"value":1014},{"type":993,"tag":1058,"props":7801,"children":7802},{"style":1099},[7803],{"type":998,"value":7804},"250",{"type":993,"tag":1058,"props":7806,"children":7807},{"style":1085},[7808],{"type":998,"value":1482},{"type":993,"tag":1058,"props":7810,"children":7811},{"class":1060,"line":201},[7812,7817,7821,7825,7830,7834,7839,7843,7848],{"type":993,"tag":1058,"props":7813,"children":7814},{"style":1085},[7815],{"type":998,"value":7816},"book3 ",{"type":993,"tag":1058,"props":7818,"children":7819},{"style":1073},[7820],{"type":998,"value":1125},{"type":993,"tag":1058,"props":7822,"children":7823},{"style":1085},[7824],{"type":998,"value":7739},{"type":993,"tag":1058,"props":7826,"children":7827},{"style":1197},[7828],{"type":998,"value":7829},"\"Java Basics\"",{"type":993,"tag":1058,"props":7831,"children":7832},{"style":1085},[7833],{"type":998,"value":1014},{"type":993,"tag":1058,"props":7835,"children":7836},{"style":1197},[7837],{"type":998,"value":7838},"\"Bob Wilson\"",{"type":993,"tag":1058,"props":7840,"children":7841},{"style":1085},[7842],{"type":998,"value":1014},{"type":993,"tag":1058,"props":7844,"children":7845},{"style":1099},[7846],{"type":998,"value":7847},"400",{"type":993,"tag":1058,"props":7849,"children":7850},{"style":1085},[7851],{"type":998,"value":1482},{"type":993,"tag":1058,"props":7853,"children":7854},{"class":1060,"line":210},[7855],{"type":993,"tag":1058,"props":7856,"children":7857},{"emptyLinePlaceholder":13},[7858],{"type":998,"value":1447},{"type":993,"tag":1058,"props":7860,"children":7861},{"class":1060,"line":219},[7862,7866,7871],{"type":993,"tag":1058,"props":7863,"children":7864},{"style":1099},[7865],{"type":998,"value":1530},{"type":993,"tag":1058,"props":7867,"children":7868},{"style":1085},[7869],{"type":998,"value":7870},"(book1)  ",{"type":993,"tag":1058,"props":7872,"children":7873},{"style":1064},[7874],{"type":998,"value":1540},{"type":993,"tag":1058,"props":7876,"children":7877},{"class":1060,"line":228},[7878,7882,7886,7890,7895,7899,7904,7908,7913,7917],{"type":993,"tag":1058,"props":7879,"children":7880},{"style":1099},[7881],{"type":998,"value":1530},{"type":993,"tag":1058,"props":7883,"children":7884},{"style":1085},[7885],{"type":998,"value":1230},{"type":993,"tag":1058,"props":7887,"children":7888},{"style":1073},[7889],{"type":998,"value":1556},{"type":993,"tag":1058,"props":7891,"children":7892},{"style":1197},[7893],{"type":998,"value":7894},"\"Book length: ",{"type":993,"tag":1058,"props":7896,"children":7897},{"style":1099},[7898],{"type":998,"value":1225},{"type":993,"tag":1058,"props":7900,"children":7901},{"style":1085},[7902],{"type":998,"value":7903},"(book1)",{"type":993,"tag":1058,"props":7905,"children":7906},{"style":1099},[7907],{"type":998,"value":1215},{"type":993,"tag":1058,"props":7909,"children":7910},{"style":1197},[7911],{"type":998,"value":7912}," pages\"",{"type":993,"tag":1058,"props":7914,"children":7915},{"style":1085},[7916],{"type":998,"value":1584},{"type":993,"tag":1058,"props":7918,"children":7919},{"style":1064},[7920],{"type":998,"value":1589},{"type":993,"tag":1058,"props":7922,"children":7923},{"class":1060,"line":238},[7924,7928,7932,7936,7941,7945,7949,7953,7958,7962,7966,7970],{"type":993,"tag":1058,"props":7925,"children":7926},{"style":1099},[7927],{"type":998,"value":1530},{"type":993,"tag":1058,"props":7929,"children":7930},{"style":1085},[7931],{"type":998,"value":1230},{"type":993,"tag":1058,"props":7933,"children":7934},{"style":1073},[7935],{"type":998,"value":1556},{"type":993,"tag":1058,"props":7937,"children":7938},{"style":1197},[7939],{"type":998,"value":7940},"\"book1 == book2: ",{"type":993,"tag":1058,"props":7942,"children":7943},{"style":1099},[7944],{"type":998,"value":1614},{"type":993,"tag":1058,"props":7946,"children":7947},{"style":1085},[7948],{"type":998,"value":7730},{"type":993,"tag":1058,"props":7950,"children":7951},{"style":1073},[7952],{"type":998,"value":2728},{"type":993,"tag":1058,"props":7954,"children":7955},{"style":1085},[7956],{"type":998,"value":7957}," book2",{"type":993,"tag":1058,"props":7959,"children":7960},{"style":1099},[7961],{"type":998,"value":1215},{"type":993,"tag":1058,"props":7963,"children":7964},{"style":1197},[7965],{"type":998,"value":1579},{"type":993,"tag":1058,"props":7967,"children":7968},{"style":1085},[7969],{"type":998,"value":1584},{"type":993,"tag":1058,"props":7971,"children":7972},{"style":1064},[7973],{"type":998,"value":7974},"# Uses __eq__\n",{"type":993,"tag":1058,"props":7976,"children":7977},{"class":1060,"line":247},[7978,7982,7986,7990,7995,7999,8003,8007,8012,8016,8020,8024],{"type":993,"tag":1058,"props":7979,"children":7980},{"style":1099},[7981],{"type":998,"value":1530},{"type":993,"tag":1058,"props":7983,"children":7984},{"style":1085},[7985],{"type":998,"value":1230},{"type":993,"tag":1058,"props":7987,"children":7988},{"style":1073},[7989],{"type":998,"value":1556},{"type":993,"tag":1058,"props":7991,"children":7992},{"style":1197},[7993],{"type":998,"value":7994},"\"book1 == book3: ",{"type":993,"tag":1058,"props":7996,"children":7997},{"style":1099},[7998],{"type":998,"value":1614},{"type":993,"tag":1058,"props":8000,"children":8001},{"style":1085},[8002],{"type":998,"value":7730},{"type":993,"tag":1058,"props":8004,"children":8005},{"style":1073},[8006],{"type":998,"value":2728},{"type":993,"tag":1058,"props":8008,"children":8009},{"style":1085},[8010],{"type":998,"value":8011}," book3",{"type":993,"tag":1058,"props":8013,"children":8014},{"style":1099},[8015],{"type":998,"value":1215},{"type":993,"tag":1058,"props":8017,"children":8018},{"style":1197},[8019],{"type":998,"value":1579},{"type":993,"tag":1058,"props":8021,"children":8022},{"style":1085},[8023],{"type":998,"value":1584},{"type":993,"tag":1058,"props":8025,"children":8026},{"style":1064},[8027],{"type":998,"value":7974},{"type":993,"tag":1931,"props":8029,"children":8031},{"id":8030},"solution-and-explanation",[8032],{"type":998,"value":8033},"Solution and Explanation 💡",{"type":993,"tag":8035,"props":8036,"children":8037},"details",{},[8038,8046,8682,8690],{"type":993,"tag":8039,"props":8040,"children":8043},"summary",{"className":8041},[8042],"cursor-pointer",[8044],{"type":998,"value":8045},"Click to see the complete solution",{"type":993,"tag":1045,"props":8047,"children":8048},{},[8049],{"type":993,"tag":1049,"props":8050,"children":8052},{"className":1051,"code":8051,"language":6,"meta":8,"style":8},"class Book:\n    def __init__(self, title, author, pages):\n        # Set title, author, and pages attributes\n        self.title = title\n        self.author = author\n        self.pages = pages\n    \n    def __str__(self):\n        # Return user-friendly string representation\n        return f\"'{self.title}' by {self.author} ({self.pages} pages)\"\n    \n    def __eq__(self, other):\n        # Compare books by title\n        if isinstance(other, Book):\n            return self.title == other.title\n        return False\n    \n    def __len__(self):\n        # Return number of pages\n        return self.pages\n\n# Test your Book class\nbook1 = Book(\"Python Programming\", \"John Doe\", 300)\nbook2 = Book(\"Python Programming\", \"Jane Smith\", 250)\nbook3 = Book(\"Java Basics\", \"Bob Wilson\", 400)\n\nprint(book1)  # Uses __str__\nprint(f\"Book length: {len(book1)} pages\")  # Uses __len__\nprint(f\"book1 == book2: {book1 == book2}\")  # Uses __eq__\nprint(f\"book1 == book3: {book1 == book3}\")  # Uses __eq__\n",[8053],{"type":993,"tag":1007,"props":8054,"children":8055},{"__ignoreMap":8},[8056,8071,8086,8094,8115,8136,8157,8164,8179,8187,8256,8263,8278,8286,8302,8326,8337,8344,8359,8367,8383,8390,8398,8437,8476,8515,8522,8537,8580,8631],{"type":993,"tag":1058,"props":8057,"children":8058},{"class":1060,"line":12},[8059,8063,8067],{"type":993,"tag":1058,"props":8060,"children":8061},{"style":1073},[8062],{"type":998,"value":1076},{"type":993,"tag":1058,"props":8064,"children":8065},{"style":1079},[8066],{"type":998,"value":7517},{"type":993,"tag":1058,"props":8068,"children":8069},{"style":1085},[8070],{"type":998,"value":1088},{"type":993,"tag":1058,"props":8072,"children":8073},{"class":1060,"line":27},[8074,8078,8082],{"type":993,"tag":1058,"props":8075,"children":8076},{"style":1073},[8077],{"type":998,"value":1096},{"type":993,"tag":1058,"props":8079,"children":8080},{"style":1099},[8081],{"type":998,"value":1102},{"type":993,"tag":1058,"props":8083,"children":8084},{"style":1085},[8085],{"type":998,"value":7537},{"type":993,"tag":1058,"props":8087,"children":8088},{"class":1060,"line":36},[8089],{"type":993,"tag":1058,"props":8090,"children":8091},{"style":1064},[8092],{"type":998,"value":8093},"        # Set title, author, and pages attributes\n",{"type":993,"tag":1058,"props":8095,"children":8096},{"class":1060,"line":45},[8097,8101,8106,8110],{"type":993,"tag":1058,"props":8098,"children":8099},{"style":1099},[8100],{"type":998,"value":1115},{"type":993,"tag":1058,"props":8102,"children":8103},{"style":1085},[8104],{"type":998,"value":8105},".title ",{"type":993,"tag":1058,"props":8107,"children":8108},{"style":1073},[8109],{"type":998,"value":1125},{"type":993,"tag":1058,"props":8111,"children":8112},{"style":1085},[8113],{"type":998,"value":8114}," title\n",{"type":993,"tag":1058,"props":8116,"children":8117},{"class":1060,"line":54},[8118,8122,8127,8131],{"type":993,"tag":1058,"props":8119,"children":8120},{"style":1099},[8121],{"type":998,"value":1115},{"type":993,"tag":1058,"props":8123,"children":8124},{"style":1085},[8125],{"type":998,"value":8126},".author ",{"type":993,"tag":1058,"props":8128,"children":8129},{"style":1073},[8130],{"type":998,"value":1125},{"type":993,"tag":1058,"props":8132,"children":8133},{"style":1085},[8134],{"type":998,"value":8135}," author\n",{"type":993,"tag":1058,"props":8137,"children":8138},{"class":1060,"line":63},[8139,8143,8148,8152],{"type":993,"tag":1058,"props":8140,"children":8141},{"style":1099},[8142],{"type":998,"value":1115},{"type":993,"tag":1058,"props":8144,"children":8145},{"style":1085},[8146],{"type":998,"value":8147},".pages ",{"type":993,"tag":1058,"props":8149,"children":8150},{"style":1073},[8151],{"type":998,"value":1125},{"type":993,"tag":1058,"props":8153,"children":8154},{"style":1085},[8155],{"type":998,"value":8156}," pages\n",{"type":993,"tag":1058,"props":8158,"children":8159},{"class":1060,"line":72},[8160],{"type":993,"tag":1058,"props":8161,"children":8162},{"style":1085},[8163],{"type":998,"value":1159},{"type":993,"tag":1058,"props":8165,"children":8166},{"class":1060,"line":81},[8167,8171,8175],{"type":993,"tag":1058,"props":8168,"children":8169},{"style":1073},[8170],{"type":998,"value":1096},{"type":993,"tag":1058,"props":8172,"children":8173},{"style":1099},[8174],{"type":998,"value":1171},{"type":993,"tag":1058,"props":8176,"children":8177},{"style":1085},[8178],{"type":998,"value":2103},{"type":993,"tag":1058,"props":8180,"children":8181},{"class":1060,"line":91},[8182],{"type":993,"tag":1058,"props":8183,"children":8184},{"style":1064},[8185],{"type":998,"value":8186},"        # Return user-friendly string representation\n",{"type":993,"tag":1058,"props":8188,"children":8189},{"class":1060,"line":100},[8190,8194,8198,8203,8207,8212,8216,8221,8225,8230,8234,8238,8242,8247,8251],{"type":993,"tag":1058,"props":8191,"children":8192},{"style":1073},[8193],{"type":998,"value":1189},{"type":993,"tag":1058,"props":8195,"children":8196},{"style":1073},[8197],{"type":998,"value":1194},{"type":993,"tag":1058,"props":8199,"children":8200},{"style":1197},[8201],{"type":998,"value":8202},"\"'",{"type":993,"tag":1058,"props":8204,"children":8205},{"style":1099},[8206],{"type":998,"value":1205},{"type":993,"tag":1058,"props":8208,"children":8209},{"style":1085},[8210],{"type":998,"value":8211},".title",{"type":993,"tag":1058,"props":8213,"children":8214},{"style":1099},[8215],{"type":998,"value":1215},{"type":993,"tag":1058,"props":8217,"children":8218},{"style":1197},[8219],{"type":998,"value":8220},"' by ",{"type":993,"tag":1058,"props":8222,"children":8223},{"style":1099},[8224],{"type":998,"value":1205},{"type":993,"tag":1058,"props":8226,"children":8227},{"style":1085},[8228],{"type":998,"value":8229},".author",{"type":993,"tag":1058,"props":8231,"children":8232},{"style":1099},[8233],{"type":998,"value":1215},{"type":993,"tag":1058,"props":8235,"children":8236},{"style":1197},[8237],{"type":998,"value":1220},{"type":993,"tag":1058,"props":8239,"children":8240},{"style":1099},[8241],{"type":998,"value":1205},{"type":993,"tag":1058,"props":8243,"children":8244},{"style":1085},[8245],{"type":998,"value":8246},".pages",{"type":993,"tag":1058,"props":8248,"children":8249},{"style":1099},[8250],{"type":998,"value":1215},{"type":993,"tag":1058,"props":8252,"children":8253},{"style":1197},[8254],{"type":998,"value":8255}," pages)\"\n",{"type":993,"tag":1058,"props":8257,"children":8258},{"class":1060,"line":109},[8259],{"type":993,"tag":1058,"props":8260,"children":8261},{"style":1085},[8262],{"type":998,"value":1159},{"type":993,"tag":1058,"props":8264,"children":8265},{"class":1060,"line":118},[8266,8270,8274],{"type":993,"tag":1058,"props":8267,"children":8268},{"style":1073},[8269],{"type":998,"value":1096},{"type":993,"tag":1058,"props":8271,"children":8272},{"style":1099},[8273],{"type":998,"value":2676},{"type":993,"tag":1058,"props":8275,"children":8276},{"style":1085},[8277],{"type":998,"value":2681},{"type":993,"tag":1058,"props":8279,"children":8280},{"class":1060,"line":127},[8281],{"type":993,"tag":1058,"props":8282,"children":8283},{"style":1064},[8284],{"type":998,"value":8285},"        # Compare books by title\n",{"type":993,"tag":1058,"props":8287,"children":8288},{"class":1060,"line":136},[8289,8293,8297],{"type":993,"tag":1058,"props":8290,"children":8291},{"style":1073},[8292],{"type":998,"value":2697},{"type":993,"tag":1058,"props":8294,"children":8295},{"style":1099},[8296],{"type":998,"value":2702},{"type":993,"tag":1058,"props":8298,"children":8299},{"style":1085},[8300],{"type":998,"value":8301},"(other, Book):\n",{"type":993,"tag":1058,"props":8303,"children":8304},{"class":1060,"line":146},[8305,8309,8313,8317,8321],{"type":993,"tag":1058,"props":8306,"children":8307},{"style":1073},[8308],{"type":998,"value":2715},{"type":993,"tag":1058,"props":8310,"children":8311},{"style":1099},[8312],{"type":998,"value":1343},{"type":993,"tag":1058,"props":8314,"children":8315},{"style":1085},[8316],{"type":998,"value":8105},{"type":993,"tag":1058,"props":8318,"children":8319},{"style":1073},[8320],{"type":998,"value":2728},{"type":993,"tag":1058,"props":8322,"children":8323},{"style":1085},[8324],{"type":998,"value":8325}," other.title\n",{"type":993,"tag":1058,"props":8327,"children":8328},{"class":1060,"line":155},[8329,8333],{"type":993,"tag":1058,"props":8330,"children":8331},{"style":1073},[8332],{"type":998,"value":1189},{"type":993,"tag":1058,"props":8334,"children":8335},{"style":1099},[8336],{"type":998,"value":2745},{"type":993,"tag":1058,"props":8338,"children":8339},{"class":1060,"line":164},[8340],{"type":993,"tag":1058,"props":8341,"children":8342},{"style":1085},[8343],{"type":998,"value":1159},{"type":993,"tag":1058,"props":8345,"children":8346},{"class":1060,"line":173},[8347,8351,8355],{"type":993,"tag":1058,"props":8348,"children":8349},{"style":1073},[8350],{"type":998,"value":1096},{"type":993,"tag":1058,"props":8352,"children":8353},{"style":1099},[8354],{"type":998,"value":1268},{"type":993,"tag":1058,"props":8356,"children":8357},{"style":1085},[8358],{"type":998,"value":2103},{"type":993,"tag":1058,"props":8360,"children":8361},{"class":1060,"line":182},[8362],{"type":993,"tag":1058,"props":8363,"children":8364},{"style":1064},[8365],{"type":998,"value":8366},"        # Return number of pages\n",{"type":993,"tag":1058,"props":8368,"children":8369},{"class":1060,"line":191},[8370,8374,8378],{"type":993,"tag":1058,"props":8371,"children":8372},{"style":1073},[8373],{"type":998,"value":1189},{"type":993,"tag":1058,"props":8375,"children":8376},{"style":1099},[8377],{"type":998,"value":1343},{"type":993,"tag":1058,"props":8379,"children":8380},{"style":1085},[8381],{"type":998,"value":8382},".pages\n",{"type":993,"tag":1058,"props":8384,"children":8385},{"class":1060,"line":201},[8386],{"type":993,"tag":1058,"props":8387,"children":8388},{"emptyLinePlaceholder":13},[8389],{"type":998,"value":1447},{"type":993,"tag":1058,"props":8391,"children":8392},{"class":1060,"line":210},[8393],{"type":993,"tag":1058,"props":8394,"children":8395},{"style":1064},[8396],{"type":998,"value":8397},"# Test your Book class\n",{"type":993,"tag":1058,"props":8399,"children":8400},{"class":1060,"line":219},[8401,8405,8409,8413,8417,8421,8425,8429,8433],{"type":993,"tag":1058,"props":8402,"children":8403},{"style":1085},[8404],{"type":998,"value":7730},{"type":993,"tag":1058,"props":8406,"children":8407},{"style":1073},[8408],{"type":998,"value":1125},{"type":993,"tag":1058,"props":8410,"children":8411},{"style":1085},[8412],{"type":998,"value":7739},{"type":993,"tag":1058,"props":8414,"children":8415},{"style":1197},[8416],{"type":998,"value":7744},{"type":993,"tag":1058,"props":8418,"children":8419},{"style":1085},[8420],{"type":998,"value":1014},{"type":993,"tag":1058,"props":8422,"children":8423},{"style":1197},[8424],{"type":998,"value":7753},{"type":993,"tag":1058,"props":8426,"children":8427},{"style":1085},[8428],{"type":998,"value":1014},{"type":993,"tag":1058,"props":8430,"children":8431},{"style":1099},[8432],{"type":998,"value":7762},{"type":993,"tag":1058,"props":8434,"children":8435},{"style":1085},[8436],{"type":998,"value":1482},{"type":993,"tag":1058,"props":8438,"children":8439},{"class":1060,"line":228},[8440,8444,8448,8452,8456,8460,8464,8468,8472],{"type":993,"tag":1058,"props":8441,"children":8442},{"style":1085},[8443],{"type":998,"value":7774},{"type":993,"tag":1058,"props":8445,"children":8446},{"style":1073},[8447],{"type":998,"value":1125},{"type":993,"tag":1058,"props":8449,"children":8450},{"style":1085},[8451],{"type":998,"value":7739},{"type":993,"tag":1058,"props":8453,"children":8454},{"style":1197},[8455],{"type":998,"value":7744},{"type":993,"tag":1058,"props":8457,"children":8458},{"style":1085},[8459],{"type":998,"value":1014},{"type":993,"tag":1058,"props":8461,"children":8462},{"style":1197},[8463],{"type":998,"value":7795},{"type":993,"tag":1058,"props":8465,"children":8466},{"style":1085},[8467],{"type":998,"value":1014},{"type":993,"tag":1058,"props":8469,"children":8470},{"style":1099},[8471],{"type":998,"value":7804},{"type":993,"tag":1058,"props":8473,"children":8474},{"style":1085},[8475],{"type":998,"value":1482},{"type":993,"tag":1058,"props":8477,"children":8478},{"class":1060,"line":238},[8479,8483,8487,8491,8495,8499,8503,8507,8511],{"type":993,"tag":1058,"props":8480,"children":8481},{"style":1085},[8482],{"type":998,"value":7816},{"type":993,"tag":1058,"props":8484,"children":8485},{"style":1073},[8486],{"type":998,"value":1125},{"type":993,"tag":1058,"props":8488,"children":8489},{"style":1085},[8490],{"type":998,"value":7739},{"type":993,"tag":1058,"props":8492,"children":8493},{"style":1197},[8494],{"type":998,"value":7829},{"type":993,"tag":1058,"props":8496,"children":8497},{"style":1085},[8498],{"type":998,"value":1014},{"type":993,"tag":1058,"props":8500,"children":8501},{"style":1197},[8502],{"type":998,"value":7838},{"type":993,"tag":1058,"props":8504,"children":8505},{"style":1085},[8506],{"type":998,"value":1014},{"type":993,"tag":1058,"props":8508,"children":8509},{"style":1099},[8510],{"type":998,"value":7847},{"type":993,"tag":1058,"props":8512,"children":8513},{"style":1085},[8514],{"type":998,"value":1482},{"type":993,"tag":1058,"props":8516,"children":8517},{"class":1060,"line":247},[8518],{"type":993,"tag":1058,"props":8519,"children":8520},{"emptyLinePlaceholder":13},[8521],{"type":998,"value":1447},{"type":993,"tag":1058,"props":8523,"children":8524},{"class":1060,"line":256},[8525,8529,8533],{"type":993,"tag":1058,"props":8526,"children":8527},{"style":1099},[8528],{"type":998,"value":1530},{"type":993,"tag":1058,"props":8530,"children":8531},{"style":1085},[8532],{"type":998,"value":7870},{"type":993,"tag":1058,"props":8534,"children":8535},{"style":1064},[8536],{"type":998,"value":1540},{"type":993,"tag":1058,"props":8538,"children":8539},{"class":1060,"line":265},[8540,8544,8548,8552,8556,8560,8564,8568,8572,8576],{"type":993,"tag":1058,"props":8541,"children":8542},{"style":1099},[8543],{"type":998,"value":1530},{"type":993,"tag":1058,"props":8545,"children":8546},{"style":1085},[8547],{"type":998,"value":1230},{"type":993,"tag":1058,"props":8549,"children":8550},{"style":1073},[8551],{"type":998,"value":1556},{"type":993,"tag":1058,"props":8553,"children":8554},{"style":1197},[8555],{"type":998,"value":7894},{"type":993,"tag":1058,"props":8557,"children":8558},{"style":1099},[8559],{"type":998,"value":1225},{"type":993,"tag":1058,"props":8561,"children":8562},{"style":1085},[8563],{"type":998,"value":7903},{"type":993,"tag":1058,"props":8565,"children":8566},{"style":1099},[8567],{"type":998,"value":1215},{"type":993,"tag":1058,"props":8569,"children":8570},{"style":1197},[8571],{"type":998,"value":7912},{"type":993,"tag":1058,"props":8573,"children":8574},{"style":1085},[8575],{"type":998,"value":1584},{"type":993,"tag":1058,"props":8577,"children":8578},{"style":1064},[8579],{"type":998,"value":1589},{"type":993,"tag":1058,"props":8581,"children":8582},{"class":1060,"line":274},[8583,8587,8591,8595,8599,8603,8607,8611,8615,8619,8623,8627],{"type":993,"tag":1058,"props":8584,"children":8585},{"style":1099},[8586],{"type":998,"value":1530},{"type":993,"tag":1058,"props":8588,"children":8589},{"style":1085},[8590],{"type":998,"value":1230},{"type":993,"tag":1058,"props":8592,"children":8593},{"style":1073},[8594],{"type":998,"value":1556},{"type":993,"tag":1058,"props":8596,"children":8597},{"style":1197},[8598],{"type":998,"value":7940},{"type":993,"tag":1058,"props":8600,"children":8601},{"style":1099},[8602],{"type":998,"value":1614},{"type":993,"tag":1058,"props":8604,"children":8605},{"style":1085},[8606],{"type":998,"value":7730},{"type":993,"tag":1058,"props":8608,"children":8609},{"style":1073},[8610],{"type":998,"value":2728},{"type":993,"tag":1058,"props":8612,"children":8613},{"style":1085},[8614],{"type":998,"value":7957},{"type":993,"tag":1058,"props":8616,"children":8617},{"style":1099},[8618],{"type":998,"value":1215},{"type":993,"tag":1058,"props":8620,"children":8621},{"style":1197},[8622],{"type":998,"value":1579},{"type":993,"tag":1058,"props":8624,"children":8625},{"style":1085},[8626],{"type":998,"value":1584},{"type":993,"tag":1058,"props":8628,"children":8629},{"style":1064},[8630],{"type":998,"value":7974},{"type":993,"tag":1058,"props":8632,"children":8633},{"class":1060,"line":284},[8634,8638,8642,8646,8650,8654,8658,8662,8666,8670,8674,8678],{"type":993,"tag":1058,"props":8635,"children":8636},{"style":1099},[8637],{"type":998,"value":1530},{"type":993,"tag":1058,"props":8639,"children":8640},{"style":1085},[8641],{"type":998,"value":1230},{"type":993,"tag":1058,"props":8643,"children":8644},{"style":1073},[8645],{"type":998,"value":1556},{"type":993,"tag":1058,"props":8647,"children":8648},{"style":1197},[8649],{"type":998,"value":7994},{"type":993,"tag":1058,"props":8651,"children":8652},{"style":1099},[8653],{"type":998,"value":1614},{"type":993,"tag":1058,"props":8655,"children":8656},{"style":1085},[8657],{"type":998,"value":7730},{"type":993,"tag":1058,"props":8659,"children":8660},{"style":1073},[8661],{"type":998,"value":2728},{"type":993,"tag":1058,"props":8663,"children":8664},{"style":1085},[8665],{"type":998,"value":8011},{"type":993,"tag":1058,"props":8667,"children":8668},{"style":1099},[8669],{"type":998,"value":1215},{"type":993,"tag":1058,"props":8671,"children":8672},{"style":1197},[8673],{"type":998,"value":1579},{"type":993,"tag":1058,"props":8675,"children":8676},{"style":1085},[8677],{"type":998,"value":1584},{"type":993,"tag":1058,"props":8679,"children":8680},{"style":1064},[8681],{"type":998,"value":7974},{"type":993,"tag":1001,"props":8683,"children":8684},{},[8685],{"type":993,"tag":1700,"props":8686,"children":8687},{},[8688],{"type":998,"value":8689},"Key Learning Points:",{"type":993,"tag":1706,"props":8691,"children":8692},{},[8693,8709,8724,8739,8750],{"type":993,"tag":1710,"props":8694,"children":8695},{},[8696,8698,8707],{"type":998,"value":8697},"📌 ",{"type":993,"tag":1700,"props":8699,"children":8700},{},[8701,8705],{"type":993,"tag":1700,"props":8702,"children":8703},{},[8704],{"type":998,"value":2342},{"type":998,"value":8706}," method",{"type":998,"value":8708},": Provides user-friendly string representation for print() and str()",{"type":993,"tag":1710,"props":8710,"children":8711},{},[8712,8713,8722],{"type":998,"value":8697},{"type":993,"tag":1700,"props":8714,"children":8715},{},[8716,8721],{"type":993,"tag":1700,"props":8717,"children":8718},{},[8719],{"type":998,"value":8720},"eq",{"type":998,"value":8706},{"type":998,"value":8723},": Enables equality comparison with == operator",{"type":993,"tag":1710,"props":8725,"children":8726},{},[8727,8728,8737],{"type":998,"value":8697},{"type":993,"tag":1700,"props":8729,"children":8730},{},[8731,8736],{"type":993,"tag":1700,"props":8732,"children":8733},{},[8734],{"type":998,"value":8735},"len",{"type":998,"value":8706},{"type":998,"value":8738},": Allows len() function to work with custom objects",{"type":993,"tag":1710,"props":8740,"children":8741},{},[8742,8743,8748],{"type":998,"value":8697},{"type":993,"tag":1700,"props":8744,"children":8745},{},[8746],{"type":998,"value":8747},"isinstance() check",{"type":998,"value":8749},": Ensures safe comparison with same object type",{"type":993,"tag":1710,"props":8751,"children":8752},{},[8753,8754,8759],{"type":998,"value":8697},{"type":993,"tag":1700,"props":8755,"children":8756},{},[8757],{"type":998,"value":8758},"Special method integration",{"type":998,"value":8760},": Python automatically calls these methods for operators",{"type":993,"tag":1001,"props":8762,"children":8763},{},[8764,8766,8772],{"type":998,"value":8765},"Learn more about ",{"type":993,"tag":8767,"props":8768,"children":8769},"a",{"href":745},[8770],{"type":998,"value":8771},"working with dates",{"type":998,"value":8773}," to handle time-based data in your applications.",{"type":993,"tag":1678,"props":8775,"children":8777},{"id":8776},"test-your-knowledge",[8778],{"type":998,"value":8779},"Test Your Knowledge",{"type":993,"tag":1001,"props":8781,"children":8782},{},[8783],{"type":998,"value":8784},"Test what you've learned about special methods:",{"type":993,"tag":8786,"props":8787,"children":8791},"redirect-button",{"icon":8788,"label":8789,"url":8790},"pi pi-send","Take Quiz","/tutorial-quiz/python/special-methods",[],{"type":993,"tag":1678,"props":8793,"children":8795},{"id":8794},"whats-next",[8796],{"type":998,"value":8797},"What's Next?",{"type":993,"tag":1001,"props":8799,"children":8800},{},[8801],{"type":998,"value":8802},"Now that you understand special methods, you're ready to explore advanced concepts that use these powerful techniques. Learn about working with dates, mathematical operations, and other sophisticated Python features.",{"type":993,"tag":1001,"props":8804,"children":8805},{},[8806,8808,8812],{"type":998,"value":8807},"Ready to continue? Check out our lesson on ",{"type":993,"tag":8767,"props":8809,"children":8810},{"href":735},[8811],{"type":998,"value":736},{"type":998,"value":8813},".",{"type":993,"tag":8815,"props":8816,"children":8817},"style",{},[8818],{"type":998,"value":8819},"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":8821},[8822,8829,8832,8835,8839,8842,8843],{"id":1680,"depth":27,"text":1683,"children":8823},[8824,8828],{"id":1933,"depth":36,"text":1936,"children":8825},[8826],{"id":1945,"depth":45,"text":8827},"__str__() and __repr__()",{"id":2474,"depth":36,"text":2477},{"id":3353,"depth":27,"text":3356,"children":8830},[8831],{"id":3364,"depth":36,"text":3367},{"id":4298,"depth":27,"text":4301,"children":8833},[8834],{"id":4309,"depth":36,"text":4312},{"id":5284,"depth":27,"text":5287,"children":8836},[8837,8838],{"id":5290,"depth":36,"text":5293},{"id":6234,"depth":36,"text":6237},{"id":6953,"depth":27,"text":6956,"children":8840},[8841],{"id":8030,"depth":36,"text":8033},{"id":8776,"depth":27,"text":8779},{"id":8794,"depth":27,"text":8797},1782373748013]