[{"data":1,"prerenderedAt":5589},["ShallowReactive",2],{"tutorials-python":3,"category-items-python":987,"content-/python/while-loops":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},"/python/python-lists","Python Lists","Learn about Python lists, one of the most important and versatile data structures for storing and organizing collections of data","python-lists",29,"content:python:29.python-lists.md","python/29.python-lists.md","python/29.python-lists",[279,288,297,306,315,324,333,342,351,360],{"_path":280,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":281,"description":282,"slug":283,"parentId":270,"order":284,"_type":15,"_id":285,"_source":17,"_file":286,"_stem":287,"_extension":20},"/python/creating-lists","Creating Lists","Learn different methods to create and initialize Python lists, from simple literals to advanced techniques","creating-lists",30,"content:python:30.creating-lists.md","python/30.creating-lists.md","python/30.creating-lists",{"_path":289,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":290,"description":291,"slug":292,"parentId":270,"order":293,"_type":15,"_id":294,"_source":17,"_file":295,"_stem":296,"_extension":20},"/python/reading-list-data","Reading List Data","Master techniques for accessing and retrieving data from Python lists using indexing, slicing, and built-in methods","reading-list-data",31,"content:python:31.reading-list-data.md","python/31.reading-list-data.md","python/31.reading-list-data",{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":270,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python/modifying-lists","Modifying Lists","Learn how to change, update, and modify existing elements in Python lists using indexing and various methods","modifying-lists",32,"content:python:32.modifying-lists.md","python/32.modifying-lists.md","python/32.modifying-lists",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":270,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python/adding-to-lists","Adding to Lists","Learn various methods to add elements to Python lists including append, insert, extend, and concatenation techniques","adding-to-lists",33,"content:python:33.adding-to-lists.md","python/33.adding-to-lists.md","python/33.adding-to-lists",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":270,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python/removing-from-lists","Removing from Lists","Learn different methods to remove and delete elements from Python lists including remove, pop, del, and clear","removing-from-lists",34,"content:python:34.removing-from-lists.md","python/34.removing-from-lists.md","python/34.removing-from-lists",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":270,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python/looping-through-lists","Looping Through Lists","Learn different ways to iterate through Python lists using for loops, while loops, enumerate, and other iteration techniques","looping-through-lists",35,"content:python:35.looping-through-lists.md","python/35.looping-through-lists.md","python/35.looping-through-lists",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":270,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python/list-shortcuts","List Shortcuts","Learn powerful Python list shortcuts including list comprehensions, slicing tricks, and built-in functions for efficient list operations","list-shortcuts",36,"content:python:36.list-shortcuts.md","python/36.list-shortcuts.md","python/36.list-shortcuts",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":270,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python/organizing-lists","Organizing Lists","Learn how to sort, reverse, and organize Python lists using built-in methods and custom sorting techniques","organizing-lists",37,"content:python:37.organizing-lists.md","python/37.organizing-lists.md","python/37.organizing-lists",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":270,"order":356,"_type":15,"_id":357,"_source":17,"_file":358,"_stem":359,"_extension":20},"/python/combining-lists","Combining Lists","Learn various techniques to combine, merge, and join Python lists including concatenation, zipping, and advanced merging strategies","combining-lists",38,"content:python:38.combining-lists.md","python/38.combining-lists.md","python/38.combining-lists",{"_path":361,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":362,"description":363,"slug":364,"parentId":270,"order":365,"_type":15,"_id":366,"_source":17,"_file":367,"_stem":368,"_extension":20},"/python/essential-list-tools","Essential List Tools","Master powerful built-in functions and advanced techniques for efficient Python list manipulation and data processing","essential-list-tools",39,"content:python:39.essential-list-tools.md","python/39.essential-list-tools.md","python/39.essential-list-tools",{"_path":370,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":371,"description":372,"slug":373,"order":374,"isParent":13,"icon":14,"_type":15,"_id":375,"_source":17,"_file":376,"_stem":377,"_extension":20,"children":378},"/python/python-tuples","Python Tuples","Master Python tuples - immutable sequences perfect for storing related data that shouldn't change. Learn creation, access, and manipulation techniques.","python-tuples",40,"content:python:40.python-tuples.md","python/40.python-tuples.md","python/40.python-tuples",[379,388,397,406,415,424,433],{"_path":380,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":381,"description":382,"slug":383,"parentId":370,"order":384,"_type":15,"_id":385,"_source":17,"_file":386,"_stem":387,"_extension":20},"/python/creating-tuples","Creating Tuples","Learn different ways to create Python tuples, from basic syntax to advanced techniques. Master tuple initialization and understand when to use tuples.","creating-tuples",41,"content:python:41.creating-tuples.md","python/41.creating-tuples.md","python/41.creating-tuples",{"_path":389,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":390,"description":391,"slug":392,"parentId":370,"order":393,"_type":15,"_id":394,"_source":17,"_file":395,"_stem":396,"_extension":20},"/python/reading-tuple-data","Reading Tuple Data","Master accessing tuple elements through indexing, slicing, and searching. Learn efficient patterns for reading and working with tuple data.","reading-tuple-data",42,"content:python:42.reading-tuple-data.md","python/42.reading-tuple-data.md","python/42.reading-tuple-data",{"_path":398,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":399,"description":400,"slug":401,"parentId":370,"order":402,"_type":15,"_id":403,"_source":17,"_file":404,"_stem":405,"_extension":20},"/python/changing-tuples","Changing Tuples","Understand tuple immutability and learn techniques for working with unchangeable data. Master creating modified tuple versions and handling immutable constraints.","changing-tuples",43,"content:python:43.changing-tuples.md","python/43.changing-tuples.md","python/43.changing-tuples",{"_path":407,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":408,"description":409,"slug":410,"parentId":370,"order":411,"_type":15,"_id":412,"_source":17,"_file":413,"_stem":414,"_extension":20},"/python/tuple-unpacking","Tuple Unpacking","Master tuple unpacking for elegant variable assignment, function returns, and data extraction. Learn Python's powerful unpacking syntax and patterns.","tuple-unpacking",44,"content:python:44.tuple-unpacking.md","python/44.tuple-unpacking.md","python/44.tuple-unpacking",{"_path":416,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":417,"description":418,"slug":419,"parentId":370,"order":420,"_type":15,"_id":421,"_source":17,"_file":422,"_stem":423,"_extension":20},"/python/iterating-tuples","Iterating Tuples","Master tuple iteration techniques for processing sequence data. Learn basic loops, enumerate, nested iteration, and advanced patterns for efficient data processing.","iterating-tuples",45,"content:python:45.iterating-tuples.md","python/45.iterating-tuples.md","python/45.iterating-tuples",{"_path":425,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":426,"description":427,"slug":428,"parentId":370,"order":429,"_type":15,"_id":430,"_source":17,"_file":431,"_stem":432,"_extension":20},"/python/merging-tuples","Merging Tuples","Learn techniques for combining and merging tuples to create larger data structures. Master concatenation, joining multiple tuples, and advanced merging patterns.","merging-tuples",46,"content:python:46.merging-tuples.md","python/46.merging-tuples.md","python/46.merging-tuples",{"_path":434,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":435,"description":436,"slug":437,"parentId":370,"order":438,"_type":15,"_id":439,"_source":17,"_file":440,"_stem":441,"_extension":20},"/python/tuple-operations","Tuple Operations","Master comprehensive tuple operations including built-in functions, mathematical operations, comparisons, and advanced techniques for efficient tuple manipulation.","tuple-operations",47,"content:python:47.tuple-operations.md","python/47.tuple-operations.md","python/47.tuple-operations",{"_path":443,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":444,"description":445,"slug":446,"order":447,"isParent":13,"icon":14,"_type":15,"_id":448,"_source":17,"_file":449,"_stem":450,"_extension":20,"children":451},"/python/python-sets","Python Sets","Discover Python sets - unique collections that automatically eliminate duplicates and provide powerful mathematical operations for data filtering and analysis.","python-sets",48,"content:python:48.python-sets.md","python/48.python-sets.md","python/48.python-sets",[452,461,470,479,488,497,506],{"_path":453,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":454,"description":455,"slug":456,"parentId":443,"order":457,"_type":15,"_id":458,"_source":17,"_file":459,"_stem":460,"_extension":20},"/python/creating-sets","Creating Sets","Learn multiple ways to create sets in Python including literal syntax, set() function, and set comprehensions. Master set creation from different data sources.","creating-sets",49,"content:python:49.creating-sets.md","python/49.creating-sets.md","python/49.creating-sets",{"_path":462,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":463,"description":464,"slug":465,"parentId":443,"order":466,"_type":15,"_id":467,"_source":17,"_file":468,"_stem":469,"_extension":20},"/python/reading-set-data","Reading Set Data","Learn how to access and examine set data in Python including membership testing, iteration, size checking, and converting sets to other data types.","reading-set-data",50,"content:python:50.reading-set-data.md","python/50.reading-set-data.md","python/50.reading-set-data",{"_path":471,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":472,"description":473,"slug":474,"parentId":443,"order":475,"_type":15,"_id":476,"_source":17,"_file":477,"_stem":478,"_extension":20},"/python/adding-to-sets","Adding to Sets","Learn how to add elements to sets in Python using add(), update(), and union operations. Master growing sets dynamically with single items and multiple elements.","adding-to-sets",51,"content:python:51.adding-to-sets.md","python/51.adding-to-sets.md","python/51.adding-to-sets",{"_path":480,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":481,"description":482,"slug":483,"parentId":443,"order":484,"_type":15,"_id":485,"_source":17,"_file":486,"_stem":487,"_extension":20},"/python/removing-from-sets","Removing from Sets","Learn how to remove elements from Python sets using different methods like remove(), discard(), pop(), and clear()","removing-from-sets",52,"content:python:52.removing-from-sets.md","python/52.removing-from-sets.md","python/52.removing-from-sets",{"_path":489,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":490,"description":491,"slug":492,"parentId":443,"order":493,"_type":15,"_id":494,"_source":17,"_file":495,"_stem":496,"_extension":20},"/python/iterating-sets","Iterating Sets","Learn different ways to iterate through Python sets using for loops, comprehensions, and built-in functions","iterating-sets",53,"content:python:53.iterating-sets.md","python/53.iterating-sets.md","python/53.iterating-sets",{"_path":498,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":499,"description":500,"slug":501,"parentId":443,"order":502,"_type":15,"_id":503,"_source":17,"_file":504,"_stem":505,"_extension":20},"/python/combining-sets","Combining Sets","Learn how to combine Python sets using union, intersection, difference, and other set operations","combining-sets",54,"content:python:54.combining-sets.md","python/54.combining-sets.md","python/54.combining-sets",{"_path":507,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":508,"description":509,"slug":510,"parentId":443,"order":511,"_type":15,"_id":512,"_source":17,"_file":513,"_stem":514,"_extension":20},"/python/set-operations","Set Operations","Learn advanced Python set operations including comparisons, subsets, supersets, and mathematical set relationships","set-operations",55,"content:python:55.set-operations.md","python/55.set-operations.md","python/55.set-operations",{"_path":516,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":517,"description":518,"slug":519,"order":520,"isParent":13,"icon":14,"_type":15,"_id":521,"_source":17,"_file":522,"_stem":523,"_extension":20,"children":524},"/python/python-dictionaries","Python Dictionaries","Learn about Python dictionaries - key-value data structures for storing and organizing related information","python-dictionaries",56,"content:python:56.python-dictionaries.md","python/56.python-dictionaries.md","python/56.python-dictionaries",[525,534,543,552,561,570,579,588,597],{"_path":526,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":527,"description":528,"slug":529,"parentId":516,"order":530,"_type":15,"_id":531,"_source":17,"_file":532,"_stem":533,"_extension":20},"/python/creating-dictionaries","Creating Dictionaries","Learn different methods to create Python dictionaries using literals, constructors, and comprehensions","creating-dictionaries",57,"content:python:57.creating-dictionaries.md","python/57.creating-dictionaries.md","python/57.creating-dictionaries",{"_path":535,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":536,"description":537,"slug":538,"parentId":516,"order":539,"_type":15,"_id":540,"_source":17,"_file":541,"_stem":542,"_extension":20},"/python/getting-dictionary-values","Getting Dictionary Values","Learn safe and efficient methods to retrieve data from Python dictionaries using various access techniques","getting-dictionary-values",58,"content:python:58.getting-dictionary-values.md","python/58.getting-dictionary-values.md","python/58.getting-dictionary-values",{"_path":544,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":545,"description":546,"slug":547,"parentId":516,"order":548,"_type":15,"_id":549,"_source":17,"_file":550,"_stem":551,"_extension":20},"/python/updating-dictionaries","Updating Dictionaries","Learn how to modify and maintain Python dictionary data using various update methods and techniques","updating-dictionaries",59,"content:python:59.updating-dictionaries.md","python/59.updating-dictionaries.md","python/59.updating-dictionaries",{"_path":553,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":554,"description":555,"slug":556,"parentId":516,"order":557,"_type":15,"_id":558,"_source":17,"_file":559,"_stem":560,"_extension":20},"/python/adding-dictionary-items","Adding Dictionary Items","Learn effective techniques for adding new items to Python dictionaries with various methods and best practices","adding-dictionary-items",60,"content:python:60.adding-dictionary-items.md","python/60.adding-dictionary-items.md","python/60.adding-dictionary-items",{"_path":562,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":563,"description":564,"slug":565,"parentId":516,"order":566,"_type":15,"_id":567,"_source":17,"_file":568,"_stem":569,"_extension":20},"/python/deleting-dictionary-items","Deleting Dictionary Items","Master safe and efficient techniques for removing items from Python dictionaries with various methods and error handling","deleting-dictionary-items",61,"content:python:61.deleting-dictionary-items.md","python/61.deleting-dictionary-items.md","python/61.deleting-dictionary-items",{"_path":571,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":572,"description":573,"slug":574,"parentId":516,"order":575,"_type":15,"_id":576,"_source":17,"_file":577,"_stem":578,"_extension":20},"/python/looping-dictionaries","Looping Dictionaries","Learn efficient techniques for iterating through Python dictionaries using keys, values, and items","looping-dictionaries",62,"content:python:62.looping-dictionaries.md","python/62.looping-dictionaries.md","python/62.looping-dictionaries",{"_path":580,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":581,"description":582,"slug":583,"parentId":516,"order":584,"_type":15,"_id":585,"_source":17,"_file":586,"_stem":587,"_extension":20},"/python/dictionary-copies","Dictionary Copies","Learn safe techniques for duplicating Python dictionaries using shallow and deep copy methods","dictionary-copies",63,"content:python:63.dictionary-copies.md","python/63.dictionary-copies.md","python/63.dictionary-copies",{"_path":589,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":590,"description":591,"slug":592,"parentId":516,"order":593,"_type":15,"_id":594,"_source":17,"_file":595,"_stem":596,"_extension":20},"/python/multi-level-dictionaries","Multi-level Dictionaries","Master working with nested Python dictionaries for complex data structures and hierarchical information","multi-level-dictionaries",64,"content:python:64.multi-level-dictionaries.md","python/64.multi-level-dictionaries.md","python/64.multi-level-dictionaries",{"_path":598,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":599,"description":600,"slug":601,"parentId":516,"order":602,"_type":15,"_id":603,"_source":17,"_file":604,"_stem":605,"_extension":20},"/python/dictionary-tools","Dictionary Tools","Explore powerful built-in functions and advanced techniques for efficient Python dictionary manipulation and analysis","dictionary-tools",65,"content:python:65.dictionary-tools.md","python/65.dictionary-tools.md","python/65.dictionary-tools",{"_path":607,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":608,"description":609,"slug":610,"order":611,"isParent":13,"icon":14,"_type":15,"_id":612,"_source":17,"_file":613,"_stem":614,"_extension":20,"children":615},"/python/python-functions","Python Functions","Learn how to create and use Python functions to organize code into reusable, modular components that make programs more efficient and maintainable","python-functions",66,"content:python:66.python-functions.md","python/66.python-functions.md","python/66.python-functions",[616,625,634,643,652,661],{"_path":617,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":618,"description":619,"slug":620,"parentId":607,"order":621,"_type":15,"_id":622,"_source":17,"_file":623,"_stem":624,"_extension":20},"/python/function-basics","Function Basics","Learn the fundamentals of creating and using Python functions to organize code into reusable, modular components","function-basics",67,"content:python:67.function-basics.md","python/67.function-basics.md","python/67.function-basics",{"_path":626,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":627,"description":628,"slug":629,"parentId":607,"order":630,"_type":15,"_id":631,"_source":17,"_file":632,"_stem":633,"_extension":20},"/python/function-parameters","Function Parameters","Master different types of Python function parameters including positional, keyword, default, and variable-length arguments","function-parameters",68,"content:python:68.function-parameters.md","python/68.function-parameters.md","python/68.function-parameters",{"_path":635,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":636,"description":637,"slug":638,"parentId":607,"order":639,"_type":15,"_id":640,"_source":17,"_file":641,"_stem":642,"_extension":20},"/python/returning-values","Returning Values","Learn different ways Python functions return data including single values, multiple values, and conditional returns","returning-values",69,"content:python:69.returning-values.md","python/69.returning-values.md","python/69.returning-values",{"_path":644,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":645,"description":646,"slug":647,"parentId":607,"order":648,"_type":15,"_id":649,"_source":17,"_file":650,"_stem":651,"_extension":20},"/python/variable-scope","Variable Scope","Understand Python variable scope including local, global, and nonlocal variables and how they affect function behavior","variable-scope",70,"content:python:70.variable-scope.md","python/70.variable-scope.md","python/70.variable-scope",{"_path":653,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":654,"description":655,"slug":656,"parentId":607,"order":657,"_type":15,"_id":658,"_source":17,"_file":659,"_stem":660,"_extension":20},"/python/anonymous-functions","Anonymous Functions","Learn to create and use Python lambda functions for concise, inline function definitions and functional programming patterns","anonymous-functions",71,"content:python:71.anonymous-functions.md","python/71.anonymous-functions.md","python/71.anonymous-functions",{"_path":662,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":663,"description":664,"slug":665,"parentId":607,"order":666,"_type":15,"_id":667,"_source":17,"_file":668,"_stem":669,"_extension":20},"/python/function-recursion","Function Recursion","Master recursive functions in Python by learning how functions can call themselves to solve complex problems with elegant, mathematical solutions","function-recursion",72,"content:python:72.function-recursion.md","python/72.function-recursion.md","python/72.function-recursion",{"_path":671,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":672,"description":673,"slug":674,"order":675,"isParent":13,"icon":14,"_type":15,"_id":676,"_source":17,"_file":677,"_stem":678,"_extension":20,"children":679},"/python/object-programming","Object Programming","Learn object-oriented programming (OOP) in Python - create classes, objects, and methods to build organized, reusable code","object-programming",73,"content:python:73.object-programming.md","python/73.object-programming.md","python/73.object-programming",[680,689,698,707,716,725],{"_path":681,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":682,"description":683,"slug":684,"parentId":671,"order":685,"_type":15,"_id":686,"_source":17,"_file":687,"_stem":688,"_extension":20},"/python/classes-and-objects","Classes and Objects","Learn to create Python classes and objects - the foundation of object-oriented programming for building reusable, organized code","classes-and-objects",74,"content:python:74.classes-and-objects.md","python/74.classes-and-objects.md","python/74.classes-and-objects",{"_path":690,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":691,"description":692,"slug":693,"parentId":671,"order":694,"_type":15,"_id":695,"_source":17,"_file":696,"_stem":697,"_extension":20},"/python/object-methods","Object Methods","Master object methods in Python - learn to define behaviors, work with parameters, and create interactive objects that respond to actions","object-methods",75,"content:python:75.object-methods.md","python/75.object-methods.md","python/75.object-methods",{"_path":699,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":700,"description":701,"slug":702,"parentId":671,"order":703,"_type":15,"_id":704,"_source":17,"_file":705,"_stem":706,"_extension":20},"/python/class-inheritance","Class Inheritance","Learn Python class inheritance - create specialized classes that build upon existing functionality while adding new features and behaviors","class-inheritance",76,"content:python:76.class-inheritance.md","python/76.class-inheritance.md","python/76.class-inheritance",{"_path":708,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":709,"description":710,"slug":711,"parentId":671,"order":712,"_type":15,"_id":713,"_source":17,"_file":714,"_stem":715,"_extension":20},"/python/method-overriding","Method Overriding","Master method overriding in Python - learn to customize inherited methods, use super(), and create specialized behaviors while maintaining inheritance benefits","method-overriding",77,"content:python:77.method-overriding.md","python/77.method-overriding.md","python/77.method-overriding",{"_path":717,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":718,"description":719,"slug":720,"parentId":671,"order":721,"_type":15,"_id":722,"_source":17,"_file":723,"_stem":724,"_extension":20},"/python/variable-visibility","Variable Visibility","Master Python variable visibility - learn public, protected, and private attributes to control access and create well-encapsulated classes","variable-visibility",78,"content:python:78.variable-visibility.md","python/78.variable-visibility.md","python/78.variable-visibility",{"_path":726,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":727,"description":728,"slug":729,"parentId":671,"order":730,"_type":15,"_id":731,"_source":17,"_file":732,"_stem":733,"_extension":20},"/python/special-methods","Special Methods","Master Python special methods (magic methods) - learn to implement __str__, __len__, __eq__ and more to make your classes work seamlessly with Python's built-in functions","special-methods",79,"content:python:79.special-methods.md","python/79.special-methods.md","python/79.special-methods",{"_path":735,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":736,"description":737,"slug":738,"order":739,"isParent":13,"icon":14,"_type":15,"_id":740,"_source":17,"_file":741,"_stem":742,"_extension":20,"children":743},"/python/advanced-concepts","Advanced Concepts","Master advanced Python programming concepts - work with dates, mathematics, JSON data, pattern matching, and more sophisticated programming techniques","advanced-concepts",80,"content:python:80.advanced-concepts.md","python/80.advanced-concepts.md","python/80.advanced-concepts",[744,753,762,771,780,789,798],{"_path":745,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":746,"description":747,"slug":748,"parentId":735,"order":749,"_type":15,"_id":750,"_source":17,"_file":751,"_stem":752,"_extension":20},"/python/working-with-dates","Working with Dates","Master Python date and time handling - work with datetime objects, format dates, calculate durations, and build time-aware applications","working-with-dates",81,"content:python:81.working-with-dates.md","python/81.working-with-dates.md","python/81.working-with-dates",{"_path":754,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":755,"description":756,"slug":757,"parentId":735,"order":758,"_type":15,"_id":759,"_source":17,"_file":760,"_stem":761,"_extension":20},"/python/mathematical-operations","Mathematical Operations","Master Python mathematical computing - use math functions, perform statistical calculations, and implement scientific computing for data analysis and problem-solving","mathematical-operations",82,"content:python:82.mathematical-operations.md","python/82.mathematical-operations.md","python/82.mathematical-operations",{"_path":763,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":764,"description":765,"slug":766,"parentId":735,"order":767,"_type":15,"_id":768,"_source":17,"_file":769,"_stem":770,"_extension":20},"/python/json-data","JSON Data","Master JSON data handling in Python - serialize and deserialize data, work with APIs, manage configuration files, and exchange data between applications","json-data",83,"content:python:83.json-data.md","python/83.json-data.md","python/83.json-data",{"_path":772,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":773,"description":774,"slug":775,"parentId":735,"order":776,"_type":15,"_id":777,"_source":17,"_file":778,"_stem":779,"_extension":20},"/python/package-management","Package Management","Master Python package management with pip and virtual environments - install libraries, manage dependencies, create isolated environments, and distribute packages professionally","package-management",85,"content:python:85.package-management.md","python/85.package-management.md","python/85.package-management",{"_path":781,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":782,"description":783,"slug":784,"parentId":735,"order":785,"_type":15,"_id":786,"_source":17,"_file":787,"_stem":788,"_extension":20},"/python/error-handling","Error Handling","Master Python error handling with try/except blocks, exception types, custom exceptions, debugging techniques, and best practices for robust application development","error-handling",86,"content:python:86.error-handling.md","python/86.error-handling.md","python/86.error-handling",{"_path":790,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":791,"description":792,"slug":793,"parentId":735,"order":794,"_type":15,"_id":795,"_source":17,"_file":796,"_stem":797,"_extension":20},"/python/getting-user-input","Getting User Input","Master user input handling in Python with input validation, data type conversion, interactive programs, and command-line interfaces for engaging user experiences","getting-user-input",87,"content:python:87.getting-user-input.md","python/87.getting-user-input.md","python/87.getting-user-input",{"_path":799,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":800,"description":801,"slug":802,"parentId":735,"order":803,"_type":15,"_id":804,"_source":17,"_file":805,"_stem":806,"_extension":20},"/python/text-formatting","Text Formatting","Master Python text formatting with f-strings, format methods, alignment, number formatting, and advanced techniques for professional, readable output","text-formatting",88,"content:python:88.text-formatting.md","python/88.text-formatting.md","python/88.text-formatting",{"_path":808,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":809,"description":810,"slug":811,"order":812,"isParent":13,"icon":14,"_type":15,"_id":813,"_source":17,"_file":814,"_stem":815,"_extension":20,"children":816},"/python/file-operations","File Operations","Master Python file handling with reading, writing, and managing files for data persistence and real-world applications","file-operations",89,"content:python:89.file-operations.md","python/89.file-operations.md","python/89.file-operations",[817,826,835,844],{"_path":818,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":819,"description":820,"slug":821,"parentId":808,"order":822,"_type":15,"_id":823,"_source":17,"_file":824,"_stem":825,"_extension":20},"/python/file-basics","File Basics","Learn fundamental Python file operations including opening files, understanding file modes, using context managers, and basic file handling concepts","file-basics",90,"content:python:90.file-basics.md","python/90.file-basics.md","python/90.file-basics",{"_path":827,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":828,"description":829,"slug":830,"parentId":808,"order":831,"_type":15,"_id":832,"_source":17,"_file":833,"_stem":834,"_extension":20},"/python/reading-files","Reading Files","Master Python file reading techniques including reading entire files, line-by-line processing, and handling different file formats for efficient data processing","reading-files",91,"content:python:91.reading-files.md","python/91.reading-files.md","python/91.reading-files",{"_path":836,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":837,"description":838,"slug":839,"parentId":808,"order":840,"_type":15,"_id":841,"_source":17,"_file":842,"_stem":843,"_extension":20},"/python/writing-files","Writing Files","Learn Python file writing techniques including creating new files, appending content, updating existing files, and saving different data formats safely","writing-files",92,"content:python:92.writing-files.md","python/92.writing-files.md","python/92.writing-files",{"_path":845,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":846,"description":847,"slug":848,"parentId":808,"order":849,"_type":15,"_id":850,"_source":17,"_file":851,"_stem":852,"_extension":20},"/python/file-management","File Management","Learn Python file management techniques including checking file properties, organizing files, directory operations, and implementing file system maintenance tasks","file-management",93,"content:python:93.file-management.md","python/93.file-management.md","python/93.file-management",{"_path":854,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":855,"description":856,"slug":857,"order":858,"isParent":13,"icon":14,"_type":15,"_id":859,"_source":17,"_file":860,"_stem":861,"_extension":20,"children":862},"/python/code-organization","Code Organization","Master Python code organization with modules, built-in libraries, and path management for creating maintainable and reusable applications","code-organization",94,"content:python:94.code-organization.md","python/94.code-organization.md","python/94.code-organization",[863,872,881],{"_path":864,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":865,"description":866,"slug":867,"parentId":854,"order":868,"_type":15,"_id":869,"_source":17,"_file":870,"_stem":871,"_extension":20},"/python/creating-modules","Creating Modules","Learn how to create custom Python modules, organize functions and classes, write reusable code components, and design effective module structures","creating-modules",95,"content:python:95.creating-modules.md","python/95.creating-modules.md","python/95.creating-modules",{"_path":873,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":874,"description":875,"slug":876,"parentId":854,"order":877,"_type":15,"_id":878,"_source":17,"_file":879,"_stem":880,"_extension":20},"/python/using-built-in-modules","Using Built-in Modules","Discover Python's extensive standard library and learn to effectively use built-in modules for common programming tasks, data processing, and system operations","using-built-in-modules",96,"content:python:96.using-built-in-modules.md","python/96.using-built-in-modules.md","python/96.using-built-in-modules",{"_path":882,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":883,"description":884,"slug":885,"parentId":854,"order":886,"_type":15,"_id":887,"_source":17,"_file":888,"_stem":889,"_extension":20},"/python/module-paths","Module Paths","Understand Python's module search system, manage import paths, work with packages, and organize larger projects with proper module path management","module-paths",97,"content:python:97.module-paths.md","python/97.module-paths.md","python/97.module-paths",{"_path":891,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":892,"description":893,"slug":894,"order":895,"isParent":13,"icon":14,"_type":15,"_id":896,"_source":17,"_file":897,"_stem":898,"_extension":20,"children":899,"expanded":13},"/python/reference-materials","Reference Materials","Comprehensive Python reference materials including reserved words, built-in functions, and operation guides for quick lookup and development support","reference-materials",98,"content:python:98.reference-materials.md","python/98.reference-materials.md","python/98.reference-materials",[900,909,918,927,936,945,953,961,970],{"_path":901,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":902,"description":903,"slug":904,"parentId":891,"order":905,"_type":15,"_id":906,"_source":17,"_file":907,"_stem":908,"_extension":20},"/python/reserved-words","Reserved Words","Complete reference of Python keywords and reserved words with descriptions, usage examples, and syntax guidelines","reserved-words",99,"content:python:99.reserved-words.md","python/99.reserved-words.md","python/99.reserved-words",{"_path":910,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":911,"description":912,"slug":913,"parentId":891,"order":914,"_type":15,"_id":915,"_source":17,"_file":916,"_stem":917,"_extension":20},"/python/built-in-functions","Built-in Functions","Comprehensive reference of Python's built-in functions with parameters, return values, and practical usage examples","built-in-functions",100,"content:python:100.built-in-functions.md","python/100.built-in-functions.md","python/100.built-in-functions",{"_path":919,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":920,"description":921,"slug":922,"parentId":891,"order":923,"_type":15,"_id":924,"_source":17,"_file":925,"_stem":926,"_extension":20},"/python/string-operations","String Operations","Complete reference of Python string methods, operations, and formatting techniques with examples and use cases","string-operations",101,"content:python:101.string-operations.md","python/101.string-operations.md","python/101.string-operations",{"_path":928,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":929,"description":930,"slug":931,"parentId":891,"order":932,"_type":15,"_id":933,"_source":17,"_file":934,"_stem":935,"_extension":20},"/python/list-operations","List Operations","Complete reference of Python list methods, operations, and manipulation techniques with examples and performance notes","list-operations",102,"content:python:102.list-operations.md","python/102.list-operations.md","python/102.list-operations",{"_path":937,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":938,"description":939,"slug":940,"parentId":891,"order":941,"_type":15,"_id":942,"_source":17,"_file":943,"_stem":944,"_extension":20},"/python/dictionary-operations","Dictionary Operations","Complete reference of Python dictionary methods, operations, and manipulation techniques with examples and use cases","dictionary-operations",103,"content:python:103.dictionary-operations.md","python/103.dictionary-operations.md","python/103.dictionary-operations",{"_path":946,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":435,"description":947,"slug":948,"parentId":891,"order":949,"_type":15,"_id":950,"_source":17,"_file":951,"_stem":952,"_extension":20},"/python/tuple-methods","Complete reference of Python tuple operations, methods, and techniques with examples and use cases","tuple-methods",104,"content:python:104.tuple-methods.md","python/104.tuple-methods.md","python/104.tuple-methods",{"_path":954,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":508,"description":955,"slug":956,"parentId":891,"order":957,"_type":15,"_id":958,"_source":17,"_file":959,"_stem":960,"_extension":20},"/python/set-methods","Complete reference of Python set operations, methods, and mathematical set operations with examples and use cases","set-methods",105,"content:python:105.set-methods.md","python/105.set-methods.md","python/105.set-methods",{"_path":962,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":963,"description":964,"slug":965,"parentId":891,"order":966,"_type":15,"_id":967,"_source":17,"_file":968,"_stem":969,"_extension":20},"/python/file-operations-reference","File Operations Reference","Complete reference of Python file operations, modes, methods, and file handling techniques with examples","file-operations-reference",106,"content:python:106.file-operations-reference.md","python/106.file-operations-reference.md","python/106.file-operations-reference",{"_path":971,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":972,"description":973,"slug":974,"parentId":891,"order":975,"_type":15,"_id":976,"_source":17,"_file":977,"_stem":978,"_extension":20},"/python/error-types","Error Types","Complete reference of Python exception types, error handling patterns, and debugging techniques with examples","error-types",107,"content:python:107.error-types.md","python/107.error-types.md","python/107.error-types",{"_path":980,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":981,"description":10,"slug":982,"order":983,"icon":14,"_type":15,"_id":984,"_source":17,"_file":985,"_stem":986,"_extension":20},"/python","Introduction","python-tutorial",0,"content:python:index.md","python/index.md","python/index",[233],{"_path":234,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":235,"description":236,"slug":237,"parentId":224,"order":238,"body":989,"_type":15,"_id":239,"_source":17,"_file":240,"_stem":241,"_extension":20},{"type":990,"children":991,"toc":5575},"root",[992,1000,1006,1022,1197,1204,1216,1360,1365,1509,1515,1520,1684,1689,2280,2285,2291,2296,2387,2394,2626,2632,2637,2765,2770,3496,3502,3507,3665,4445,4451,4472,4611,4626,5041,5047,5052,5229,5235,5440,5446,5451,5458,5464,5469,5502,5536,5569],{"type":993,"tag":994,"props":995,"children":996},"element","h1",{"id":237},[997],{"type":998,"value":999},"text","🔄 While Loops",{"type":993,"tag":1001,"props":1002,"children":1003},"p",{},[1004],{"type":998,"value":1005},"While loops are Python's most fundamental looping construct. They repeat a block of code as long as a specified condition remains true. Think of while loops as \"keep doing this until something changes\" - they're perfect for situations where you don't know exactly how many times you need to repeat an action.",{"type":993,"tag":1001,"props":1007,"children":1008},{},[1009,1011,1020],{"type":998,"value":1010},"While loops are essential for user input validation, waiting for events, processing data until a condition is met, and creating interactive programs that respond to changing conditions using ",{"type":993,"tag":1012,"props":1013,"children":1014},"strong",{},[1015],{"type":993,"tag":1016,"props":1017,"children":1018},"a",{"href":187},[1019],{"type":998,"value":190},{"type":998,"value":1021}," concepts.",{"type":993,"tag":1023,"props":1024,"children":1025},"code-try",{},[1026],{"type":993,"tag":1027,"props":1028,"children":1031},"pre",{"className":1029,"code":1030,"language":6,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Basic while loop\ncount = 1\nwhile count \u003C= 5:\n    print(f\"Count: {count}\")\n    count += 1  # Important: update the condition variable\n\nprint(\"Loop finished!\")\n",[1032],{"type":993,"tag":1033,"props":1034,"children":1035},"code",{"__ignoreMap":8},[1036,1047,1068,1096,1145,1168,1176],{"type":993,"tag":1037,"props":1038,"children":1040},"span",{"class":1039,"line":12},"line",[1041],{"type":993,"tag":1037,"props":1042,"children":1044},{"style":1043},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[1045],{"type":998,"value":1046},"# Basic while loop\n",{"type":993,"tag":1037,"props":1048,"children":1049},{"class":1039,"line":27},[1050,1056,1062],{"type":993,"tag":1037,"props":1051,"children":1053},{"style":1052},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[1054],{"type":998,"value":1055},"count ",{"type":993,"tag":1037,"props":1057,"children":1059},{"style":1058},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[1060],{"type":998,"value":1061},"=",{"type":993,"tag":1037,"props":1063,"children":1065},{"style":1064},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[1066],{"type":998,"value":1067}," 1\n",{"type":993,"tag":1037,"props":1069,"children":1070},{"class":1039,"line":36},[1071,1076,1081,1086,1091],{"type":993,"tag":1037,"props":1072,"children":1073},{"style":1058},[1074],{"type":998,"value":1075},"while",{"type":993,"tag":1037,"props":1077,"children":1078},{"style":1052},[1079],{"type":998,"value":1080}," count ",{"type":993,"tag":1037,"props":1082,"children":1083},{"style":1058},[1084],{"type":998,"value":1085},"\u003C=",{"type":993,"tag":1037,"props":1087,"children":1088},{"style":1064},[1089],{"type":998,"value":1090}," 5",{"type":993,"tag":1037,"props":1092,"children":1093},{"style":1052},[1094],{"type":998,"value":1095},":\n",{"type":993,"tag":1037,"props":1097,"children":1098},{"class":1039,"line":45},[1099,1104,1109,1114,1120,1125,1130,1135,1140],{"type":993,"tag":1037,"props":1100,"children":1101},{"style":1064},[1102],{"type":998,"value":1103},"    print",{"type":993,"tag":1037,"props":1105,"children":1106},{"style":1052},[1107],{"type":998,"value":1108},"(",{"type":993,"tag":1037,"props":1110,"children":1111},{"style":1058},[1112],{"type":998,"value":1113},"f",{"type":993,"tag":1037,"props":1115,"children":1117},{"style":1116},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[1118],{"type":998,"value":1119},"\"Count: ",{"type":993,"tag":1037,"props":1121,"children":1122},{"style":1064},[1123],{"type":998,"value":1124},"{",{"type":993,"tag":1037,"props":1126,"children":1127},{"style":1052},[1128],{"type":998,"value":1129},"count",{"type":993,"tag":1037,"props":1131,"children":1132},{"style":1064},[1133],{"type":998,"value":1134},"}",{"type":993,"tag":1037,"props":1136,"children":1137},{"style":1116},[1138],{"type":998,"value":1139},"\"",{"type":993,"tag":1037,"props":1141,"children":1142},{"style":1052},[1143],{"type":998,"value":1144},")\n",{"type":993,"tag":1037,"props":1146,"children":1147},{"class":1039,"line":54},[1148,1153,1158,1163],{"type":993,"tag":1037,"props":1149,"children":1150},{"style":1052},[1151],{"type":998,"value":1152},"    count ",{"type":993,"tag":1037,"props":1154,"children":1155},{"style":1058},[1156],{"type":998,"value":1157},"+=",{"type":993,"tag":1037,"props":1159,"children":1160},{"style":1064},[1161],{"type":998,"value":1162}," 1",{"type":993,"tag":1037,"props":1164,"children":1165},{"style":1043},[1166],{"type":998,"value":1167},"  # Important: update the condition variable\n",{"type":993,"tag":1037,"props":1169,"children":1170},{"class":1039,"line":63},[1171],{"type":993,"tag":1037,"props":1172,"children":1173},{"emptyLinePlaceholder":13},[1174],{"type":998,"value":1175},"\n",{"type":993,"tag":1037,"props":1177,"children":1178},{"class":1039,"line":72},[1179,1184,1188,1193],{"type":993,"tag":1037,"props":1180,"children":1181},{"style":1064},[1182],{"type":998,"value":1183},"print",{"type":993,"tag":1037,"props":1185,"children":1186},{"style":1052},[1187],{"type":998,"value":1108},{"type":993,"tag":1037,"props":1189,"children":1190},{"style":1116},[1191],{"type":998,"value":1192},"\"Loop finished!\"",{"type":993,"tag":1037,"props":1194,"children":1195},{"style":1052},[1196],{"type":998,"value":1144},{"type":993,"tag":1198,"props":1199,"children":1201},"h2",{"id":1200},"basic-while-loop-syntax",[1202],{"type":998,"value":1203},"📝 Basic While Loop Syntax",{"type":993,"tag":1001,"props":1205,"children":1206},{},[1207,1209,1214],{"type":998,"value":1208},"A while loop consists of the ",{"type":993,"tag":1033,"props":1210,"children":1212},{"className":1211},[],[1213],{"type":998,"value":1075},{"type":998,"value":1215}," keyword, followed by a condition, a colon, and an indented code block. The condition is checked before each iteration, and the loop continues as long as the condition evaluates to True.",{"type":993,"tag":1217,"props":1218,"children":1222},"info-box",{"emoji":1219,"title":1220,"type":1221},"📝","While Loop Fundamentals","warning",[1223,1231,1289,1297,1340,1350],{"type":993,"tag":1001,"props":1224,"children":1225},{},[1226],{"type":993,"tag":1012,"props":1227,"children":1228},{},[1229],{"type":998,"value":1230},"Essential Components:",{"type":993,"tag":1232,"props":1233,"children":1234},"ul",{},[1235,1251,1269,1279],{"type":993,"tag":1236,"props":1237,"children":1238},"li",{},[1239,1249],{"type":993,"tag":1012,"props":1240,"children":1241},{},[1242,1247],{"type":993,"tag":1033,"props":1243,"children":1245},{"className":1244},[],[1246],{"type":998,"value":1075},{"type":998,"value":1248}," keyword",{"type":998,"value":1250}," followed by boolean condition",{"type":993,"tag":1236,"props":1252,"children":1253},{},[1254,1267],{"type":993,"tag":1012,"props":1255,"children":1256},{},[1257,1259,1265],{"type":998,"value":1258},"Colon (",{"type":993,"tag":1033,"props":1260,"children":1262},{"className":1261},[],[1263],{"type":998,"value":1264},":",{"type":998,"value":1266},")",{"type":998,"value":1268}," after the condition",{"type":993,"tag":1236,"props":1270,"children":1271},{},[1272,1277],{"type":993,"tag":1012,"props":1273,"children":1274},{},[1275],{"type":998,"value":1276},"Indented code block",{"type":998,"value":1278}," for loop body",{"type":993,"tag":1236,"props":1280,"children":1281},{},[1282,1287],{"type":993,"tag":1012,"props":1283,"children":1284},{},[1285],{"type":998,"value":1286},"Condition checked",{"type":998,"value":1288}," before each iteration",{"type":993,"tag":1001,"props":1290,"children":1291},{},[1292],{"type":993,"tag":1012,"props":1293,"children":1294},{},[1295],{"type":998,"value":1296},"Critical Requirements:",{"type":993,"tag":1232,"props":1298,"children":1299},{},[1300,1310,1320,1330],{"type":993,"tag":1236,"props":1301,"children":1302},{},[1303,1305],{"type":998,"value":1304},"Condition must ",{"type":993,"tag":1012,"props":1306,"children":1307},{},[1308],{"type":998,"value":1309},"eventually become False",{"type":993,"tag":1236,"props":1311,"children":1312},{},[1313,1315],{"type":998,"value":1314},"Loop variables must be ",{"type":993,"tag":1012,"props":1316,"children":1317},{},[1318],{"type":998,"value":1319},"updated inside the loop",{"type":993,"tag":1236,"props":1321,"children":1322},{},[1323,1325],{"type":998,"value":1324},"Failure to update creates ",{"type":993,"tag":1012,"props":1326,"children":1327},{},[1328],{"type":998,"value":1329},"infinite loops",{"type":993,"tag":1236,"props":1331,"children":1332},{},[1333,1338],{"type":993,"tag":1012,"props":1334,"children":1335},{},[1336],{"type":998,"value":1337},"Pre-test loop",{"type":998,"value":1339},": condition checked before execution",{"type":993,"tag":1001,"props":1341,"children":1342},{},[1343,1348],{"type":993,"tag":1012,"props":1344,"children":1345},{},[1346],{"type":998,"value":1347},"Safety Rule:",{"type":998,"value":1349}," Always ensure the loop condition can change during execution",{"type":993,"tag":1001,"props":1351,"children":1352},{},[1353,1358],{"type":993,"tag":1012,"props":1354,"children":1355},{},[1356],{"type":998,"value":1357},"Infinite Loop Prevention:",{"type":998,"value":1359}," Update control variables within the loop body",{"type":993,"tag":1001,"props":1361,"children":1362},{},[1363],{"type":998,"value":1364},"The most critical aspect of while loops is ensuring the condition eventually becomes False. Otherwise, you'll create an infinite loop that runs forever.",{"type":993,"tag":1023,"props":1366,"children":1367},{},[1368],{"type":993,"tag":1027,"props":1369,"children":1371},{"className":1029,"code":1370,"language":6,"meta":8,"style":8},"# Basic countdown example\ncountdown = 5\nwhile countdown > 0:\n    print(f\"T-minus {countdown}\")\n    countdown -= 1  # This change makes the condition eventually False\nprint(\"Blast off!\")\n",[1372],{"type":993,"tag":1033,"props":1373,"children":1374},{"__ignoreMap":8},[1375,1383,1400,1426,1467,1489],{"type":993,"tag":1037,"props":1376,"children":1377},{"class":1039,"line":12},[1378],{"type":993,"tag":1037,"props":1379,"children":1380},{"style":1043},[1381],{"type":998,"value":1382},"# Basic countdown example\n",{"type":993,"tag":1037,"props":1384,"children":1385},{"class":1039,"line":27},[1386,1391,1395],{"type":993,"tag":1037,"props":1387,"children":1388},{"style":1052},[1389],{"type":998,"value":1390},"countdown ",{"type":993,"tag":1037,"props":1392,"children":1393},{"style":1058},[1394],{"type":998,"value":1061},{"type":993,"tag":1037,"props":1396,"children":1397},{"style":1064},[1398],{"type":998,"value":1399}," 5\n",{"type":993,"tag":1037,"props":1401,"children":1402},{"class":1039,"line":36},[1403,1407,1412,1417,1422],{"type":993,"tag":1037,"props":1404,"children":1405},{"style":1058},[1406],{"type":998,"value":1075},{"type":993,"tag":1037,"props":1408,"children":1409},{"style":1052},[1410],{"type":998,"value":1411}," countdown ",{"type":993,"tag":1037,"props":1413,"children":1414},{"style":1058},[1415],{"type":998,"value":1416},">",{"type":993,"tag":1037,"props":1418,"children":1419},{"style":1064},[1420],{"type":998,"value":1421}," 0",{"type":993,"tag":1037,"props":1423,"children":1424},{"style":1052},[1425],{"type":998,"value":1095},{"type":993,"tag":1037,"props":1427,"children":1428},{"class":1039,"line":45},[1429,1433,1437,1441,1446,1450,1455,1459,1463],{"type":993,"tag":1037,"props":1430,"children":1431},{"style":1064},[1432],{"type":998,"value":1103},{"type":993,"tag":1037,"props":1434,"children":1435},{"style":1052},[1436],{"type":998,"value":1108},{"type":993,"tag":1037,"props":1438,"children":1439},{"style":1058},[1440],{"type":998,"value":1113},{"type":993,"tag":1037,"props":1442,"children":1443},{"style":1116},[1444],{"type":998,"value":1445},"\"T-minus ",{"type":993,"tag":1037,"props":1447,"children":1448},{"style":1064},[1449],{"type":998,"value":1124},{"type":993,"tag":1037,"props":1451,"children":1452},{"style":1052},[1453],{"type":998,"value":1454},"countdown",{"type":993,"tag":1037,"props":1456,"children":1457},{"style":1064},[1458],{"type":998,"value":1134},{"type":993,"tag":1037,"props":1460,"children":1461},{"style":1116},[1462],{"type":998,"value":1139},{"type":993,"tag":1037,"props":1464,"children":1465},{"style":1052},[1466],{"type":998,"value":1144},{"type":993,"tag":1037,"props":1468,"children":1469},{"class":1039,"line":54},[1470,1475,1480,1484],{"type":993,"tag":1037,"props":1471,"children":1472},{"style":1052},[1473],{"type":998,"value":1474},"    countdown ",{"type":993,"tag":1037,"props":1476,"children":1477},{"style":1058},[1478],{"type":998,"value":1479},"-=",{"type":993,"tag":1037,"props":1481,"children":1482},{"style":1064},[1483],{"type":998,"value":1162},{"type":993,"tag":1037,"props":1485,"children":1486},{"style":1043},[1487],{"type":998,"value":1488},"  # This change makes the condition eventually False\n",{"type":993,"tag":1037,"props":1490,"children":1491},{"class":1039,"line":63},[1492,1496,1500,1505],{"type":993,"tag":1037,"props":1493,"children":1494},{"style":1064},[1495],{"type":998,"value":1183},{"type":993,"tag":1037,"props":1497,"children":1498},{"style":1052},[1499],{"type":998,"value":1108},{"type":993,"tag":1037,"props":1501,"children":1502},{"style":1116},[1503],{"type":998,"value":1504},"\"Blast off!\"",{"type":993,"tag":1037,"props":1506,"children":1507},{"style":1052},[1508],{"type":998,"value":1144},{"type":993,"tag":1198,"props":1510,"children":1512},{"id":1511},"️-loop-control-variables",[1513],{"type":998,"value":1514},"🎛️ Loop Control Variables",{"type":993,"tag":1001,"props":1516,"children":1517},{},[1518],{"type":998,"value":1519},"While loops typically use control variables that change during each iteration. These variables determine when the loop should stop and help track the loop's progress.",{"type":993,"tag":1217,"props":1521,"children":1525},{"emoji":1522,"title":1523,"type":1524},"🎛️","Control Variable Management","info",[1526,1534,1585,1593,1664,1674],{"type":993,"tag":1001,"props":1527,"children":1528},{},[1529],{"type":993,"tag":1012,"props":1530,"children":1531},{},[1532],{"type":998,"value":1533},"Variable Types:",{"type":993,"tag":1232,"props":1535,"children":1536},{},[1537,1547,1557,1567],{"type":993,"tag":1236,"props":1538,"children":1539},{},[1540,1545],{"type":993,"tag":1012,"props":1541,"children":1542},{},[1543],{"type":998,"value":1544},"Counter Variables",{"type":998,"value":1546},": Track iteration count or position",{"type":993,"tag":1236,"props":1548,"children":1549},{},[1550,1555],{"type":993,"tag":1012,"props":1551,"children":1552},{},[1553],{"type":998,"value":1554},"Boolean Flags",{"type":998,"value":1556},": Control loop continuation based on conditions",{"type":993,"tag":1236,"props":1558,"children":1559},{},[1560,1565],{"type":993,"tag":1012,"props":1561,"children":1562},{},[1563],{"type":998,"value":1564},"Accumulator Variables",{"type":998,"value":1566},": Collect or calculate values during iteration",{"type":993,"tag":1236,"props":1568,"children":1569},{},[1570,1575,1577],{"type":993,"tag":1012,"props":1571,"children":1572},{},[1573],{"type":998,"value":1574},"Index Variables",{"type":998,"value":1576},": Track position in ",{"type":993,"tag":1012,"props":1578,"children":1579},{},[1580],{"type":993,"tag":1016,"props":1581,"children":1582},{"href":280},[1583],{"type":998,"value":1584},"data structures",{"type":993,"tag":1001,"props":1586,"children":1587},{},[1588],{"type":993,"tag":1012,"props":1589,"children":1590},{},[1591],{"type":998,"value":1592},"Update Patterns:",{"type":993,"tag":1232,"props":1594,"children":1595},{},[1596,1620,1642],{"type":993,"tag":1236,"props":1597,"children":1598},{},[1599,1604,1606,1612,1614],{"type":993,"tag":1012,"props":1600,"children":1601},{},[1602],{"type":998,"value":1603},"Increment/decrement",{"type":998,"value":1605},": ",{"type":993,"tag":1033,"props":1607,"children":1609},{"className":1608},[],[1610],{"type":998,"value":1611},"i += 1",{"type":998,"value":1613},", ",{"type":993,"tag":1033,"props":1615,"children":1617},{"className":1616},[],[1618],{"type":998,"value":1619},"count -= 1",{"type":993,"tag":1236,"props":1621,"children":1622},{},[1623,1628,1629,1635,1636],{"type":993,"tag":1012,"props":1624,"children":1625},{},[1626],{"type":998,"value":1627},"Boolean toggle",{"type":998,"value":1605},{"type":993,"tag":1033,"props":1630,"children":1632},{"className":1631},[],[1633],{"type":998,"value":1634},"found = True",{"type":998,"value":1613},{"type":993,"tag":1033,"props":1637,"children":1639},{"className":1638},[],[1640],{"type":998,"value":1641},"done = False",{"type":993,"tag":1236,"props":1643,"children":1644},{},[1645,1650,1651,1657,1658],{"type":993,"tag":1012,"props":1646,"children":1647},{},[1648],{"type":998,"value":1649},"Accumulation",{"type":998,"value":1605},{"type":993,"tag":1033,"props":1652,"children":1654},{"className":1653},[],[1655],{"type":998,"value":1656},"total += value",{"type":998,"value":1613},{"type":993,"tag":1033,"props":1659,"children":1661},{"className":1660},[],[1662],{"type":998,"value":1663},"result *= factor",{"type":993,"tag":1001,"props":1665,"children":1666},{},[1667,1672],{"type":993,"tag":1012,"props":1668,"children":1669},{},[1670],{"type":998,"value":1671},"Best Practices:",{"type":998,"value":1673}," Initialize before loop, update inside loop, use descriptive names",{"type":993,"tag":1001,"props":1675,"children":1676},{},[1677,1682],{"type":993,"tag":1012,"props":1678,"children":1679},{},[1680],{"type":998,"value":1681},"Error Prevention:",{"type":998,"value":1683}," Ensure variables change in direction that terminates loop",{"type":993,"tag":1001,"props":1685,"children":1686},{},[1687],{"type":998,"value":1688},"Properly managing control variables is crucial for loop correctness and preventing infinite loops or premature termination.",{"type":993,"tag":1023,"props":1690,"children":1691},{},[1692],{"type":993,"tag":1027,"props":1693,"children":1695},{"className":1029,"code":1694,"language":6,"meta":8,"style":8},"# Different control variable patterns\nprint(\"=== COUNTER VARIABLE ===\")\ni = 1\nwhile i \u003C= 3:\n    print(f\"Iteration: {i}\")\n    i += 1\n\nprint(\"\\n=== BOOLEAN FLAG ===\")\nfound = False\nnumbers = [1, 3, 5, 8, 9]\nindex = 0\n\nwhile not found and index \u003C len(numbers):\n    if numbers[index] % 2 == 0:\n        print(f\"Found even number: {numbers[index]}\")\n        found = True\n    index += 1\n\nprint(\"\\n=== ACCUMULATOR VARIABLE ===\")\ntotal = 0\ni = 1\nwhile i \u003C= 5:\n    total += i\n    i += 1\nprint(f\"Sum of 1-5: {total}\")\n",[1696],{"type":993,"tag":1033,"props":1697,"children":1698},{"__ignoreMap":8},[1699,1707,1727,1743,1768,1809,1825,1832,1861,1878,1941,1958,1965,2007,2043,2085,2102,2118,2125,2153,2169,2184,2207,2224,2239],{"type":993,"tag":1037,"props":1700,"children":1701},{"class":1039,"line":12},[1702],{"type":993,"tag":1037,"props":1703,"children":1704},{"style":1043},[1705],{"type":998,"value":1706},"# Different control variable patterns\n",{"type":993,"tag":1037,"props":1708,"children":1709},{"class":1039,"line":27},[1710,1714,1718,1723],{"type":993,"tag":1037,"props":1711,"children":1712},{"style":1064},[1713],{"type":998,"value":1183},{"type":993,"tag":1037,"props":1715,"children":1716},{"style":1052},[1717],{"type":998,"value":1108},{"type":993,"tag":1037,"props":1719,"children":1720},{"style":1116},[1721],{"type":998,"value":1722},"\"=== COUNTER VARIABLE ===\"",{"type":993,"tag":1037,"props":1724,"children":1725},{"style":1052},[1726],{"type":998,"value":1144},{"type":993,"tag":1037,"props":1728,"children":1729},{"class":1039,"line":36},[1730,1735,1739],{"type":993,"tag":1037,"props":1731,"children":1732},{"style":1052},[1733],{"type":998,"value":1734},"i ",{"type":993,"tag":1037,"props":1736,"children":1737},{"style":1058},[1738],{"type":998,"value":1061},{"type":993,"tag":1037,"props":1740,"children":1741},{"style":1064},[1742],{"type":998,"value":1067},{"type":993,"tag":1037,"props":1744,"children":1745},{"class":1039,"line":45},[1746,1750,1755,1759,1764],{"type":993,"tag":1037,"props":1747,"children":1748},{"style":1058},[1749],{"type":998,"value":1075},{"type":993,"tag":1037,"props":1751,"children":1752},{"style":1052},[1753],{"type":998,"value":1754}," i ",{"type":993,"tag":1037,"props":1756,"children":1757},{"style":1058},[1758],{"type":998,"value":1085},{"type":993,"tag":1037,"props":1760,"children":1761},{"style":1064},[1762],{"type":998,"value":1763}," 3",{"type":993,"tag":1037,"props":1765,"children":1766},{"style":1052},[1767],{"type":998,"value":1095},{"type":993,"tag":1037,"props":1769,"children":1770},{"class":1039,"line":54},[1771,1775,1779,1783,1788,1792,1797,1801,1805],{"type":993,"tag":1037,"props":1772,"children":1773},{"style":1064},[1774],{"type":998,"value":1103},{"type":993,"tag":1037,"props":1776,"children":1777},{"style":1052},[1778],{"type":998,"value":1108},{"type":993,"tag":1037,"props":1780,"children":1781},{"style":1058},[1782],{"type":998,"value":1113},{"type":993,"tag":1037,"props":1784,"children":1785},{"style":1116},[1786],{"type":998,"value":1787},"\"Iteration: ",{"type":993,"tag":1037,"props":1789,"children":1790},{"style":1064},[1791],{"type":998,"value":1124},{"type":993,"tag":1037,"props":1793,"children":1794},{"style":1052},[1795],{"type":998,"value":1796},"i",{"type":993,"tag":1037,"props":1798,"children":1799},{"style":1064},[1800],{"type":998,"value":1134},{"type":993,"tag":1037,"props":1802,"children":1803},{"style":1116},[1804],{"type":998,"value":1139},{"type":993,"tag":1037,"props":1806,"children":1807},{"style":1052},[1808],{"type":998,"value":1144},{"type":993,"tag":1037,"props":1810,"children":1811},{"class":1039,"line":63},[1812,1817,1821],{"type":993,"tag":1037,"props":1813,"children":1814},{"style":1052},[1815],{"type":998,"value":1816},"    i ",{"type":993,"tag":1037,"props":1818,"children":1819},{"style":1058},[1820],{"type":998,"value":1157},{"type":993,"tag":1037,"props":1822,"children":1823},{"style":1064},[1824],{"type":998,"value":1067},{"type":993,"tag":1037,"props":1826,"children":1827},{"class":1039,"line":72},[1828],{"type":993,"tag":1037,"props":1829,"children":1830},{"emptyLinePlaceholder":13},[1831],{"type":998,"value":1175},{"type":993,"tag":1037,"props":1833,"children":1834},{"class":1039,"line":81},[1835,1839,1843,1847,1852,1857],{"type":993,"tag":1037,"props":1836,"children":1837},{"style":1064},[1838],{"type":998,"value":1183},{"type":993,"tag":1037,"props":1840,"children":1841},{"style":1052},[1842],{"type":998,"value":1108},{"type":993,"tag":1037,"props":1844,"children":1845},{"style":1116},[1846],{"type":998,"value":1139},{"type":993,"tag":1037,"props":1848,"children":1849},{"style":1064},[1850],{"type":998,"value":1851},"\\n",{"type":993,"tag":1037,"props":1853,"children":1854},{"style":1116},[1855],{"type":998,"value":1856},"=== BOOLEAN FLAG ===\"",{"type":993,"tag":1037,"props":1858,"children":1859},{"style":1052},[1860],{"type":998,"value":1144},{"type":993,"tag":1037,"props":1862,"children":1863},{"class":1039,"line":91},[1864,1869,1873],{"type":993,"tag":1037,"props":1865,"children":1866},{"style":1052},[1867],{"type":998,"value":1868},"found ",{"type":993,"tag":1037,"props":1870,"children":1871},{"style":1058},[1872],{"type":998,"value":1061},{"type":993,"tag":1037,"props":1874,"children":1875},{"style":1064},[1876],{"type":998,"value":1877}," False\n",{"type":993,"tag":1037,"props":1879,"children":1880},{"class":1039,"line":100},[1881,1886,1890,1895,1900,1904,1909,1913,1918,1922,1927,1931,1936],{"type":993,"tag":1037,"props":1882,"children":1883},{"style":1052},[1884],{"type":998,"value":1885},"numbers ",{"type":993,"tag":1037,"props":1887,"children":1888},{"style":1058},[1889],{"type":998,"value":1061},{"type":993,"tag":1037,"props":1891,"children":1892},{"style":1052},[1893],{"type":998,"value":1894}," [",{"type":993,"tag":1037,"props":1896,"children":1897},{"style":1064},[1898],{"type":998,"value":1899},"1",{"type":993,"tag":1037,"props":1901,"children":1902},{"style":1052},[1903],{"type":998,"value":1613},{"type":993,"tag":1037,"props":1905,"children":1906},{"style":1064},[1907],{"type":998,"value":1908},"3",{"type":993,"tag":1037,"props":1910,"children":1911},{"style":1052},[1912],{"type":998,"value":1613},{"type":993,"tag":1037,"props":1914,"children":1915},{"style":1064},[1916],{"type":998,"value":1917},"5",{"type":993,"tag":1037,"props":1919,"children":1920},{"style":1052},[1921],{"type":998,"value":1613},{"type":993,"tag":1037,"props":1923,"children":1924},{"style":1064},[1925],{"type":998,"value":1926},"8",{"type":993,"tag":1037,"props":1928,"children":1929},{"style":1052},[1930],{"type":998,"value":1613},{"type":993,"tag":1037,"props":1932,"children":1933},{"style":1064},[1934],{"type":998,"value":1935},"9",{"type":993,"tag":1037,"props":1937,"children":1938},{"style":1052},[1939],{"type":998,"value":1940},"]\n",{"type":993,"tag":1037,"props":1942,"children":1943},{"class":1039,"line":109},[1944,1949,1953],{"type":993,"tag":1037,"props":1945,"children":1946},{"style":1052},[1947],{"type":998,"value":1948},"index ",{"type":993,"tag":1037,"props":1950,"children":1951},{"style":1058},[1952],{"type":998,"value":1061},{"type":993,"tag":1037,"props":1954,"children":1955},{"style":1064},[1956],{"type":998,"value":1957}," 0\n",{"type":993,"tag":1037,"props":1959,"children":1960},{"class":1039,"line":118},[1961],{"type":993,"tag":1037,"props":1962,"children":1963},{"emptyLinePlaceholder":13},[1964],{"type":998,"value":1175},{"type":993,"tag":1037,"props":1966,"children":1967},{"class":1039,"line":127},[1968,1972,1977,1982,1987,1992,1997,2002],{"type":993,"tag":1037,"props":1969,"children":1970},{"style":1058},[1971],{"type":998,"value":1075},{"type":993,"tag":1037,"props":1973,"children":1974},{"style":1058},[1975],{"type":998,"value":1976}," not",{"type":993,"tag":1037,"props":1978,"children":1979},{"style":1052},[1980],{"type":998,"value":1981}," found ",{"type":993,"tag":1037,"props":1983,"children":1984},{"style":1058},[1985],{"type":998,"value":1986},"and",{"type":993,"tag":1037,"props":1988,"children":1989},{"style":1052},[1990],{"type":998,"value":1991}," index ",{"type":993,"tag":1037,"props":1993,"children":1994},{"style":1058},[1995],{"type":998,"value":1996},"\u003C",{"type":993,"tag":1037,"props":1998,"children":1999},{"style":1064},[2000],{"type":998,"value":2001}," len",{"type":993,"tag":1037,"props":2003,"children":2004},{"style":1052},[2005],{"type":998,"value":2006},"(numbers):\n",{"type":993,"tag":1037,"props":2008,"children":2009},{"class":1039,"line":136},[2010,2015,2020,2025,2030,2035,2039],{"type":993,"tag":1037,"props":2011,"children":2012},{"style":1058},[2013],{"type":998,"value":2014},"    if",{"type":993,"tag":1037,"props":2016,"children":2017},{"style":1052},[2018],{"type":998,"value":2019}," numbers[index] ",{"type":993,"tag":1037,"props":2021,"children":2022},{"style":1058},[2023],{"type":998,"value":2024},"%",{"type":993,"tag":1037,"props":2026,"children":2027},{"style":1064},[2028],{"type":998,"value":2029}," 2",{"type":993,"tag":1037,"props":2031,"children":2032},{"style":1058},[2033],{"type":998,"value":2034}," ==",{"type":993,"tag":1037,"props":2036,"children":2037},{"style":1064},[2038],{"type":998,"value":1421},{"type":993,"tag":1037,"props":2040,"children":2041},{"style":1052},[2042],{"type":998,"value":1095},{"type":993,"tag":1037,"props":2044,"children":2045},{"class":1039,"line":146},[2046,2051,2055,2059,2064,2068,2073,2077,2081],{"type":993,"tag":1037,"props":2047,"children":2048},{"style":1064},[2049],{"type":998,"value":2050},"        print",{"type":993,"tag":1037,"props":2052,"children":2053},{"style":1052},[2054],{"type":998,"value":1108},{"type":993,"tag":1037,"props":2056,"children":2057},{"style":1058},[2058],{"type":998,"value":1113},{"type":993,"tag":1037,"props":2060,"children":2061},{"style":1116},[2062],{"type":998,"value":2063},"\"Found even number: ",{"type":993,"tag":1037,"props":2065,"children":2066},{"style":1064},[2067],{"type":998,"value":1124},{"type":993,"tag":1037,"props":2069,"children":2070},{"style":1052},[2071],{"type":998,"value":2072},"numbers[index]",{"type":993,"tag":1037,"props":2074,"children":2075},{"style":1064},[2076],{"type":998,"value":1134},{"type":993,"tag":1037,"props":2078,"children":2079},{"style":1116},[2080],{"type":998,"value":1139},{"type":993,"tag":1037,"props":2082,"children":2083},{"style":1052},[2084],{"type":998,"value":1144},{"type":993,"tag":1037,"props":2086,"children":2087},{"class":1039,"line":155},[2088,2093,2097],{"type":993,"tag":1037,"props":2089,"children":2090},{"style":1052},[2091],{"type":998,"value":2092},"        found ",{"type":993,"tag":1037,"props":2094,"children":2095},{"style":1058},[2096],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2098,"children":2099},{"style":1064},[2100],{"type":998,"value":2101}," True\n",{"type":993,"tag":1037,"props":2103,"children":2104},{"class":1039,"line":164},[2105,2110,2114],{"type":993,"tag":1037,"props":2106,"children":2107},{"style":1052},[2108],{"type":998,"value":2109},"    index ",{"type":993,"tag":1037,"props":2111,"children":2112},{"style":1058},[2113],{"type":998,"value":1157},{"type":993,"tag":1037,"props":2115,"children":2116},{"style":1064},[2117],{"type":998,"value":1067},{"type":993,"tag":1037,"props":2119,"children":2120},{"class":1039,"line":173},[2121],{"type":993,"tag":1037,"props":2122,"children":2123},{"emptyLinePlaceholder":13},[2124],{"type":998,"value":1175},{"type":993,"tag":1037,"props":2126,"children":2127},{"class":1039,"line":182},[2128,2132,2136,2140,2144,2149],{"type":993,"tag":1037,"props":2129,"children":2130},{"style":1064},[2131],{"type":998,"value":1183},{"type":993,"tag":1037,"props":2133,"children":2134},{"style":1052},[2135],{"type":998,"value":1108},{"type":993,"tag":1037,"props":2137,"children":2138},{"style":1116},[2139],{"type":998,"value":1139},{"type":993,"tag":1037,"props":2141,"children":2142},{"style":1064},[2143],{"type":998,"value":1851},{"type":993,"tag":1037,"props":2145,"children":2146},{"style":1116},[2147],{"type":998,"value":2148},"=== ACCUMULATOR VARIABLE ===\"",{"type":993,"tag":1037,"props":2150,"children":2151},{"style":1052},[2152],{"type":998,"value":1144},{"type":993,"tag":1037,"props":2154,"children":2155},{"class":1039,"line":191},[2156,2161,2165],{"type":993,"tag":1037,"props":2157,"children":2158},{"style":1052},[2159],{"type":998,"value":2160},"total ",{"type":993,"tag":1037,"props":2162,"children":2163},{"style":1058},[2164],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2166,"children":2167},{"style":1064},[2168],{"type":998,"value":1957},{"type":993,"tag":1037,"props":2170,"children":2171},{"class":1039,"line":201},[2172,2176,2180],{"type":993,"tag":1037,"props":2173,"children":2174},{"style":1052},[2175],{"type":998,"value":1734},{"type":993,"tag":1037,"props":2177,"children":2178},{"style":1058},[2179],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2181,"children":2182},{"style":1064},[2183],{"type":998,"value":1067},{"type":993,"tag":1037,"props":2185,"children":2186},{"class":1039,"line":210},[2187,2191,2195,2199,2203],{"type":993,"tag":1037,"props":2188,"children":2189},{"style":1058},[2190],{"type":998,"value":1075},{"type":993,"tag":1037,"props":2192,"children":2193},{"style":1052},[2194],{"type":998,"value":1754},{"type":993,"tag":1037,"props":2196,"children":2197},{"style":1058},[2198],{"type":998,"value":1085},{"type":993,"tag":1037,"props":2200,"children":2201},{"style":1064},[2202],{"type":998,"value":1090},{"type":993,"tag":1037,"props":2204,"children":2205},{"style":1052},[2206],{"type":998,"value":1095},{"type":993,"tag":1037,"props":2208,"children":2209},{"class":1039,"line":219},[2210,2215,2219],{"type":993,"tag":1037,"props":2211,"children":2212},{"style":1052},[2213],{"type":998,"value":2214},"    total ",{"type":993,"tag":1037,"props":2216,"children":2217},{"style":1058},[2218],{"type":998,"value":1157},{"type":993,"tag":1037,"props":2220,"children":2221},{"style":1052},[2222],{"type":998,"value":2223}," i\n",{"type":993,"tag":1037,"props":2225,"children":2226},{"class":1039,"line":228},[2227,2231,2235],{"type":993,"tag":1037,"props":2228,"children":2229},{"style":1052},[2230],{"type":998,"value":1816},{"type":993,"tag":1037,"props":2232,"children":2233},{"style":1058},[2234],{"type":998,"value":1157},{"type":993,"tag":1037,"props":2236,"children":2237},{"style":1064},[2238],{"type":998,"value":1067},{"type":993,"tag":1037,"props":2240,"children":2241},{"class":1039,"line":238},[2242,2246,2250,2254,2259,2263,2268,2272,2276],{"type":993,"tag":1037,"props":2243,"children":2244},{"style":1064},[2245],{"type":998,"value":1183},{"type":993,"tag":1037,"props":2247,"children":2248},{"style":1052},[2249],{"type":998,"value":1108},{"type":993,"tag":1037,"props":2251,"children":2252},{"style":1058},[2253],{"type":998,"value":1113},{"type":993,"tag":1037,"props":2255,"children":2256},{"style":1116},[2257],{"type":998,"value":2258},"\"Sum of 1-5: ",{"type":993,"tag":1037,"props":2260,"children":2261},{"style":1064},[2262],{"type":998,"value":1124},{"type":993,"tag":1037,"props":2264,"children":2265},{"style":1052},[2266],{"type":998,"value":2267},"total",{"type":993,"tag":1037,"props":2269,"children":2270},{"style":1064},[2271],{"type":998,"value":1134},{"type":993,"tag":1037,"props":2273,"children":2274},{"style":1116},[2275],{"type":998,"value":1139},{"type":993,"tag":1037,"props":2277,"children":2278},{"style":1052},[2279],{"type":998,"value":1144},{"type":993,"tag":2281,"props":2282,"children":2284},"content-exercise",{":widget-view":2283,"category":6,"id":237},"true",[],{"type":993,"tag":1198,"props":2286,"children":2288},{"id":2287},"quick-while-loop-practice",[2289],{"type":998,"value":2290},"🔄 Quick While Loop Practice",{"type":993,"tag":1001,"props":2292,"children":2293},{},[2294],{"type":998,"value":2295},"Let's practice writing while loops that calculate results!",{"type":993,"tag":2297,"props":2298,"children":2301},"exercise",{"hint":2299,"prompt":2300},"Use a counter variable and an accumulator variable to keep track of the total!","Write a while loop to calculate the sum of numbers from 1 to 10.",[2302],{"type":993,"tag":1027,"props":2303,"children":2305},{"className":1029,"code":2304,"language":6,"meta":8,"style":8},"# 10 While Loop Practice - Calculate sum of 1 to\n\ntotal = 0\ncount = 1\n\n# 10 TODO: Your code here: write a while loop that adds numbers 1 through\n# The final result should be stored in 'total'\n",[2306],{"type":993,"tag":1033,"props":2307,"children":2308},{"__ignoreMap":8},[2309,2317,2324,2339,2354,2361,2379],{"type":993,"tag":1037,"props":2310,"children":2311},{"class":1039,"line":12},[2312],{"type":993,"tag":1037,"props":2313,"children":2314},{"style":1043},[2315],{"type":998,"value":2316},"# 10 While Loop Practice - Calculate sum of 1 to\n",{"type":993,"tag":1037,"props":2318,"children":2319},{"class":1039,"line":27},[2320],{"type":993,"tag":1037,"props":2321,"children":2322},{"emptyLinePlaceholder":13},[2323],{"type":998,"value":1175},{"type":993,"tag":1037,"props":2325,"children":2326},{"class":1039,"line":36},[2327,2331,2335],{"type":993,"tag":1037,"props":2328,"children":2329},{"style":1052},[2330],{"type":998,"value":2160},{"type":993,"tag":1037,"props":2332,"children":2333},{"style":1058},[2334],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2336,"children":2337},{"style":1064},[2338],{"type":998,"value":1957},{"type":993,"tag":1037,"props":2340,"children":2341},{"class":1039,"line":45},[2342,2346,2350],{"type":993,"tag":1037,"props":2343,"children":2344},{"style":1052},[2345],{"type":998,"value":1055},{"type":993,"tag":1037,"props":2347,"children":2348},{"style":1058},[2349],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2351,"children":2352},{"style":1064},[2353],{"type":998,"value":1067},{"type":993,"tag":1037,"props":2355,"children":2356},{"class":1039,"line":54},[2357],{"type":993,"tag":1037,"props":2358,"children":2359},{"emptyLinePlaceholder":13},[2360],{"type":998,"value":1175},{"type":993,"tag":1037,"props":2362,"children":2363},{"class":1039,"line":63},[2364,2369,2374],{"type":993,"tag":1037,"props":2365,"children":2366},{"style":1043},[2367],{"type":998,"value":2368},"# 10 ",{"type":993,"tag":1037,"props":2370,"children":2371},{"style":1058},[2372],{"type":998,"value":2373},"TODO",{"type":993,"tag":1037,"props":2375,"children":2376},{"style":1043},[2377],{"type":998,"value":2378},": Your code here: write a while loop that adds numbers 1 through\n",{"type":993,"tag":1037,"props":2380,"children":2381},{"class":1039,"line":72},[2382],{"type":993,"tag":1037,"props":2383,"children":2384},{"style":1043},[2385],{"type":998,"value":2386},"# The final result should be stored in 'total'\n",{"type":993,"tag":2388,"props":2389,"children":2391},"h3",{"id":2390},"solution-and-explanation",[2392],{"type":998,"value":2393},"Solution and Explanation 💡",{"type":993,"tag":2395,"props":2396,"children":2397},"details",{},[2398,2406,2570,2578],{"type":993,"tag":2399,"props":2400,"children":2403},"summary",{"className":2401},[2402],"cursor-pointer",[2404],{"type":998,"value":2405},"Click to see the complete solution",{"type":993,"tag":1023,"props":2407,"children":2408},{},[2409],{"type":993,"tag":1027,"props":2410,"children":2412},{"className":1029,"code":2411,"language":6,"meta":8,"style":8},"# While Loop Practice - Solution\n\ntotal = 0\ncount = 1\n\nwhile count \u003C= 10:\n    total += count\n    count += 1\n\nprint(f\"Sum of 1 to 10: {total}\")\n",[2413],{"type":993,"tag":1033,"props":2414,"children":2415},{"__ignoreMap":8},[2416,2424,2431,2446,2461,2468,2492,2508,2523,2530],{"type":993,"tag":1037,"props":2417,"children":2418},{"class":1039,"line":12},[2419],{"type":993,"tag":1037,"props":2420,"children":2421},{"style":1043},[2422],{"type":998,"value":2423},"# While Loop Practice - Solution\n",{"type":993,"tag":1037,"props":2425,"children":2426},{"class":1039,"line":27},[2427],{"type":993,"tag":1037,"props":2428,"children":2429},{"emptyLinePlaceholder":13},[2430],{"type":998,"value":1175},{"type":993,"tag":1037,"props":2432,"children":2433},{"class":1039,"line":36},[2434,2438,2442],{"type":993,"tag":1037,"props":2435,"children":2436},{"style":1052},[2437],{"type":998,"value":2160},{"type":993,"tag":1037,"props":2439,"children":2440},{"style":1058},[2441],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2443,"children":2444},{"style":1064},[2445],{"type":998,"value":1957},{"type":993,"tag":1037,"props":2447,"children":2448},{"class":1039,"line":45},[2449,2453,2457],{"type":993,"tag":1037,"props":2450,"children":2451},{"style":1052},[2452],{"type":998,"value":1055},{"type":993,"tag":1037,"props":2454,"children":2455},{"style":1058},[2456],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2458,"children":2459},{"style":1064},[2460],{"type":998,"value":1067},{"type":993,"tag":1037,"props":2462,"children":2463},{"class":1039,"line":54},[2464],{"type":993,"tag":1037,"props":2465,"children":2466},{"emptyLinePlaceholder":13},[2467],{"type":998,"value":1175},{"type":993,"tag":1037,"props":2469,"children":2470},{"class":1039,"line":63},[2471,2475,2479,2483,2488],{"type":993,"tag":1037,"props":2472,"children":2473},{"style":1058},[2474],{"type":998,"value":1075},{"type":993,"tag":1037,"props":2476,"children":2477},{"style":1052},[2478],{"type":998,"value":1080},{"type":993,"tag":1037,"props":2480,"children":2481},{"style":1058},[2482],{"type":998,"value":1085},{"type":993,"tag":1037,"props":2484,"children":2485},{"style":1064},[2486],{"type":998,"value":2487}," 10",{"type":993,"tag":1037,"props":2489,"children":2490},{"style":1052},[2491],{"type":998,"value":1095},{"type":993,"tag":1037,"props":2493,"children":2494},{"class":1039,"line":72},[2495,2499,2503],{"type":993,"tag":1037,"props":2496,"children":2497},{"style":1052},[2498],{"type":998,"value":2214},{"type":993,"tag":1037,"props":2500,"children":2501},{"style":1058},[2502],{"type":998,"value":1157},{"type":993,"tag":1037,"props":2504,"children":2505},{"style":1052},[2506],{"type":998,"value":2507}," count\n",{"type":993,"tag":1037,"props":2509,"children":2510},{"class":1039,"line":81},[2511,2515,2519],{"type":993,"tag":1037,"props":2512,"children":2513},{"style":1052},[2514],{"type":998,"value":1152},{"type":993,"tag":1037,"props":2516,"children":2517},{"style":1058},[2518],{"type":998,"value":1157},{"type":993,"tag":1037,"props":2520,"children":2521},{"style":1064},[2522],{"type":998,"value":1067},{"type":993,"tag":1037,"props":2524,"children":2525},{"class":1039,"line":91},[2526],{"type":993,"tag":1037,"props":2527,"children":2528},{"emptyLinePlaceholder":13},[2529],{"type":998,"value":1175},{"type":993,"tag":1037,"props":2531,"children":2532},{"class":1039,"line":100},[2533,2537,2541,2545,2550,2554,2558,2562,2566],{"type":993,"tag":1037,"props":2534,"children":2535},{"style":1064},[2536],{"type":998,"value":1183},{"type":993,"tag":1037,"props":2538,"children":2539},{"style":1052},[2540],{"type":998,"value":1108},{"type":993,"tag":1037,"props":2542,"children":2543},{"style":1058},[2544],{"type":998,"value":1113},{"type":993,"tag":1037,"props":2546,"children":2547},{"style":1116},[2548],{"type":998,"value":2549},"\"Sum of 1 to 10: ",{"type":993,"tag":1037,"props":2551,"children":2552},{"style":1064},[2553],{"type":998,"value":1124},{"type":993,"tag":1037,"props":2555,"children":2556},{"style":1052},[2557],{"type":998,"value":2267},{"type":993,"tag":1037,"props":2559,"children":2560},{"style":1064},[2561],{"type":998,"value":1134},{"type":993,"tag":1037,"props":2563,"children":2564},{"style":1116},[2565],{"type":998,"value":1139},{"type":993,"tag":1037,"props":2567,"children":2568},{"style":1052},[2569],{"type":998,"value":1144},{"type":993,"tag":1001,"props":2571,"children":2572},{},[2573],{"type":993,"tag":1012,"props":2574,"children":2575},{},[2576],{"type":998,"value":2577},"Key Learning Points:",{"type":993,"tag":1232,"props":2579,"children":2580},{},[2581,2593,2604,2615],{"type":993,"tag":1236,"props":2582,"children":2583},{},[2584,2586,2591],{"type":998,"value":2585},"📌 ",{"type":993,"tag":1012,"props":2587,"children":2588},{},[2589],{"type":998,"value":2590},"Accumulator pattern",{"type":998,"value":2592},": Use one variable to collect results (total)",{"type":993,"tag":1236,"props":2594,"children":2595},{},[2596,2597,2602],{"type":998,"value":2585},{"type":993,"tag":1012,"props":2598,"children":2599},{},[2600],{"type":998,"value":2601},"Counter variable",{"type":998,"value":2603},": Use another variable to track iterations (count)",{"type":993,"tag":1236,"props":2605,"children":2606},{},[2607,2608,2613],{"type":998,"value":2585},{"type":993,"tag":1012,"props":2609,"children":2610},{},[2611],{"type":998,"value":2612},"Two updates",{"type":998,"value":2614},": Update both accumulator and counter in each iteration",{"type":993,"tag":1236,"props":2616,"children":2617},{},[2618,2619,2624],{"type":998,"value":2585},{"type":993,"tag":1012,"props":2620,"children":2621},{},[2622],{"type":998,"value":2623},"Final result",{"type":998,"value":2625},": The loop builds up the answer step by step",{"type":993,"tag":1198,"props":2627,"children":2629},{"id":2628},"️-input-validation-with-while-loops",[2630],{"type":998,"value":2631},"🛡️ Input Validation with While Loops",{"type":993,"tag":1001,"props":2633,"children":2634},{},[2635],{"type":998,"value":2636},"One of the most common uses for while loops is input validation. They allow you to repeatedly ask users for input until they provide valid data, creating robust and user-friendly programs.",{"type":993,"tag":1217,"props":2638,"children":2642},{"emoji":2639,"title":2640,"type":2641},"🛡️","Input Validation Benefits","success",[2643,2651,2694,2702,2745,2755],{"type":993,"tag":1001,"props":2644,"children":2645},{},[2646],{"type":993,"tag":1012,"props":2647,"children":2648},{},[2649],{"type":998,"value":2650},"User Experience Improvements:",{"type":993,"tag":1232,"props":2652,"children":2653},{},[2654,2664,2674,2684],{"type":993,"tag":1236,"props":2655,"children":2656},{},[2657,2662],{"type":993,"tag":1012,"props":2658,"children":2659},{},[2660],{"type":998,"value":2661},"Multiple chances",{"type":998,"value":2663}," to provide correct input",{"type":993,"tag":1236,"props":2665,"children":2666},{},[2667,2672],{"type":993,"tag":1012,"props":2668,"children":2669},{},[2670],{"type":998,"value":2671},"Clear error messages",{"type":998,"value":2673}," for invalid data",{"type":993,"tag":1236,"props":2675,"children":2676},{},[2677,2682],{"type":993,"tag":1012,"props":2678,"children":2679},{},[2680],{"type":998,"value":2681},"Graceful handling",{"type":998,"value":2683}," of input errors",{"type":993,"tag":1236,"props":2685,"children":2686},{},[2687,2692],{"type":993,"tag":1012,"props":2688,"children":2689},{},[2690],{"type":998,"value":2691},"No program crashes",{"type":998,"value":2693}," from bad input",{"type":993,"tag":1001,"props":2695,"children":2696},{},[2697],{"type":993,"tag":1012,"props":2698,"children":2699},{},[2700],{"type":998,"value":2701},"Validation Techniques:",{"type":993,"tag":1232,"props":2703,"children":2704},{},[2705,2715,2725,2735],{"type":993,"tag":1236,"props":2706,"children":2707},{},[2708,2713],{"type":993,"tag":1012,"props":2709,"children":2710},{},[2711],{"type":998,"value":2712},"Type checking",{"type":998,"value":2714}," with try/except blocks",{"type":993,"tag":1236,"props":2716,"children":2717},{},[2718,2723],{"type":993,"tag":1012,"props":2719,"children":2720},{},[2721],{"type":998,"value":2722},"Range validation",{"type":998,"value":2724}," for numeric inputs",{"type":993,"tag":1236,"props":2726,"children":2727},{},[2728,2733],{"type":993,"tag":1012,"props":2729,"children":2730},{},[2731],{"type":998,"value":2732},"Choice validation",{"type":998,"value":2734}," for menu selections",{"type":993,"tag":1236,"props":2736,"children":2737},{},[2738,2743],{"type":993,"tag":1012,"props":2739,"children":2740},{},[2741],{"type":998,"value":2742},"Format validation",{"type":998,"value":2744}," for structured data",{"type":993,"tag":1001,"props":2746,"children":2747},{},[2748,2753],{"type":993,"tag":1012,"props":2749,"children":2750},{},[2751],{"type":998,"value":2752},"Robustness:",{"type":998,"value":2754}," Input validation prevents program crashes and improves reliability",{"type":993,"tag":1001,"props":2756,"children":2757},{},[2758,2763],{"type":993,"tag":1012,"props":2759,"children":2760},{},[2761],{"type":998,"value":2762},"Professional Standard:",{"type":998,"value":2764}," Production applications always validate user input",{"type":993,"tag":1001,"props":2766,"children":2767},{},[2768],{"type":998,"value":2769},"Input validation loops improve user experience by giving users multiple chances to provide correct input rather than crashing or accepting invalid data.",{"type":993,"tag":1023,"props":2771,"children":2772},{},[2773],{"type":993,"tag":1027,"props":2774,"children":2776},{"className":1029,"code":2775,"language":6,"meta":8,"style":8},"# Age validation with error handling\nprint(\"=== AGE VALIDATION ===\")\nvalid_age = False\nwhile not valid_age:\n    try:\n        age_input = \"25\"  # Simulated user input (normally input() function)\n        age = int(age_input)\n        if 0 \u003C= age \u003C= 120:\n            valid_age = True\n            print(f\"Your age is: {age}\")\n        else:\n            print(\"Age must be between 0 and 120\")\n            # In real code, this would continue asking for input\n            break  # Breaking for demo purposes\n    except ValueError:\n        print(\"Please enter a valid number\")\n        # In real code, this would continue asking for input\n        break  # Breaking for demo purposes\n\nprint(\"\\n=== MENU VALIDATION ===\")  \nvalid_choice = False\nwhile not valid_choice:\n    print(\"Choose an option:\")\n    print(\"1. Save\")\n    print(\"2. Load\") \n    print(\"3. Quit\")\n    \n    choice = \"2\"  # Simulated user input\n    if choice in [\"1\", \"2\", \"3\"]:\n        valid_choice = True\n        options = {\"1\": \"Save\", \"2\": \"Load\", \"3\": \"Quit\"}\n        print(f\"You selected: {options[choice]}\")\n    else:\n        print(\"Invalid choice. Please enter 1, 2, or 3.\")\n        break  # Breaking for demo purposes\n",[2777],{"type":993,"tag":1033,"props":2778,"children":2779},{"__ignoreMap":8},[2780,2788,2808,2824,2840,2852,2874,2896,2931,2947,2989,3001,3021,3029,3042,3059,3079,3087,3099,3106,3135,3151,3167,3187,3207,3228,3248,3256,3278,3327,3343,3412,3453,3465,3485],{"type":993,"tag":1037,"props":2781,"children":2782},{"class":1039,"line":12},[2783],{"type":993,"tag":1037,"props":2784,"children":2785},{"style":1043},[2786],{"type":998,"value":2787},"# Age validation with error handling\n",{"type":993,"tag":1037,"props":2789,"children":2790},{"class":1039,"line":27},[2791,2795,2799,2804],{"type":993,"tag":1037,"props":2792,"children":2793},{"style":1064},[2794],{"type":998,"value":1183},{"type":993,"tag":1037,"props":2796,"children":2797},{"style":1052},[2798],{"type":998,"value":1108},{"type":993,"tag":1037,"props":2800,"children":2801},{"style":1116},[2802],{"type":998,"value":2803},"\"=== AGE VALIDATION ===\"",{"type":993,"tag":1037,"props":2805,"children":2806},{"style":1052},[2807],{"type":998,"value":1144},{"type":993,"tag":1037,"props":2809,"children":2810},{"class":1039,"line":36},[2811,2816,2820],{"type":993,"tag":1037,"props":2812,"children":2813},{"style":1052},[2814],{"type":998,"value":2815},"valid_age ",{"type":993,"tag":1037,"props":2817,"children":2818},{"style":1058},[2819],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2821,"children":2822},{"style":1064},[2823],{"type":998,"value":1877},{"type":993,"tag":1037,"props":2825,"children":2826},{"class":1039,"line":45},[2827,2831,2835],{"type":993,"tag":1037,"props":2828,"children":2829},{"style":1058},[2830],{"type":998,"value":1075},{"type":993,"tag":1037,"props":2832,"children":2833},{"style":1058},[2834],{"type":998,"value":1976},{"type":993,"tag":1037,"props":2836,"children":2837},{"style":1052},[2838],{"type":998,"value":2839}," valid_age:\n",{"type":993,"tag":1037,"props":2841,"children":2842},{"class":1039,"line":54},[2843,2848],{"type":993,"tag":1037,"props":2844,"children":2845},{"style":1058},[2846],{"type":998,"value":2847},"    try",{"type":993,"tag":1037,"props":2849,"children":2850},{"style":1052},[2851],{"type":998,"value":1095},{"type":993,"tag":1037,"props":2853,"children":2854},{"class":1039,"line":63},[2855,2860,2864,2869],{"type":993,"tag":1037,"props":2856,"children":2857},{"style":1052},[2858],{"type":998,"value":2859},"        age_input ",{"type":993,"tag":1037,"props":2861,"children":2862},{"style":1058},[2863],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2865,"children":2866},{"style":1116},[2867],{"type":998,"value":2868}," \"25\"",{"type":993,"tag":1037,"props":2870,"children":2871},{"style":1043},[2872],{"type":998,"value":2873},"  # Simulated user input (normally input() function)\n",{"type":993,"tag":1037,"props":2875,"children":2876},{"class":1039,"line":72},[2877,2882,2886,2891],{"type":993,"tag":1037,"props":2878,"children":2879},{"style":1052},[2880],{"type":998,"value":2881},"        age ",{"type":993,"tag":1037,"props":2883,"children":2884},{"style":1058},[2885],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2887,"children":2888},{"style":1064},[2889],{"type":998,"value":2890}," int",{"type":993,"tag":1037,"props":2892,"children":2893},{"style":1052},[2894],{"type":998,"value":2895},"(age_input)\n",{"type":993,"tag":1037,"props":2897,"children":2898},{"class":1039,"line":81},[2899,2904,2908,2913,2918,2922,2927],{"type":993,"tag":1037,"props":2900,"children":2901},{"style":1058},[2902],{"type":998,"value":2903},"        if",{"type":993,"tag":1037,"props":2905,"children":2906},{"style":1064},[2907],{"type":998,"value":1421},{"type":993,"tag":1037,"props":2909,"children":2910},{"style":1058},[2911],{"type":998,"value":2912}," \u003C=",{"type":993,"tag":1037,"props":2914,"children":2915},{"style":1052},[2916],{"type":998,"value":2917}," age ",{"type":993,"tag":1037,"props":2919,"children":2920},{"style":1058},[2921],{"type":998,"value":1085},{"type":993,"tag":1037,"props":2923,"children":2924},{"style":1064},[2925],{"type":998,"value":2926}," 120",{"type":993,"tag":1037,"props":2928,"children":2929},{"style":1052},[2930],{"type":998,"value":1095},{"type":993,"tag":1037,"props":2932,"children":2933},{"class":1039,"line":91},[2934,2939,2943],{"type":993,"tag":1037,"props":2935,"children":2936},{"style":1052},[2937],{"type":998,"value":2938},"            valid_age ",{"type":993,"tag":1037,"props":2940,"children":2941},{"style":1058},[2942],{"type":998,"value":1061},{"type":993,"tag":1037,"props":2944,"children":2945},{"style":1064},[2946],{"type":998,"value":2101},{"type":993,"tag":1037,"props":2948,"children":2949},{"class":1039,"line":100},[2950,2955,2959,2963,2968,2972,2977,2981,2985],{"type":993,"tag":1037,"props":2951,"children":2952},{"style":1064},[2953],{"type":998,"value":2954},"            print",{"type":993,"tag":1037,"props":2956,"children":2957},{"style":1052},[2958],{"type":998,"value":1108},{"type":993,"tag":1037,"props":2960,"children":2961},{"style":1058},[2962],{"type":998,"value":1113},{"type":993,"tag":1037,"props":2964,"children":2965},{"style":1116},[2966],{"type":998,"value":2967},"\"Your age is: ",{"type":993,"tag":1037,"props":2969,"children":2970},{"style":1064},[2971],{"type":998,"value":1124},{"type":993,"tag":1037,"props":2973,"children":2974},{"style":1052},[2975],{"type":998,"value":2976},"age",{"type":993,"tag":1037,"props":2978,"children":2979},{"style":1064},[2980],{"type":998,"value":1134},{"type":993,"tag":1037,"props":2982,"children":2983},{"style":1116},[2984],{"type":998,"value":1139},{"type":993,"tag":1037,"props":2986,"children":2987},{"style":1052},[2988],{"type":998,"value":1144},{"type":993,"tag":1037,"props":2990,"children":2991},{"class":1039,"line":109},[2992,2997],{"type":993,"tag":1037,"props":2993,"children":2994},{"style":1058},[2995],{"type":998,"value":2996},"        else",{"type":993,"tag":1037,"props":2998,"children":2999},{"style":1052},[3000],{"type":998,"value":1095},{"type":993,"tag":1037,"props":3002,"children":3003},{"class":1039,"line":118},[3004,3008,3012,3017],{"type":993,"tag":1037,"props":3005,"children":3006},{"style":1064},[3007],{"type":998,"value":2954},{"type":993,"tag":1037,"props":3009,"children":3010},{"style":1052},[3011],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3013,"children":3014},{"style":1116},[3015],{"type":998,"value":3016},"\"Age must be between 0 and 120\"",{"type":993,"tag":1037,"props":3018,"children":3019},{"style":1052},[3020],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3022,"children":3023},{"class":1039,"line":127},[3024],{"type":993,"tag":1037,"props":3025,"children":3026},{"style":1043},[3027],{"type":998,"value":3028},"            # In real code, this would continue asking for input\n",{"type":993,"tag":1037,"props":3030,"children":3031},{"class":1039,"line":136},[3032,3037],{"type":993,"tag":1037,"props":3033,"children":3034},{"style":1058},[3035],{"type":998,"value":3036},"            break",{"type":993,"tag":1037,"props":3038,"children":3039},{"style":1043},[3040],{"type":998,"value":3041},"  # Breaking for demo purposes\n",{"type":993,"tag":1037,"props":3043,"children":3044},{"class":1039,"line":146},[3045,3050,3055],{"type":993,"tag":1037,"props":3046,"children":3047},{"style":1058},[3048],{"type":998,"value":3049},"    except",{"type":993,"tag":1037,"props":3051,"children":3052},{"style":1064},[3053],{"type":998,"value":3054}," ValueError",{"type":993,"tag":1037,"props":3056,"children":3057},{"style":1052},[3058],{"type":998,"value":1095},{"type":993,"tag":1037,"props":3060,"children":3061},{"class":1039,"line":155},[3062,3066,3070,3075],{"type":993,"tag":1037,"props":3063,"children":3064},{"style":1064},[3065],{"type":998,"value":2050},{"type":993,"tag":1037,"props":3067,"children":3068},{"style":1052},[3069],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3071,"children":3072},{"style":1116},[3073],{"type":998,"value":3074},"\"Please enter a valid number\"",{"type":993,"tag":1037,"props":3076,"children":3077},{"style":1052},[3078],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3080,"children":3081},{"class":1039,"line":164},[3082],{"type":993,"tag":1037,"props":3083,"children":3084},{"style":1043},[3085],{"type":998,"value":3086},"        # In real code, this would continue asking for input\n",{"type":993,"tag":1037,"props":3088,"children":3089},{"class":1039,"line":173},[3090,3095],{"type":993,"tag":1037,"props":3091,"children":3092},{"style":1058},[3093],{"type":998,"value":3094},"        break",{"type":993,"tag":1037,"props":3096,"children":3097},{"style":1043},[3098],{"type":998,"value":3041},{"type":993,"tag":1037,"props":3100,"children":3101},{"class":1039,"line":182},[3102],{"type":993,"tag":1037,"props":3103,"children":3104},{"emptyLinePlaceholder":13},[3105],{"type":998,"value":1175},{"type":993,"tag":1037,"props":3107,"children":3108},{"class":1039,"line":191},[3109,3113,3117,3121,3125,3130],{"type":993,"tag":1037,"props":3110,"children":3111},{"style":1064},[3112],{"type":998,"value":1183},{"type":993,"tag":1037,"props":3114,"children":3115},{"style":1052},[3116],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3118,"children":3119},{"style":1116},[3120],{"type":998,"value":1139},{"type":993,"tag":1037,"props":3122,"children":3123},{"style":1064},[3124],{"type":998,"value":1851},{"type":993,"tag":1037,"props":3126,"children":3127},{"style":1116},[3128],{"type":998,"value":3129},"=== MENU VALIDATION ===\"",{"type":993,"tag":1037,"props":3131,"children":3132},{"style":1052},[3133],{"type":998,"value":3134},")  \n",{"type":993,"tag":1037,"props":3136,"children":3137},{"class":1039,"line":201},[3138,3143,3147],{"type":993,"tag":1037,"props":3139,"children":3140},{"style":1052},[3141],{"type":998,"value":3142},"valid_choice ",{"type":993,"tag":1037,"props":3144,"children":3145},{"style":1058},[3146],{"type":998,"value":1061},{"type":993,"tag":1037,"props":3148,"children":3149},{"style":1064},[3150],{"type":998,"value":1877},{"type":993,"tag":1037,"props":3152,"children":3153},{"class":1039,"line":210},[3154,3158,3162],{"type":993,"tag":1037,"props":3155,"children":3156},{"style":1058},[3157],{"type":998,"value":1075},{"type":993,"tag":1037,"props":3159,"children":3160},{"style":1058},[3161],{"type":998,"value":1976},{"type":993,"tag":1037,"props":3163,"children":3164},{"style":1052},[3165],{"type":998,"value":3166}," valid_choice:\n",{"type":993,"tag":1037,"props":3168,"children":3169},{"class":1039,"line":219},[3170,3174,3178,3183],{"type":993,"tag":1037,"props":3171,"children":3172},{"style":1064},[3173],{"type":998,"value":1103},{"type":993,"tag":1037,"props":3175,"children":3176},{"style":1052},[3177],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3179,"children":3180},{"style":1116},[3181],{"type":998,"value":3182},"\"Choose an option:\"",{"type":993,"tag":1037,"props":3184,"children":3185},{"style":1052},[3186],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3188,"children":3189},{"class":1039,"line":228},[3190,3194,3198,3203],{"type":993,"tag":1037,"props":3191,"children":3192},{"style":1064},[3193],{"type":998,"value":1103},{"type":993,"tag":1037,"props":3195,"children":3196},{"style":1052},[3197],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3199,"children":3200},{"style":1116},[3201],{"type":998,"value":3202},"\"1. Save\"",{"type":993,"tag":1037,"props":3204,"children":3205},{"style":1052},[3206],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3208,"children":3209},{"class":1039,"line":238},[3210,3214,3218,3223],{"type":993,"tag":1037,"props":3211,"children":3212},{"style":1064},[3213],{"type":998,"value":1103},{"type":993,"tag":1037,"props":3215,"children":3216},{"style":1052},[3217],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3219,"children":3220},{"style":1116},[3221],{"type":998,"value":3222},"\"2. Load\"",{"type":993,"tag":1037,"props":3224,"children":3225},{"style":1052},[3226],{"type":998,"value":3227},") \n",{"type":993,"tag":1037,"props":3229,"children":3230},{"class":1039,"line":247},[3231,3235,3239,3244],{"type":993,"tag":1037,"props":3232,"children":3233},{"style":1064},[3234],{"type":998,"value":1103},{"type":993,"tag":1037,"props":3236,"children":3237},{"style":1052},[3238],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3240,"children":3241},{"style":1116},[3242],{"type":998,"value":3243},"\"3. Quit\"",{"type":993,"tag":1037,"props":3245,"children":3246},{"style":1052},[3247],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3249,"children":3250},{"class":1039,"line":256},[3251],{"type":993,"tag":1037,"props":3252,"children":3253},{"style":1052},[3254],{"type":998,"value":3255},"    \n",{"type":993,"tag":1037,"props":3257,"children":3258},{"class":1039,"line":265},[3259,3264,3268,3273],{"type":993,"tag":1037,"props":3260,"children":3261},{"style":1052},[3262],{"type":998,"value":3263},"    choice ",{"type":993,"tag":1037,"props":3265,"children":3266},{"style":1058},[3267],{"type":998,"value":1061},{"type":993,"tag":1037,"props":3269,"children":3270},{"style":1116},[3271],{"type":998,"value":3272}," \"2\"",{"type":993,"tag":1037,"props":3274,"children":3275},{"style":1043},[3276],{"type":998,"value":3277},"  # Simulated user input\n",{"type":993,"tag":1037,"props":3279,"children":3280},{"class":1039,"line":274},[3281,3285,3290,3295,3299,3304,3308,3313,3317,3322],{"type":993,"tag":1037,"props":3282,"children":3283},{"style":1058},[3284],{"type":998,"value":2014},{"type":993,"tag":1037,"props":3286,"children":3287},{"style":1052},[3288],{"type":998,"value":3289}," choice ",{"type":993,"tag":1037,"props":3291,"children":3292},{"style":1058},[3293],{"type":998,"value":3294},"in",{"type":993,"tag":1037,"props":3296,"children":3297},{"style":1052},[3298],{"type":998,"value":1894},{"type":993,"tag":1037,"props":3300,"children":3301},{"style":1116},[3302],{"type":998,"value":3303},"\"1\"",{"type":993,"tag":1037,"props":3305,"children":3306},{"style":1052},[3307],{"type":998,"value":1613},{"type":993,"tag":1037,"props":3309,"children":3310},{"style":1116},[3311],{"type":998,"value":3312},"\"2\"",{"type":993,"tag":1037,"props":3314,"children":3315},{"style":1052},[3316],{"type":998,"value":1613},{"type":993,"tag":1037,"props":3318,"children":3319},{"style":1116},[3320],{"type":998,"value":3321},"\"3\"",{"type":993,"tag":1037,"props":3323,"children":3324},{"style":1052},[3325],{"type":998,"value":3326},"]:\n",{"type":993,"tag":1037,"props":3328,"children":3329},{"class":1039,"line":284},[3330,3335,3339],{"type":993,"tag":1037,"props":3331,"children":3332},{"style":1052},[3333],{"type":998,"value":3334},"        valid_choice ",{"type":993,"tag":1037,"props":3336,"children":3337},{"style":1058},[3338],{"type":998,"value":1061},{"type":993,"tag":1037,"props":3340,"children":3341},{"style":1064},[3342],{"type":998,"value":2101},{"type":993,"tag":1037,"props":3344,"children":3345},{"class":1039,"line":293},[3346,3351,3355,3360,3364,3368,3373,3377,3381,3385,3390,3394,3398,3402,3407],{"type":993,"tag":1037,"props":3347,"children":3348},{"style":1052},[3349],{"type":998,"value":3350},"        options ",{"type":993,"tag":1037,"props":3352,"children":3353},{"style":1058},[3354],{"type":998,"value":1061},{"type":993,"tag":1037,"props":3356,"children":3357},{"style":1052},[3358],{"type":998,"value":3359}," {",{"type":993,"tag":1037,"props":3361,"children":3362},{"style":1116},[3363],{"type":998,"value":3303},{"type":993,"tag":1037,"props":3365,"children":3366},{"style":1052},[3367],{"type":998,"value":1605},{"type":993,"tag":1037,"props":3369,"children":3370},{"style":1116},[3371],{"type":998,"value":3372},"\"Save\"",{"type":993,"tag":1037,"props":3374,"children":3375},{"style":1052},[3376],{"type":998,"value":1613},{"type":993,"tag":1037,"props":3378,"children":3379},{"style":1116},[3380],{"type":998,"value":3312},{"type":993,"tag":1037,"props":3382,"children":3383},{"style":1052},[3384],{"type":998,"value":1605},{"type":993,"tag":1037,"props":3386,"children":3387},{"style":1116},[3388],{"type":998,"value":3389},"\"Load\"",{"type":993,"tag":1037,"props":3391,"children":3392},{"style":1052},[3393],{"type":998,"value":1613},{"type":993,"tag":1037,"props":3395,"children":3396},{"style":1116},[3397],{"type":998,"value":3321},{"type":993,"tag":1037,"props":3399,"children":3400},{"style":1052},[3401],{"type":998,"value":1605},{"type":993,"tag":1037,"props":3403,"children":3404},{"style":1116},[3405],{"type":998,"value":3406},"\"Quit\"",{"type":993,"tag":1037,"props":3408,"children":3409},{"style":1052},[3410],{"type":998,"value":3411},"}\n",{"type":993,"tag":1037,"props":3413,"children":3414},{"class":1039,"line":302},[3415,3419,3423,3427,3432,3436,3441,3445,3449],{"type":993,"tag":1037,"props":3416,"children":3417},{"style":1064},[3418],{"type":998,"value":2050},{"type":993,"tag":1037,"props":3420,"children":3421},{"style":1052},[3422],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3424,"children":3425},{"style":1058},[3426],{"type":998,"value":1113},{"type":993,"tag":1037,"props":3428,"children":3429},{"style":1116},[3430],{"type":998,"value":3431},"\"You selected: ",{"type":993,"tag":1037,"props":3433,"children":3434},{"style":1064},[3435],{"type":998,"value":1124},{"type":993,"tag":1037,"props":3437,"children":3438},{"style":1052},[3439],{"type":998,"value":3440},"options[choice]",{"type":993,"tag":1037,"props":3442,"children":3443},{"style":1064},[3444],{"type":998,"value":1134},{"type":993,"tag":1037,"props":3446,"children":3447},{"style":1116},[3448],{"type":998,"value":1139},{"type":993,"tag":1037,"props":3450,"children":3451},{"style":1052},[3452],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3454,"children":3455},{"class":1039,"line":311},[3456,3461],{"type":993,"tag":1037,"props":3457,"children":3458},{"style":1058},[3459],{"type":998,"value":3460},"    else",{"type":993,"tag":1037,"props":3462,"children":3463},{"style":1052},[3464],{"type":998,"value":1095},{"type":993,"tag":1037,"props":3466,"children":3467},{"class":1039,"line":320},[3468,3472,3476,3481],{"type":993,"tag":1037,"props":3469,"children":3470},{"style":1064},[3471],{"type":998,"value":2050},{"type":993,"tag":1037,"props":3473,"children":3474},{"style":1052},[3475],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3477,"children":3478},{"style":1116},[3479],{"type":998,"value":3480},"\"Invalid choice. Please enter 1, 2, or 3.\"",{"type":993,"tag":1037,"props":3482,"children":3483},{"style":1052},[3484],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3486,"children":3487},{"class":1039,"line":329},[3488,3492],{"type":993,"tag":1037,"props":3489,"children":3490},{"style":1058},[3491],{"type":998,"value":3094},{"type":993,"tag":1037,"props":3493,"children":3494},{"style":1043},[3495],{"type":998,"value":3041},{"type":993,"tag":1198,"props":3497,"children":3499},{"id":3498},"common-while-loop-patterns",[3500],{"type":998,"value":3501},"📊 Common While Loop Patterns",{"type":993,"tag":1001,"props":3503,"children":3504},{},[3505],{"type":998,"value":3506},"There are several patterns you'll use frequently when working with while loops in different programming scenarios.",{"type":993,"tag":3508,"props":3509,"children":3510},"table",{},[3511,3535],{"type":993,"tag":3512,"props":3513,"children":3514},"thead",{},[3515],{"type":993,"tag":3516,"props":3517,"children":3518},"tr",{},[3519,3525,3530],{"type":993,"tag":3520,"props":3521,"children":3522},"th",{},[3523],{"type":998,"value":3524},"Pattern",{"type":993,"tag":3520,"props":3526,"children":3527},{},[3528],{"type":998,"value":3529},"Example",{"type":993,"tag":3520,"props":3531,"children":3532},{},[3533],{"type":998,"value":3534},"Use Case",{"type":993,"tag":3536,"props":3537,"children":3538},"tbody",{},[3539,3565,3590,3615,3640],{"type":993,"tag":3516,"props":3540,"children":3541},{},[3542,3551,3560],{"type":993,"tag":3543,"props":3544,"children":3545},"td",{},[3546],{"type":993,"tag":1012,"props":3547,"children":3548},{},[3549],{"type":998,"value":3550},"Counter Loop",{"type":993,"tag":3543,"props":3552,"children":3553},{},[3554],{"type":993,"tag":1033,"props":3555,"children":3557},{"className":3556},[],[3558],{"type":998,"value":3559},"while count \u003C 10:",{"type":993,"tag":3543,"props":3561,"children":3562},{},[3563],{"type":998,"value":3564},"Fixed number of iterations",{"type":993,"tag":3516,"props":3566,"children":3567},{},[3568,3576,3585],{"type":993,"tag":3543,"props":3569,"children":3570},{},[3571],{"type":993,"tag":1012,"props":3572,"children":3573},{},[3574],{"type":998,"value":3575},"Infinite Loop + Break",{"type":993,"tag":3543,"props":3577,"children":3578},{},[3579],{"type":993,"tag":1033,"props":3580,"children":3582},{"className":3581},[],[3583],{"type":998,"value":3584},"while True: ... break",{"type":993,"tag":3543,"props":3586,"children":3587},{},[3588],{"type":998,"value":3589},"Input validation",{"type":993,"tag":3516,"props":3591,"children":3592},{},[3593,3601,3610],{"type":993,"tag":3543,"props":3594,"children":3595},{},[3596],{"type":993,"tag":1012,"props":3597,"children":3598},{},[3599],{"type":998,"value":3600},"Flag-Controlled",{"type":993,"tag":3543,"props":3602,"children":3603},{},[3604],{"type":993,"tag":1033,"props":3605,"children":3607},{"className":3606},[],[3608],{"type":998,"value":3609},"while not done:",{"type":993,"tag":3543,"props":3611,"children":3612},{},[3613],{"type":998,"value":3614},"Event-driven processing",{"type":993,"tag":3516,"props":3616,"children":3617},{},[3618,3626,3635],{"type":993,"tag":3543,"props":3619,"children":3620},{},[3621],{"type":993,"tag":1012,"props":3622,"children":3623},{},[3624],{"type":998,"value":3625},"Sentinel Value",{"type":993,"tag":3543,"props":3627,"children":3628},{},[3629],{"type":993,"tag":1033,"props":3630,"children":3632},{"className":3631},[],[3633],{"type":998,"value":3634},"while value != -1:",{"type":993,"tag":3543,"props":3636,"children":3637},{},[3638],{"type":998,"value":3639},"Process until special value",{"type":993,"tag":3516,"props":3641,"children":3642},{},[3643,3651,3660],{"type":993,"tag":3543,"props":3644,"children":3645},{},[3646],{"type":993,"tag":1012,"props":3647,"children":3648},{},[3649],{"type":998,"value":3650},"List Processing",{"type":993,"tag":3543,"props":3652,"children":3653},{},[3654],{"type":993,"tag":1033,"props":3655,"children":3657},{"className":3656},[],[3658],{"type":998,"value":3659},"while items:",{"type":993,"tag":3543,"props":3661,"children":3662},{},[3663],{"type":998,"value":3664},"Process until collection empty",{"type":993,"tag":1023,"props":3666,"children":3667},{},[3668],{"type":993,"tag":1027,"props":3669,"children":3671},{"className":1029,"code":3670,"language":6,"meta":8,"style":8},"# Common while loop patterns\nprint(\"=== COUNTER PATTERN ===\")\ncount = 0\nwhile count \u003C 3:\n    print(f\"Count: {count}\")\n    count += 1\n\nprint(\"\\n=== INFINITE LOOP + BREAK PATTERN ===\")\nattempt = 0\nwhile True:\n    attempt += 1\n    password = \"secret\" if attempt == 2 else \"wrong\"  # Simulated input\n    \n    if password == \"secret\":\n        print(\"Access granted!\")\n        break\n    elif attempt >= 3:\n        print(\"Too many attempts!\")\n        break\n    else:\n        print(f\"Wrong password. Attempt {attempt}/3\")\n\nprint(\"\\n=== FLAG-CONTROLLED PATTERN ===\")\nprocessing = True\nitems_processed = 0\nwhile processing:\n    items_processed += 1\n    print(f\"Processing item {items_processed}\")\n    \n    if items_processed >= 3:  # Stop condition\n        processing = False\n\nprint(\"\\n=== LIST PROCESSING PATTERN ===\")\nitems = [\"apple\", \"banana\", \"cherry\"]\nwhile items:\n    item = items.pop(0)  # Remove first item\n    print(f\"Processing: {item}\")\n",[3672],{"type":993,"tag":1033,"props":3673,"children":3674},{"__ignoreMap":8},[3675,3683,3703,3718,3741,3780,3795,3802,3830,3846,3862,3878,3929,3936,3960,3980,3988,4013,4033,4040,4051,4093,4100,4128,4144,4160,4172,4188,4229,4236,4266,4282,4289,4317,4360,4372,4404],{"type":993,"tag":1037,"props":3676,"children":3677},{"class":1039,"line":12},[3678],{"type":993,"tag":1037,"props":3679,"children":3680},{"style":1043},[3681],{"type":998,"value":3682},"# Common while loop patterns\n",{"type":993,"tag":1037,"props":3684,"children":3685},{"class":1039,"line":27},[3686,3690,3694,3699],{"type":993,"tag":1037,"props":3687,"children":3688},{"style":1064},[3689],{"type":998,"value":1183},{"type":993,"tag":1037,"props":3691,"children":3692},{"style":1052},[3693],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3695,"children":3696},{"style":1116},[3697],{"type":998,"value":3698},"\"=== COUNTER PATTERN ===\"",{"type":993,"tag":1037,"props":3700,"children":3701},{"style":1052},[3702],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3704,"children":3705},{"class":1039,"line":36},[3706,3710,3714],{"type":993,"tag":1037,"props":3707,"children":3708},{"style":1052},[3709],{"type":998,"value":1055},{"type":993,"tag":1037,"props":3711,"children":3712},{"style":1058},[3713],{"type":998,"value":1061},{"type":993,"tag":1037,"props":3715,"children":3716},{"style":1064},[3717],{"type":998,"value":1957},{"type":993,"tag":1037,"props":3719,"children":3720},{"class":1039,"line":45},[3721,3725,3729,3733,3737],{"type":993,"tag":1037,"props":3722,"children":3723},{"style":1058},[3724],{"type":998,"value":1075},{"type":993,"tag":1037,"props":3726,"children":3727},{"style":1052},[3728],{"type":998,"value":1080},{"type":993,"tag":1037,"props":3730,"children":3731},{"style":1058},[3732],{"type":998,"value":1996},{"type":993,"tag":1037,"props":3734,"children":3735},{"style":1064},[3736],{"type":998,"value":1763},{"type":993,"tag":1037,"props":3738,"children":3739},{"style":1052},[3740],{"type":998,"value":1095},{"type":993,"tag":1037,"props":3742,"children":3743},{"class":1039,"line":54},[3744,3748,3752,3756,3760,3764,3768,3772,3776],{"type":993,"tag":1037,"props":3745,"children":3746},{"style":1064},[3747],{"type":998,"value":1103},{"type":993,"tag":1037,"props":3749,"children":3750},{"style":1052},[3751],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3753,"children":3754},{"style":1058},[3755],{"type":998,"value":1113},{"type":993,"tag":1037,"props":3757,"children":3758},{"style":1116},[3759],{"type":998,"value":1119},{"type":993,"tag":1037,"props":3761,"children":3762},{"style":1064},[3763],{"type":998,"value":1124},{"type":993,"tag":1037,"props":3765,"children":3766},{"style":1052},[3767],{"type":998,"value":1129},{"type":993,"tag":1037,"props":3769,"children":3770},{"style":1064},[3771],{"type":998,"value":1134},{"type":993,"tag":1037,"props":3773,"children":3774},{"style":1116},[3775],{"type":998,"value":1139},{"type":993,"tag":1037,"props":3777,"children":3778},{"style":1052},[3779],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3781,"children":3782},{"class":1039,"line":63},[3783,3787,3791],{"type":993,"tag":1037,"props":3784,"children":3785},{"style":1052},[3786],{"type":998,"value":1152},{"type":993,"tag":1037,"props":3788,"children":3789},{"style":1058},[3790],{"type":998,"value":1157},{"type":993,"tag":1037,"props":3792,"children":3793},{"style":1064},[3794],{"type":998,"value":1067},{"type":993,"tag":1037,"props":3796,"children":3797},{"class":1039,"line":72},[3798],{"type":993,"tag":1037,"props":3799,"children":3800},{"emptyLinePlaceholder":13},[3801],{"type":998,"value":1175},{"type":993,"tag":1037,"props":3803,"children":3804},{"class":1039,"line":81},[3805,3809,3813,3817,3821,3826],{"type":993,"tag":1037,"props":3806,"children":3807},{"style":1064},[3808],{"type":998,"value":1183},{"type":993,"tag":1037,"props":3810,"children":3811},{"style":1052},[3812],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3814,"children":3815},{"style":1116},[3816],{"type":998,"value":1139},{"type":993,"tag":1037,"props":3818,"children":3819},{"style":1064},[3820],{"type":998,"value":1851},{"type":993,"tag":1037,"props":3822,"children":3823},{"style":1116},[3824],{"type":998,"value":3825},"=== INFINITE LOOP + BREAK PATTERN ===\"",{"type":993,"tag":1037,"props":3827,"children":3828},{"style":1052},[3829],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3831,"children":3832},{"class":1039,"line":91},[3833,3838,3842],{"type":993,"tag":1037,"props":3834,"children":3835},{"style":1052},[3836],{"type":998,"value":3837},"attempt ",{"type":993,"tag":1037,"props":3839,"children":3840},{"style":1058},[3841],{"type":998,"value":1061},{"type":993,"tag":1037,"props":3843,"children":3844},{"style":1064},[3845],{"type":998,"value":1957},{"type":993,"tag":1037,"props":3847,"children":3848},{"class":1039,"line":100},[3849,3853,3858],{"type":993,"tag":1037,"props":3850,"children":3851},{"style":1058},[3852],{"type":998,"value":1075},{"type":993,"tag":1037,"props":3854,"children":3855},{"style":1064},[3856],{"type":998,"value":3857}," True",{"type":993,"tag":1037,"props":3859,"children":3860},{"style":1052},[3861],{"type":998,"value":1095},{"type":993,"tag":1037,"props":3863,"children":3864},{"class":1039,"line":109},[3865,3870,3874],{"type":993,"tag":1037,"props":3866,"children":3867},{"style":1052},[3868],{"type":998,"value":3869},"    attempt ",{"type":993,"tag":1037,"props":3871,"children":3872},{"style":1058},[3873],{"type":998,"value":1157},{"type":993,"tag":1037,"props":3875,"children":3876},{"style":1064},[3877],{"type":998,"value":1067},{"type":993,"tag":1037,"props":3879,"children":3880},{"class":1039,"line":118},[3881,3886,3890,3895,3900,3905,3910,3914,3919,3924],{"type":993,"tag":1037,"props":3882,"children":3883},{"style":1052},[3884],{"type":998,"value":3885},"    password ",{"type":993,"tag":1037,"props":3887,"children":3888},{"style":1058},[3889],{"type":998,"value":1061},{"type":993,"tag":1037,"props":3891,"children":3892},{"style":1116},[3893],{"type":998,"value":3894}," \"secret\"",{"type":993,"tag":1037,"props":3896,"children":3897},{"style":1058},[3898],{"type":998,"value":3899}," if",{"type":993,"tag":1037,"props":3901,"children":3902},{"style":1052},[3903],{"type":998,"value":3904}," attempt ",{"type":993,"tag":1037,"props":3906,"children":3907},{"style":1058},[3908],{"type":998,"value":3909},"==",{"type":993,"tag":1037,"props":3911,"children":3912},{"style":1064},[3913],{"type":998,"value":2029},{"type":993,"tag":1037,"props":3915,"children":3916},{"style":1058},[3917],{"type":998,"value":3918}," else",{"type":993,"tag":1037,"props":3920,"children":3921},{"style":1116},[3922],{"type":998,"value":3923}," \"wrong\"",{"type":993,"tag":1037,"props":3925,"children":3926},{"style":1043},[3927],{"type":998,"value":3928},"  # Simulated input\n",{"type":993,"tag":1037,"props":3930,"children":3931},{"class":1039,"line":127},[3932],{"type":993,"tag":1037,"props":3933,"children":3934},{"style":1052},[3935],{"type":998,"value":3255},{"type":993,"tag":1037,"props":3937,"children":3938},{"class":1039,"line":136},[3939,3943,3948,3952,3956],{"type":993,"tag":1037,"props":3940,"children":3941},{"style":1058},[3942],{"type":998,"value":2014},{"type":993,"tag":1037,"props":3944,"children":3945},{"style":1052},[3946],{"type":998,"value":3947}," password ",{"type":993,"tag":1037,"props":3949,"children":3950},{"style":1058},[3951],{"type":998,"value":3909},{"type":993,"tag":1037,"props":3953,"children":3954},{"style":1116},[3955],{"type":998,"value":3894},{"type":993,"tag":1037,"props":3957,"children":3958},{"style":1052},[3959],{"type":998,"value":1095},{"type":993,"tag":1037,"props":3961,"children":3962},{"class":1039,"line":146},[3963,3967,3971,3976],{"type":993,"tag":1037,"props":3964,"children":3965},{"style":1064},[3966],{"type":998,"value":2050},{"type":993,"tag":1037,"props":3968,"children":3969},{"style":1052},[3970],{"type":998,"value":1108},{"type":993,"tag":1037,"props":3972,"children":3973},{"style":1116},[3974],{"type":998,"value":3975},"\"Access granted!\"",{"type":993,"tag":1037,"props":3977,"children":3978},{"style":1052},[3979],{"type":998,"value":1144},{"type":993,"tag":1037,"props":3981,"children":3982},{"class":1039,"line":155},[3983],{"type":993,"tag":1037,"props":3984,"children":3985},{"style":1058},[3986],{"type":998,"value":3987},"        break\n",{"type":993,"tag":1037,"props":3989,"children":3990},{"class":1039,"line":164},[3991,3996,4000,4005,4009],{"type":993,"tag":1037,"props":3992,"children":3993},{"style":1058},[3994],{"type":998,"value":3995},"    elif",{"type":993,"tag":1037,"props":3997,"children":3998},{"style":1052},[3999],{"type":998,"value":3904},{"type":993,"tag":1037,"props":4001,"children":4002},{"style":1058},[4003],{"type":998,"value":4004},">=",{"type":993,"tag":1037,"props":4006,"children":4007},{"style":1064},[4008],{"type":998,"value":1763},{"type":993,"tag":1037,"props":4010,"children":4011},{"style":1052},[4012],{"type":998,"value":1095},{"type":993,"tag":1037,"props":4014,"children":4015},{"class":1039,"line":173},[4016,4020,4024,4029],{"type":993,"tag":1037,"props":4017,"children":4018},{"style":1064},[4019],{"type":998,"value":2050},{"type":993,"tag":1037,"props":4021,"children":4022},{"style":1052},[4023],{"type":998,"value":1108},{"type":993,"tag":1037,"props":4025,"children":4026},{"style":1116},[4027],{"type":998,"value":4028},"\"Too many attempts!\"",{"type":993,"tag":1037,"props":4030,"children":4031},{"style":1052},[4032],{"type":998,"value":1144},{"type":993,"tag":1037,"props":4034,"children":4035},{"class":1039,"line":182},[4036],{"type":993,"tag":1037,"props":4037,"children":4038},{"style":1058},[4039],{"type":998,"value":3987},{"type":993,"tag":1037,"props":4041,"children":4042},{"class":1039,"line":191},[4043,4047],{"type":993,"tag":1037,"props":4044,"children":4045},{"style":1058},[4046],{"type":998,"value":3460},{"type":993,"tag":1037,"props":4048,"children":4049},{"style":1052},[4050],{"type":998,"value":1095},{"type":993,"tag":1037,"props":4052,"children":4053},{"class":1039,"line":201},[4054,4058,4062,4066,4071,4075,4080,4084,4089],{"type":993,"tag":1037,"props":4055,"children":4056},{"style":1064},[4057],{"type":998,"value":2050},{"type":993,"tag":1037,"props":4059,"children":4060},{"style":1052},[4061],{"type":998,"value":1108},{"type":993,"tag":1037,"props":4063,"children":4064},{"style":1058},[4065],{"type":998,"value":1113},{"type":993,"tag":1037,"props":4067,"children":4068},{"style":1116},[4069],{"type":998,"value":4070},"\"Wrong password. Attempt ",{"type":993,"tag":1037,"props":4072,"children":4073},{"style":1064},[4074],{"type":998,"value":1124},{"type":993,"tag":1037,"props":4076,"children":4077},{"style":1052},[4078],{"type":998,"value":4079},"attempt",{"type":993,"tag":1037,"props":4081,"children":4082},{"style":1064},[4083],{"type":998,"value":1134},{"type":993,"tag":1037,"props":4085,"children":4086},{"style":1116},[4087],{"type":998,"value":4088},"/3\"",{"type":993,"tag":1037,"props":4090,"children":4091},{"style":1052},[4092],{"type":998,"value":1144},{"type":993,"tag":1037,"props":4094,"children":4095},{"class":1039,"line":210},[4096],{"type":993,"tag":1037,"props":4097,"children":4098},{"emptyLinePlaceholder":13},[4099],{"type":998,"value":1175},{"type":993,"tag":1037,"props":4101,"children":4102},{"class":1039,"line":219},[4103,4107,4111,4115,4119,4124],{"type":993,"tag":1037,"props":4104,"children":4105},{"style":1064},[4106],{"type":998,"value":1183},{"type":993,"tag":1037,"props":4108,"children":4109},{"style":1052},[4110],{"type":998,"value":1108},{"type":993,"tag":1037,"props":4112,"children":4113},{"style":1116},[4114],{"type":998,"value":1139},{"type":993,"tag":1037,"props":4116,"children":4117},{"style":1064},[4118],{"type":998,"value":1851},{"type":993,"tag":1037,"props":4120,"children":4121},{"style":1116},[4122],{"type":998,"value":4123},"=== FLAG-CONTROLLED PATTERN ===\"",{"type":993,"tag":1037,"props":4125,"children":4126},{"style":1052},[4127],{"type":998,"value":1144},{"type":993,"tag":1037,"props":4129,"children":4130},{"class":1039,"line":228},[4131,4136,4140],{"type":993,"tag":1037,"props":4132,"children":4133},{"style":1052},[4134],{"type":998,"value":4135},"processing ",{"type":993,"tag":1037,"props":4137,"children":4138},{"style":1058},[4139],{"type":998,"value":1061},{"type":993,"tag":1037,"props":4141,"children":4142},{"style":1064},[4143],{"type":998,"value":2101},{"type":993,"tag":1037,"props":4145,"children":4146},{"class":1039,"line":238},[4147,4152,4156],{"type":993,"tag":1037,"props":4148,"children":4149},{"style":1052},[4150],{"type":998,"value":4151},"items_processed ",{"type":993,"tag":1037,"props":4153,"children":4154},{"style":1058},[4155],{"type":998,"value":1061},{"type":993,"tag":1037,"props":4157,"children":4158},{"style":1064},[4159],{"type":998,"value":1957},{"type":993,"tag":1037,"props":4161,"children":4162},{"class":1039,"line":247},[4163,4167],{"type":993,"tag":1037,"props":4164,"children":4165},{"style":1058},[4166],{"type":998,"value":1075},{"type":993,"tag":1037,"props":4168,"children":4169},{"style":1052},[4170],{"type":998,"value":4171}," processing:\n",{"type":993,"tag":1037,"props":4173,"children":4174},{"class":1039,"line":256},[4175,4180,4184],{"type":993,"tag":1037,"props":4176,"children":4177},{"style":1052},[4178],{"type":998,"value":4179},"    items_processed ",{"type":993,"tag":1037,"props":4181,"children":4182},{"style":1058},[4183],{"type":998,"value":1157},{"type":993,"tag":1037,"props":4185,"children":4186},{"style":1064},[4187],{"type":998,"value":1067},{"type":993,"tag":1037,"props":4189,"children":4190},{"class":1039,"line":265},[4191,4195,4199,4203,4208,4212,4217,4221,4225],{"type":993,"tag":1037,"props":4192,"children":4193},{"style":1064},[4194],{"type":998,"value":1103},{"type":993,"tag":1037,"props":4196,"children":4197},{"style":1052},[4198],{"type":998,"value":1108},{"type":993,"tag":1037,"props":4200,"children":4201},{"style":1058},[4202],{"type":998,"value":1113},{"type":993,"tag":1037,"props":4204,"children":4205},{"style":1116},[4206],{"type":998,"value":4207},"\"Processing item ",{"type":993,"tag":1037,"props":4209,"children":4210},{"style":1064},[4211],{"type":998,"value":1124},{"type":993,"tag":1037,"props":4213,"children":4214},{"style":1052},[4215],{"type":998,"value":4216},"items_processed",{"type":993,"tag":1037,"props":4218,"children":4219},{"style":1064},[4220],{"type":998,"value":1134},{"type":993,"tag":1037,"props":4222,"children":4223},{"style":1116},[4224],{"type":998,"value":1139},{"type":993,"tag":1037,"props":4226,"children":4227},{"style":1052},[4228],{"type":998,"value":1144},{"type":993,"tag":1037,"props":4230,"children":4231},{"class":1039,"line":274},[4232],{"type":993,"tag":1037,"props":4233,"children":4234},{"style":1052},[4235],{"type":998,"value":3255},{"type":993,"tag":1037,"props":4237,"children":4238},{"class":1039,"line":284},[4239,4243,4248,4252,4256,4261],{"type":993,"tag":1037,"props":4240,"children":4241},{"style":1058},[4242],{"type":998,"value":2014},{"type":993,"tag":1037,"props":4244,"children":4245},{"style":1052},[4246],{"type":998,"value":4247}," items_processed ",{"type":993,"tag":1037,"props":4249,"children":4250},{"style":1058},[4251],{"type":998,"value":4004},{"type":993,"tag":1037,"props":4253,"children":4254},{"style":1064},[4255],{"type":998,"value":1763},{"type":993,"tag":1037,"props":4257,"children":4258},{"style":1052},[4259],{"type":998,"value":4260},":  ",{"type":993,"tag":1037,"props":4262,"children":4263},{"style":1043},[4264],{"type":998,"value":4265},"# Stop condition\n",{"type":993,"tag":1037,"props":4267,"children":4268},{"class":1039,"line":293},[4269,4274,4278],{"type":993,"tag":1037,"props":4270,"children":4271},{"style":1052},[4272],{"type":998,"value":4273},"        processing ",{"type":993,"tag":1037,"props":4275,"children":4276},{"style":1058},[4277],{"type":998,"value":1061},{"type":993,"tag":1037,"props":4279,"children":4280},{"style":1064},[4281],{"type":998,"value":1877},{"type":993,"tag":1037,"props":4283,"children":4284},{"class":1039,"line":302},[4285],{"type":993,"tag":1037,"props":4286,"children":4287},{"emptyLinePlaceholder":13},[4288],{"type":998,"value":1175},{"type":993,"tag":1037,"props":4290,"children":4291},{"class":1039,"line":311},[4292,4296,4300,4304,4308,4313],{"type":993,"tag":1037,"props":4293,"children":4294},{"style":1064},[4295],{"type":998,"value":1183},{"type":993,"tag":1037,"props":4297,"children":4298},{"style":1052},[4299],{"type":998,"value":1108},{"type":993,"tag":1037,"props":4301,"children":4302},{"style":1116},[4303],{"type":998,"value":1139},{"type":993,"tag":1037,"props":4305,"children":4306},{"style":1064},[4307],{"type":998,"value":1851},{"type":993,"tag":1037,"props":4309,"children":4310},{"style":1116},[4311],{"type":998,"value":4312},"=== LIST PROCESSING PATTERN ===\"",{"type":993,"tag":1037,"props":4314,"children":4315},{"style":1052},[4316],{"type":998,"value":1144},{"type":993,"tag":1037,"props":4318,"children":4319},{"class":1039,"line":320},[4320,4325,4329,4333,4338,4342,4347,4351,4356],{"type":993,"tag":1037,"props":4321,"children":4322},{"style":1052},[4323],{"type":998,"value":4324},"items ",{"type":993,"tag":1037,"props":4326,"children":4327},{"style":1058},[4328],{"type":998,"value":1061},{"type":993,"tag":1037,"props":4330,"children":4331},{"style":1052},[4332],{"type":998,"value":1894},{"type":993,"tag":1037,"props":4334,"children":4335},{"style":1116},[4336],{"type":998,"value":4337},"\"apple\"",{"type":993,"tag":1037,"props":4339,"children":4340},{"style":1052},[4341],{"type":998,"value":1613},{"type":993,"tag":1037,"props":4343,"children":4344},{"style":1116},[4345],{"type":998,"value":4346},"\"banana\"",{"type":993,"tag":1037,"props":4348,"children":4349},{"style":1052},[4350],{"type":998,"value":1613},{"type":993,"tag":1037,"props":4352,"children":4353},{"style":1116},[4354],{"type":998,"value":4355},"\"cherry\"",{"type":993,"tag":1037,"props":4357,"children":4358},{"style":1052},[4359],{"type":998,"value":1940},{"type":993,"tag":1037,"props":4361,"children":4362},{"class":1039,"line":329},[4363,4367],{"type":993,"tag":1037,"props":4364,"children":4365},{"style":1058},[4366],{"type":998,"value":1075},{"type":993,"tag":1037,"props":4368,"children":4369},{"style":1052},[4370],{"type":998,"value":4371}," items:\n",{"type":993,"tag":1037,"props":4373,"children":4374},{"class":1039,"line":338},[4375,4380,4384,4389,4394,4399],{"type":993,"tag":1037,"props":4376,"children":4377},{"style":1052},[4378],{"type":998,"value":4379},"    item ",{"type":993,"tag":1037,"props":4381,"children":4382},{"style":1058},[4383],{"type":998,"value":1061},{"type":993,"tag":1037,"props":4385,"children":4386},{"style":1052},[4387],{"type":998,"value":4388}," items.pop(",{"type":993,"tag":1037,"props":4390,"children":4391},{"style":1064},[4392],{"type":998,"value":4393},"0",{"type":993,"tag":1037,"props":4395,"children":4396},{"style":1052},[4397],{"type":998,"value":4398},")  ",{"type":993,"tag":1037,"props":4400,"children":4401},{"style":1043},[4402],{"type":998,"value":4403},"# Remove first item\n",{"type":993,"tag":1037,"props":4405,"children":4406},{"class":1039,"line":347},[4407,4411,4415,4419,4424,4428,4433,4437,4441],{"type":993,"tag":1037,"props":4408,"children":4409},{"style":1064},[4410],{"type":998,"value":1103},{"type":993,"tag":1037,"props":4412,"children":4413},{"style":1052},[4414],{"type":998,"value":1108},{"type":993,"tag":1037,"props":4416,"children":4417},{"style":1058},[4418],{"type":998,"value":1113},{"type":993,"tag":1037,"props":4420,"children":4421},{"style":1116},[4422],{"type":998,"value":4423},"\"Processing: ",{"type":993,"tag":1037,"props":4425,"children":4426},{"style":1064},[4427],{"type":998,"value":1124},{"type":993,"tag":1037,"props":4429,"children":4430},{"style":1052},[4431],{"type":998,"value":4432},"item",{"type":993,"tag":1037,"props":4434,"children":4435},{"style":1064},[4436],{"type":998,"value":1134},{"type":993,"tag":1037,"props":4438,"children":4439},{"style":1116},[4440],{"type":998,"value":1139},{"type":993,"tag":1037,"props":4442,"children":4443},{"style":1052},[4444],{"type":998,"value":1144},{"type":993,"tag":1198,"props":4446,"children":4448},{"id":4447},"loop-control-with-break-and-continue",[4449],{"type":998,"value":4450},"⚡ Loop Control with Break and Continue",{"type":993,"tag":1001,"props":4452,"children":4453},{},[4454,4456,4462,4464,4470],{"type":998,"value":4455},"While loops can be controlled using ",{"type":993,"tag":1033,"props":4457,"children":4459},{"className":4458},[],[4460],{"type":998,"value":4461},"break",{"type":998,"value":4463}," and ",{"type":993,"tag":1033,"props":4465,"children":4467},{"className":4466},[],[4468],{"type":998,"value":4469},"continue",{"type":998,"value":4471}," statements, providing fine-grained control over loop execution flow.",{"type":993,"tag":1217,"props":4473,"children":4476},{"emoji":4474,"title":4475,"type":1221},"⚡","Loop Control Statements",[4477,4485,4528,4536,4592,4601],{"type":993,"tag":1001,"props":4478,"children":4479},{},[4480],{"type":993,"tag":1012,"props":4481,"children":4482},{},[4483],{"type":998,"value":4484},"Control Statements:",{"type":993,"tag":1232,"props":4486,"children":4487},{},[4488,4501,4514],{"type":993,"tag":1236,"props":4489,"children":4490},{},[4491,4499],{"type":993,"tag":1012,"props":4492,"children":4493},{},[4494],{"type":993,"tag":1033,"props":4495,"children":4497},{"className":4496},[],[4498],{"type":998,"value":4461},{"type":998,"value":4500},": Immediately exit the loop",{"type":993,"tag":1236,"props":4502,"children":4503},{},[4504,4512],{"type":993,"tag":1012,"props":4505,"children":4506},{},[4507],{"type":993,"tag":1033,"props":4508,"children":4510},{"className":4509},[],[4511],{"type":998,"value":4469},{"type":998,"value":4513},": Skip rest of current iteration, go to next",{"type":993,"tag":1236,"props":4515,"children":4516},{},[4517,4526],{"type":993,"tag":1012,"props":4518,"children":4519},{},[4520],{"type":993,"tag":1033,"props":4521,"children":4523},{"className":4522},[],[4524],{"type":998,"value":4525},"else",{"type":998,"value":4527},": Execute when loop completes normally (no break)",{"type":993,"tag":1001,"props":4529,"children":4530},{},[4531],{"type":993,"tag":1012,"props":4532,"children":4533},{},[4534],{"type":998,"value":4535},"Usage Guidelines:",{"type":993,"tag":1232,"props":4537,"children":4538},{},[4539,4554,4568,4582],{"type":993,"tag":1236,"props":4540,"children":4541},{},[4542,4544,4552],{"type":998,"value":4543},"Use ",{"type":993,"tag":1012,"props":4545,"children":4546},{},[4547],{"type":993,"tag":1033,"props":4548,"children":4550},{"className":4549},[],[4551],{"type":998,"value":4461},{"type":998,"value":4553}," for early termination conditions",{"type":993,"tag":1236,"props":4555,"children":4556},{},[4557,4558,4566],{"type":998,"value":4543},{"type":993,"tag":1012,"props":4559,"children":4560},{},[4561],{"type":993,"tag":1033,"props":4562,"children":4564},{"className":4563},[],[4565],{"type":998,"value":4469},{"type":998,"value":4567}," to skip invalid data or conditions",{"type":993,"tag":1236,"props":4569,"children":4570},{},[4571,4572,4580],{"type":998,"value":4543},{"type":993,"tag":1012,"props":4573,"children":4574},{},[4575],{"type":993,"tag":1033,"props":4576,"children":4578},{"className":4577},[],[4579],{"type":998,"value":4525},{"type":998,"value":4581}," for cleanup or completion actions",{"type":993,"tag":1236,"props":4583,"children":4584},{},[4585,4590],{"type":993,"tag":1012,"props":4586,"children":4587},{},[4588],{"type":998,"value":4589},"Avoid overusing",{"type":998,"value":4591}," control statements for readability",{"type":993,"tag":1001,"props":4593,"children":4594},{},[4595,4599],{"type":993,"tag":1012,"props":4596,"children":4597},{},[4598],{"type":998,"value":1671},{"type":998,"value":4600}," Clear logic flow, minimal nesting, meaningful conditions",{"type":993,"tag":1001,"props":4602,"children":4603},{},[4604,4609],{"type":993,"tag":1012,"props":4605,"children":4606},{},[4607],{"type":998,"value":4608},"Performance:",{"type":998,"value":4610}," Control statements can improve efficiency by avoiding unnecessary work",{"type":993,"tag":1001,"props":4612,"children":4613},{},[4614,4616,4624],{"type":998,"value":4615},"These control statements work with ",{"type":993,"tag":1012,"props":4617,"children":4618},{},[4619],{"type":993,"tag":1016,"props":4620,"children":4621},{"href":197},[4622],{"type":998,"value":4623},"conditional logic",{"type":998,"value":4625}," to create sophisticated loop behavior.",{"type":993,"tag":1023,"props":4627,"children":4628},{},[4629],{"type":993,"tag":1027,"props":4630,"children":4632},{"className":1029,"code":4631,"language":6,"meta":8,"style":8},"# Loop control examples\nprint(\"=== BREAK EXAMPLE ===\")\ni = 0\nwhile i \u003C 10:\n    i += 1\n    if i == 2:\n        continue  # Skip when i is 2\n    if i == 5:\n        break     # Exit when i is 5\n    print(i)\n\nprint(\"\\n=== WHILE-ELSE EXAMPLE ===\")\n# Using else with while loop\ntarget = 7\nnum = 1\nwhile num \u003C= 5:\n    if num == target:\n        print(f\"Found {target}!\")\n        break\n    num += 1\nelse:\n    print(f\"{target} not found\")  # Executes because loop completed normally\n",[4633],{"type":993,"tag":1033,"props":4634,"children":4635},{"__ignoreMap":8},[4636,4644,4664,4679,4702,4717,4740,4753,4776,4788,4800,4807,4835,4843,4860,4876,4900,4920,4962,4969,4985,4996],{"type":993,"tag":1037,"props":4637,"children":4638},{"class":1039,"line":12},[4639],{"type":993,"tag":1037,"props":4640,"children":4641},{"style":1043},[4642],{"type":998,"value":4643},"# Loop control examples\n",{"type":993,"tag":1037,"props":4645,"children":4646},{"class":1039,"line":27},[4647,4651,4655,4660],{"type":993,"tag":1037,"props":4648,"children":4649},{"style":1064},[4650],{"type":998,"value":1183},{"type":993,"tag":1037,"props":4652,"children":4653},{"style":1052},[4654],{"type":998,"value":1108},{"type":993,"tag":1037,"props":4656,"children":4657},{"style":1116},[4658],{"type":998,"value":4659},"\"=== BREAK EXAMPLE ===\"",{"type":993,"tag":1037,"props":4661,"children":4662},{"style":1052},[4663],{"type":998,"value":1144},{"type":993,"tag":1037,"props":4665,"children":4666},{"class":1039,"line":36},[4667,4671,4675],{"type":993,"tag":1037,"props":4668,"children":4669},{"style":1052},[4670],{"type":998,"value":1734},{"type":993,"tag":1037,"props":4672,"children":4673},{"style":1058},[4674],{"type":998,"value":1061},{"type":993,"tag":1037,"props":4676,"children":4677},{"style":1064},[4678],{"type":998,"value":1957},{"type":993,"tag":1037,"props":4680,"children":4681},{"class":1039,"line":45},[4682,4686,4690,4694,4698],{"type":993,"tag":1037,"props":4683,"children":4684},{"style":1058},[4685],{"type":998,"value":1075},{"type":993,"tag":1037,"props":4687,"children":4688},{"style":1052},[4689],{"type":998,"value":1754},{"type":993,"tag":1037,"props":4691,"children":4692},{"style":1058},[4693],{"type":998,"value":1996},{"type":993,"tag":1037,"props":4695,"children":4696},{"style":1064},[4697],{"type":998,"value":2487},{"type":993,"tag":1037,"props":4699,"children":4700},{"style":1052},[4701],{"type":998,"value":1095},{"type":993,"tag":1037,"props":4703,"children":4704},{"class":1039,"line":54},[4705,4709,4713],{"type":993,"tag":1037,"props":4706,"children":4707},{"style":1052},[4708],{"type":998,"value":1816},{"type":993,"tag":1037,"props":4710,"children":4711},{"style":1058},[4712],{"type":998,"value":1157},{"type":993,"tag":1037,"props":4714,"children":4715},{"style":1064},[4716],{"type":998,"value":1067},{"type":993,"tag":1037,"props":4718,"children":4719},{"class":1039,"line":63},[4720,4724,4728,4732,4736],{"type":993,"tag":1037,"props":4721,"children":4722},{"style":1058},[4723],{"type":998,"value":2014},{"type":993,"tag":1037,"props":4725,"children":4726},{"style":1052},[4727],{"type":998,"value":1754},{"type":993,"tag":1037,"props":4729,"children":4730},{"style":1058},[4731],{"type":998,"value":3909},{"type":993,"tag":1037,"props":4733,"children":4734},{"style":1064},[4735],{"type":998,"value":2029},{"type":993,"tag":1037,"props":4737,"children":4738},{"style":1052},[4739],{"type":998,"value":1095},{"type":993,"tag":1037,"props":4741,"children":4742},{"class":1039,"line":72},[4743,4748],{"type":993,"tag":1037,"props":4744,"children":4745},{"style":1058},[4746],{"type":998,"value":4747},"        continue",{"type":993,"tag":1037,"props":4749,"children":4750},{"style":1043},[4751],{"type":998,"value":4752},"  # Skip when i is 2\n",{"type":993,"tag":1037,"props":4754,"children":4755},{"class":1039,"line":81},[4756,4760,4764,4768,4772],{"type":993,"tag":1037,"props":4757,"children":4758},{"style":1058},[4759],{"type":998,"value":2014},{"type":993,"tag":1037,"props":4761,"children":4762},{"style":1052},[4763],{"type":998,"value":1754},{"type":993,"tag":1037,"props":4765,"children":4766},{"style":1058},[4767],{"type":998,"value":3909},{"type":993,"tag":1037,"props":4769,"children":4770},{"style":1064},[4771],{"type":998,"value":1090},{"type":993,"tag":1037,"props":4773,"children":4774},{"style":1052},[4775],{"type":998,"value":1095},{"type":993,"tag":1037,"props":4777,"children":4778},{"class":1039,"line":91},[4779,4783],{"type":993,"tag":1037,"props":4780,"children":4781},{"style":1058},[4782],{"type":998,"value":3094},{"type":993,"tag":1037,"props":4784,"children":4785},{"style":1043},[4786],{"type":998,"value":4787},"     # Exit when i is 5\n",{"type":993,"tag":1037,"props":4789,"children":4790},{"class":1039,"line":100},[4791,4795],{"type":993,"tag":1037,"props":4792,"children":4793},{"style":1064},[4794],{"type":998,"value":1103},{"type":993,"tag":1037,"props":4796,"children":4797},{"style":1052},[4798],{"type":998,"value":4799},"(i)\n",{"type":993,"tag":1037,"props":4801,"children":4802},{"class":1039,"line":109},[4803],{"type":993,"tag":1037,"props":4804,"children":4805},{"emptyLinePlaceholder":13},[4806],{"type":998,"value":1175},{"type":993,"tag":1037,"props":4808,"children":4809},{"class":1039,"line":118},[4810,4814,4818,4822,4826,4831],{"type":993,"tag":1037,"props":4811,"children":4812},{"style":1064},[4813],{"type":998,"value":1183},{"type":993,"tag":1037,"props":4815,"children":4816},{"style":1052},[4817],{"type":998,"value":1108},{"type":993,"tag":1037,"props":4819,"children":4820},{"style":1116},[4821],{"type":998,"value":1139},{"type":993,"tag":1037,"props":4823,"children":4824},{"style":1064},[4825],{"type":998,"value":1851},{"type":993,"tag":1037,"props":4827,"children":4828},{"style":1116},[4829],{"type":998,"value":4830},"=== WHILE-ELSE EXAMPLE ===\"",{"type":993,"tag":1037,"props":4832,"children":4833},{"style":1052},[4834],{"type":998,"value":1144},{"type":993,"tag":1037,"props":4836,"children":4837},{"class":1039,"line":127},[4838],{"type":993,"tag":1037,"props":4839,"children":4840},{"style":1043},[4841],{"type":998,"value":4842},"# Using else with while loop\n",{"type":993,"tag":1037,"props":4844,"children":4845},{"class":1039,"line":136},[4846,4851,4855],{"type":993,"tag":1037,"props":4847,"children":4848},{"style":1052},[4849],{"type":998,"value":4850},"target ",{"type":993,"tag":1037,"props":4852,"children":4853},{"style":1058},[4854],{"type":998,"value":1061},{"type":993,"tag":1037,"props":4856,"children":4857},{"style":1064},[4858],{"type":998,"value":4859}," 7\n",{"type":993,"tag":1037,"props":4861,"children":4862},{"class":1039,"line":146},[4863,4868,4872],{"type":993,"tag":1037,"props":4864,"children":4865},{"style":1052},[4866],{"type":998,"value":4867},"num ",{"type":993,"tag":1037,"props":4869,"children":4870},{"style":1058},[4871],{"type":998,"value":1061},{"type":993,"tag":1037,"props":4873,"children":4874},{"style":1064},[4875],{"type":998,"value":1067},{"type":993,"tag":1037,"props":4877,"children":4878},{"class":1039,"line":155},[4879,4883,4888,4892,4896],{"type":993,"tag":1037,"props":4880,"children":4881},{"style":1058},[4882],{"type":998,"value":1075},{"type":993,"tag":1037,"props":4884,"children":4885},{"style":1052},[4886],{"type":998,"value":4887}," num ",{"type":993,"tag":1037,"props":4889,"children":4890},{"style":1058},[4891],{"type":998,"value":1085},{"type":993,"tag":1037,"props":4893,"children":4894},{"style":1064},[4895],{"type":998,"value":1090},{"type":993,"tag":1037,"props":4897,"children":4898},{"style":1052},[4899],{"type":998,"value":1095},{"type":993,"tag":1037,"props":4901,"children":4902},{"class":1039,"line":164},[4903,4907,4911,4915],{"type":993,"tag":1037,"props":4904,"children":4905},{"style":1058},[4906],{"type":998,"value":2014},{"type":993,"tag":1037,"props":4908,"children":4909},{"style":1052},[4910],{"type":998,"value":4887},{"type":993,"tag":1037,"props":4912,"children":4913},{"style":1058},[4914],{"type":998,"value":3909},{"type":993,"tag":1037,"props":4916,"children":4917},{"style":1052},[4918],{"type":998,"value":4919}," target:\n",{"type":993,"tag":1037,"props":4921,"children":4922},{"class":1039,"line":173},[4923,4927,4931,4935,4940,4944,4949,4953,4958],{"type":993,"tag":1037,"props":4924,"children":4925},{"style":1064},[4926],{"type":998,"value":2050},{"type":993,"tag":1037,"props":4928,"children":4929},{"style":1052},[4930],{"type":998,"value":1108},{"type":993,"tag":1037,"props":4932,"children":4933},{"style":1058},[4934],{"type":998,"value":1113},{"type":993,"tag":1037,"props":4936,"children":4937},{"style":1116},[4938],{"type":998,"value":4939},"\"Found ",{"type":993,"tag":1037,"props":4941,"children":4942},{"style":1064},[4943],{"type":998,"value":1124},{"type":993,"tag":1037,"props":4945,"children":4946},{"style":1052},[4947],{"type":998,"value":4948},"target",{"type":993,"tag":1037,"props":4950,"children":4951},{"style":1064},[4952],{"type":998,"value":1134},{"type":993,"tag":1037,"props":4954,"children":4955},{"style":1116},[4956],{"type":998,"value":4957},"!\"",{"type":993,"tag":1037,"props":4959,"children":4960},{"style":1052},[4961],{"type":998,"value":1144},{"type":993,"tag":1037,"props":4963,"children":4964},{"class":1039,"line":182},[4965],{"type":993,"tag":1037,"props":4966,"children":4967},{"style":1058},[4968],{"type":998,"value":3987},{"type":993,"tag":1037,"props":4970,"children":4971},{"class":1039,"line":191},[4972,4977,4981],{"type":993,"tag":1037,"props":4973,"children":4974},{"style":1052},[4975],{"type":998,"value":4976},"    num ",{"type":993,"tag":1037,"props":4978,"children":4979},{"style":1058},[4980],{"type":998,"value":1157},{"type":993,"tag":1037,"props":4982,"children":4983},{"style":1064},[4984],{"type":998,"value":1067},{"type":993,"tag":1037,"props":4986,"children":4987},{"class":1039,"line":201},[4988,4992],{"type":993,"tag":1037,"props":4989,"children":4990},{"style":1058},[4991],{"type":998,"value":4525},{"type":993,"tag":1037,"props":4993,"children":4994},{"style":1052},[4995],{"type":998,"value":1095},{"type":993,"tag":1037,"props":4997,"children":4998},{"class":1039,"line":210},[4999,5003,5007,5011,5015,5019,5023,5027,5032,5036],{"type":993,"tag":1037,"props":5000,"children":5001},{"style":1064},[5002],{"type":998,"value":1103},{"type":993,"tag":1037,"props":5004,"children":5005},{"style":1052},[5006],{"type":998,"value":1108},{"type":993,"tag":1037,"props":5008,"children":5009},{"style":1058},[5010],{"type":998,"value":1113},{"type":993,"tag":1037,"props":5012,"children":5013},{"style":1116},[5014],{"type":998,"value":1139},{"type":993,"tag":1037,"props":5016,"children":5017},{"style":1064},[5018],{"type":998,"value":1124},{"type":993,"tag":1037,"props":5020,"children":5021},{"style":1052},[5022],{"type":998,"value":4948},{"type":993,"tag":1037,"props":5024,"children":5025},{"style":1064},[5026],{"type":998,"value":1134},{"type":993,"tag":1037,"props":5028,"children":5029},{"style":1116},[5030],{"type":998,"value":5031}," not found\"",{"type":993,"tag":1037,"props":5033,"children":5034},{"style":1052},[5035],{"type":998,"value":4398},{"type":993,"tag":1037,"props":5037,"children":5038},{"style":1043},[5039],{"type":998,"value":5040},"# Executes because loop completed normally\n",{"type":993,"tag":1198,"props":5042,"children":5044},{"id":5043},"while-loop-best-practices",[5045],{"type":998,"value":5046},"✅ While Loop Best Practices",{"type":993,"tag":1001,"props":5048,"children":5049},{},[5050],{"type":998,"value":5051},"Following best practices helps you write efficient, readable, and maintainable while loops.",{"type":993,"tag":1217,"props":5053,"children":5056},{"emoji":5054,"title":5055,"type":2641},"✅","While Loop Best Practices",[5057,5065,5109,5117,5166,5173,5219],{"type":993,"tag":1001,"props":5058,"children":5059},{},[5060],{"type":993,"tag":1012,"props":5061,"children":5062},{},[5063],{"type":998,"value":5064},"Code Quality:",{"type":993,"tag":1232,"props":5066,"children":5067},{},[5068,5079,5089,5099],{"type":993,"tag":1236,"props":5069,"children":5070},{},[5071,5072,5077],{"type":998,"value":4543},{"type":993,"tag":1012,"props":5073,"children":5074},{},[5075],{"type":998,"value":5076},"descriptive variable names",{"type":998,"value":5078}," for control variables",{"type":993,"tag":1236,"props":5080,"children":5081},{},[5082,5087],{"type":993,"tag":1012,"props":5083,"children":5084},{},[5085],{"type":998,"value":5086},"Initialize variables",{"type":998,"value":5088}," before the loop",{"type":993,"tag":1236,"props":5090,"children":5091},{},[5092,5097],{"type":993,"tag":1012,"props":5093,"children":5094},{},[5095],{"type":998,"value":5096},"Update control variables",{"type":998,"value":5098}," inside the loop body",{"type":993,"tag":1236,"props":5100,"children":5101},{},[5102,5104],{"type":998,"value":5103},"Keep loop bodies ",{"type":993,"tag":1012,"props":5105,"children":5106},{},[5107],{"type":998,"value":5108},"simple and focused",{"type":993,"tag":1001,"props":5110,"children":5111},{},[5112],{"type":993,"tag":1012,"props":5113,"children":5114},{},[5115],{"type":998,"value":5116},"Safety Measures:",{"type":993,"tag":1232,"props":5118,"children":5119},{},[5120,5132,5143,5154],{"type":993,"tag":1236,"props":5121,"children":5122},{},[5123,5125,5130],{"type":998,"value":5124},"Always ensure ",{"type":993,"tag":1012,"props":5126,"children":5127},{},[5128],{"type":998,"value":5129},"termination conditions",{"type":998,"value":5131}," exist",{"type":993,"tag":1236,"props":5133,"children":5134},{},[5135,5137,5141],{"type":998,"value":5136},"Avoid ",{"type":993,"tag":1012,"props":5138,"children":5139},{},[5140],{"type":998,"value":1329},{"type":998,"value":5142}," through proper variable updates",{"type":993,"tag":1236,"props":5144,"children":5145},{},[5146,5147,5152],{"type":998,"value":4543},{"type":993,"tag":1012,"props":5148,"children":5149},{},[5150],{"type":998,"value":5151},"meaningful conditions",{"type":998,"value":5153}," that clearly express intent",{"type":993,"tag":1236,"props":5155,"children":5156},{},[5157,5159,5164],{"type":998,"value":5158},"Test ",{"type":993,"tag":1012,"props":5160,"children":5161},{},[5162],{"type":998,"value":5163},"edge cases",{"type":998,"value":5165}," and boundary conditions",{"type":993,"tag":1001,"props":5167,"children":5168},{},[5169],{"type":993,"tag":1012,"props":5170,"children":5171},{},[5172],{"type":998,"value":4608},{"type":993,"tag":1232,"props":5174,"children":5175},{},[5176,5186,5196,5207],{"type":993,"tag":1236,"props":5177,"children":5178},{},[5179,5184],{"type":993,"tag":1012,"props":5180,"children":5181},{},[5182],{"type":998,"value":5183},"Minimize work",{"type":998,"value":5185}," inside loop bodies",{"type":993,"tag":1236,"props":5187,"children":5188},{},[5189,5194],{"type":993,"tag":1012,"props":5190,"children":5191},{},[5192],{"type":998,"value":5193},"Cache frequently used",{"type":998,"value":5195}," values outside loops",{"type":993,"tag":1236,"props":5197,"children":5198},{},[5199,5200,5205],{"type":998,"value":4543},{"type":993,"tag":1012,"props":5201,"children":5202},{},[5203],{"type":998,"value":5204},"appropriate data structures",{"type":998,"value":5206}," for the task",{"type":993,"tag":1236,"props":5208,"children":5209},{},[5210,5212,5217],{"type":998,"value":5211},"Consider ",{"type":993,"tag":1012,"props":5213,"children":5214},{},[5215],{"type":998,"value":5216},"algorithm efficiency",{"type":998,"value":5218}," for large datasets",{"type":993,"tag":1001,"props":5220,"children":5221},{},[5222,5227],{"type":993,"tag":1012,"props":5223,"children":5224},{},[5225],{"type":998,"value":5226},"Debugging:",{"type":998,"value":5228}," Add print statements to track variable changes during development",{"type":993,"tag":1198,"props":5230,"children":5232},{"id":5231},"key-takeaways",[5233],{"type":998,"value":5234},"📚 Key Takeaways",{"type":993,"tag":1217,"props":5236,"children":5239},{"emoji":5237,"title":5238,"type":1524},"📚","While Loop Essentials",[5240,5248,5310,5318,5360,5368,5410,5420],{"type":993,"tag":1001,"props":5241,"children":5242},{},[5243],{"type":993,"tag":1012,"props":5244,"children":5245},{},[5246],{"type":998,"value":5247},"Core Concepts:",{"type":993,"tag":1232,"props":5249,"children":5250},{},[5251,5268,5282,5296],{"type":993,"tag":1236,"props":5252,"children":5253},{},[5254,5259,5260,5266],{"type":993,"tag":1012,"props":5255,"children":5256},{},[5257],{"type":998,"value":5258},"Syntax",{"type":998,"value":1605},{"type":993,"tag":1033,"props":5261,"children":5263},{"className":5262},[],[5264],{"type":998,"value":5265},"while condition:",{"type":998,"value":5267}," followed by indented code block",{"type":993,"tag":1236,"props":5269,"children":5270},{},[5271,5275,5277],{"type":993,"tag":1012,"props":5272,"children":5273},{},[5274],{"type":998,"value":1337},{"type":998,"value":5276},": Condition checked ",{"type":993,"tag":1012,"props":5278,"children":5279},{},[5280],{"type":998,"value":5281},"before each iteration",{"type":993,"tag":1236,"props":5283,"children":5284},{},[5285,5290,5292],{"type":993,"tag":1012,"props":5286,"children":5287},{},[5288],{"type":998,"value":5289},"Termination",{"type":998,"value":5291},": Condition must ",{"type":993,"tag":1012,"props":5293,"children":5294},{},[5295],{"type":998,"value":1309},{"type":993,"tag":1236,"props":5297,"children":5298},{},[5299,5304,5306],{"type":993,"tag":1012,"props":5300,"children":5301},{},[5302],{"type":998,"value":5303},"Control variables",{"type":998,"value":5305},": Must be ",{"type":993,"tag":1012,"props":5307,"children":5308},{},[5309],{"type":998,"value":1319},{"type":993,"tag":1001,"props":5311,"children":5312},{},[5313],{"type":993,"tag":1012,"props":5314,"children":5315},{},[5316],{"type":998,"value":5317},"Important Details:",{"type":993,"tag":1232,"props":5319,"children":5320},{},[5321,5331,5340,5350],{"type":993,"tag":1236,"props":5322,"children":5323},{},[5324,5329],{"type":993,"tag":1012,"props":5325,"children":5326},{},[5327],{"type":998,"value":5328},"Infinite loops",{"type":998,"value":5330}," occur when condition never becomes False",{"type":993,"tag":1236,"props":5332,"children":5333},{},[5334,5338],{"type":993,"tag":1012,"props":5335,"children":5336},{},[5337],{"type":998,"value":3589},{"type":998,"value":5339}," is a primary use case for while loops",{"type":993,"tag":1236,"props":5341,"children":5342},{},[5343,5348],{"type":993,"tag":1012,"props":5344,"children":5345},{},[5346],{"type":998,"value":5347},"Break and continue",{"type":998,"value":5349}," provide additional flow control",{"type":993,"tag":1236,"props":5351,"children":5352},{},[5353,5358],{"type":993,"tag":1012,"props":5354,"children":5355},{},[5356],{"type":998,"value":5357},"While-else",{"type":998,"value":5359}," executes when loop completes normally",{"type":993,"tag":1001,"props":5361,"children":5362},{},[5363],{"type":993,"tag":1012,"props":5364,"children":5365},{},[5366],{"type":998,"value":5367},"Best Use Cases:",{"type":993,"tag":1232,"props":5369,"children":5370},{},[5371,5381,5391,5400],{"type":993,"tag":1236,"props":5372,"children":5373},{},[5374,5379],{"type":993,"tag":1012,"props":5375,"children":5376},{},[5377],{"type":998,"value":5378},"Unknown iteration count",{"type":998,"value":5380},": When you don't know how many times to loop",{"type":993,"tag":1236,"props":5382,"children":5383},{},[5384,5389],{"type":993,"tag":1012,"props":5385,"children":5386},{},[5387],{"type":998,"value":5388},"User input validation",{"type":998,"value":5390},": Keep asking until valid input received",{"type":993,"tag":1236,"props":5392,"children":5393},{},[5394,5398],{"type":993,"tag":1012,"props":5395,"children":5396},{},[5397],{"type":998,"value":3614},{"type":998,"value":5399},": Continue until specific condition met",{"type":993,"tag":1236,"props":5401,"children":5402},{},[5403,5408],{"type":993,"tag":1012,"props":5404,"children":5405},{},[5406],{"type":998,"value":5407},"Resource monitoring",{"type":998,"value":5409},": Wait for conditions or availability",{"type":993,"tag":1001,"props":5411,"children":5412},{},[5413,5418],{"type":993,"tag":1012,"props":5414,"children":5415},{},[5416],{"type":998,"value":5417},"Common Patterns:",{"type":998,"value":5419}," Counter, infinite+break, flag-controlled, sentinel value",{"type":993,"tag":1001,"props":5421,"children":5422},{},[5423,5428,5430,5438],{"type":993,"tag":1012,"props":5424,"children":5425},{},[5426],{"type":998,"value":5427},"Next Steps:",{"type":998,"value":5429}," Learn ",{"type":993,"tag":1012,"props":5431,"children":5432},{},[5433],{"type":993,"tag":1016,"props":5434,"children":5435},{"href":243},[5436],{"type":998,"value":5437},"for loops",{"type":998,"value":5439}," for sequence iteration",{"type":993,"tag":1198,"props":5441,"children":5443},{"id":5442},"test-your-knowledge",[5444],{"type":998,"value":5445},"Test Your Knowledge",{"type":993,"tag":1001,"props":5447,"children":5448},{},[5449],{"type":998,"value":5450},"Test what you've learned about while loops in Python:",{"type":993,"tag":5452,"props":5453,"children":5457},"redirect-button",{"icon":5454,"label":5455,"url":5456},"pi pi-send","Take Quiz","/tutorial-quiz/python/while-loops",[],{"type":993,"tag":1198,"props":5459,"children":5461},{"id":5460},"whats-next",[5462],{"type":998,"value":5463},"🚀 What's Next?",{"type":993,"tag":1001,"props":5465,"children":5466},{},[5467],{"type":998,"value":5468},"Congratulations! You now understand while loops and can create condition-based repetition in your Python programs. While loops are perfect for situations where you don't know exactly how many iterations you need.",{"type":993,"tag":1001,"props":5470,"children":5471},{},[5472,5474,5481,5483,5491,5492,5500],{"type":998,"value":5473},"Next, you'll learn about ",{"type":993,"tag":1012,"props":5475,"children":5476},{},[5477],{"type":993,"tag":1016,"props":5478,"children":5479},{"href":243},[5480],{"type":998,"value":244},{"type":998,"value":5482},", which are designed for iterating through sequences and collections. For loops complement while loops by providing an elegant way to process ",{"type":993,"tag":1012,"props":5484,"children":5485},{},[5486],{"type":993,"tag":1016,"props":5487,"children":5488},{"href":280},[5489],{"type":998,"value":5490},"lists",{"type":998,"value":1613},{"type":993,"tag":1012,"props":5493,"children":5494},{},[5495],{"type":993,"tag":1016,"props":5496,"children":5497},{"href":105},[5498],{"type":998,"value":5499},"strings",{"type":998,"value":5501},", and other iterable data structures.",{"type":993,"tag":1001,"props":5503,"children":5504},{},[5505,5507,5515,5516,5524,5526,5534],{"type":998,"value":5506},"While loops work hand-in-hand with ",{"type":993,"tag":1012,"props":5508,"children":5509},{},[5510],{"type":993,"tag":1016,"props":5511,"children":5512},{"href":790},[5513],{"type":998,"value":5514},"input validation",{"type":998,"value":1613},{"type":993,"tag":1012,"props":5517,"children":5518},{},[5519],{"type":993,"tag":1016,"props":5520,"children":5521},{"href":197},[5522],{"type":998,"value":5523},"decision making",{"type":998,"value":5525},", and ",{"type":993,"tag":1012,"props":5527,"children":5528},{},[5529],{"type":993,"tag":1016,"props":5530,"children":5531},{"href":280},[5532],{"type":998,"value":5533},"data processing",{"type":998,"value":5535}," scenarios.",{"type":993,"tag":1001,"props":5537,"children":5538},{},[5539,5541,5549,5550,5558,5559,5567],{"type":998,"value":5540},"Understanding while loops prepares you for ",{"type":993,"tag":1012,"props":5542,"children":5543},{},[5544],{"type":993,"tag":1016,"props":5545,"children":5546},{"href":261},[5547],{"type":998,"value":5548},"advanced loop techniques",{"type":998,"value":1613},{"type":993,"tag":1012,"props":5551,"children":5552},{},[5553],{"type":993,"tag":1016,"props":5554,"children":5555},{"href":617},[5556],{"type":998,"value":5557},"function development",{"type":998,"value":5525},{"type":993,"tag":1012,"props":5560,"children":5561},{},[5562],{"type":993,"tag":1016,"props":5563,"children":5564},{"href":781},[5565],{"type":998,"value":5566},"error handling",{"type":998,"value":5568},".",{"type":993,"tag":5570,"props":5571,"children":5572},"style",{},[5573],{"type":998,"value":5574},"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":5576},[5577,5578,5579,5582,5583,5584,5585,5586,5587,5588],{"id":1200,"depth":27,"text":1203},{"id":1511,"depth":27,"text":1514},{"id":2287,"depth":27,"text":2290,"children":5580},[5581],{"id":2390,"depth":36,"text":2393},{"id":2628,"depth":27,"text":2631},{"id":3498,"depth":27,"text":3501},{"id":4447,"depth":27,"text":4450},{"id":5043,"depth":27,"text":5046},{"id":5231,"depth":27,"text":5234},{"id":5442,"depth":27,"text":5445},{"id":5460,"depth":27,"text":5463},1782373735330]