[{"data":1,"prerenderedAt":2369},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/handle-missing-keys":601},[4,22,31,40,49,58,67,76,86,94,103,112,121,130,139,148,158,167,176,185,194,203,212,222,231,240,249,258,267,276,285,297,306,315,324,333,342,351,362,371,380,389,398,407,418,427,436,445,454,463,472,483,492,501,510,519,528,539,548,557,566,575,584,593],{"_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-how-to/string-manipulation","python-how-to",false,"","String Manipulation","Learn essential string manipulation techniques in Python","string-manipulation",1,true,"pi pi-folder","markdown","content:python-how-to:1.string-manipulation.md","content","python-how-to/1.string-manipulation.md","python-how-to/1.string-manipulation","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-how-to/split-join-strings","Split and Join Strings","Learn how to split strings into lists and join lists back into strings in Python","split-join-strings",2,"content:python-how-to:2.split-join-strings.md","python-how-to/2.split-join-strings.md","python-how-to/2.split-join-strings",{"_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-how-to/remove-whitespace","Remove Whitespace","Learn how to clean up and remove unwanted whitespace from strings in Python","remove-whitespace",3,"content:python-how-to:3.remove-whitespace.md","python-how-to/3.remove-whitespace.md","python-how-to/3.remove-whitespace",{"_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-how-to/find-replace-text","Find and Replace Text","Learn how to search for and replace text within strings in Python","find-replace-text",4,"content:python-how-to:4.find-replace-text.md","python-how-to/4.find-replace-text.md","python-how-to/4.find-replace-text",{"_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-how-to/check-string-content","Check String Content","Learn how to validate and check the content of strings in Python","check-string-content",5,"content:python-how-to:5.check-string-content.md","python-how-to/5.check-string-content.md","python-how-to/5.check-string-content",{"_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-how-to/format-strings","Format Strings","Learn how to format strings in Python using f-strings and format() method","format-strings",6,"content:python-how-to:6.format-strings.md","python-how-to/6.format-strings.md","python-how-to/6.format-strings",{"_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-how-to/unicode-special-chars","Handle Unicode and Special Characters","Learn how to work with Unicode and special characters in Python strings","unicode-special-chars",7,"content:python-how-to:7.unicode-special-chars.md","python-how-to/7.unicode-special-chars.md","python-how-to/7.unicode-special-chars",{"_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-how-to/list-operations","List Operations","Learn essential operations for working with lists in Python","list-operations",8,"content:python-how-to:8.list-operations.md","python-how-to/8.list-operations.md","python-how-to/8.list-operations",[86,94,103,112,121,130,139],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":81,"_type":15,"_id":91,"_source":17,"_file":92,"_stem":93,"_extension":20},"/python-how-to/sort-lists","Sort Lists","Learn how to sort lists in Python using different methods and custom sorting","sort-lists","content:python-how-to:9.sort-lists.md","python-how-to/9.sort-lists.md","python-how-to/9.sort-lists",{"_path":95,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":96,"description":97,"slug":98,"parentId":77,"order":99,"_type":15,"_id":100,"_source":17,"_file":101,"_stem":102,"_extension":20},"/python-how-to/remove-duplicates","Remove Duplicates","Learn how to remove duplicate elements from lists in Python","remove-duplicates",10,"content:python-how-to:10.remove-duplicates.md","python-how-to/10.remove-duplicates.md","python-how-to/10.remove-duplicates",{"_path":104,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":105,"description":106,"slug":107,"parentId":77,"order":108,"_type":15,"_id":109,"_source":17,"_file":110,"_stem":111,"_extension":20},"/python-how-to/filter-lists","Filter Lists","Learn how to filter lists in Python using different methods","filter-lists",11,"content:python-how-to:11.filter-lists.md","python-how-to/11.filter-lists.md","python-how-to/11.filter-lists",{"_path":113,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":114,"description":115,"slug":116,"parentId":77,"order":117,"_type":15,"_id":118,"_source":17,"_file":119,"_stem":120,"_extension":20},"/python-how-to/combine-lists","Combine Lists","Learn different methods to combine lists in Python","combine-lists",12,"content:python-how-to:12.combine-lists.md","python-how-to/12.combine-lists.md","python-how-to/12.combine-lists",{"_path":122,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":123,"description":124,"slug":125,"parentId":77,"order":126,"_type":15,"_id":127,"_source":17,"_file":128,"_stem":129,"_extension":20},"/python-how-to/list-comprehensions","Use List Comprehensions","Learn how to create and transform lists efficiently using Python's list comprehension syntax","list-comprehensions",13,"content:python-how-to:13.list-comprehensions.md","python-how-to/13.list-comprehensions.md","python-how-to/13.list-comprehensions",{"_path":131,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":132,"description":133,"slug":134,"parentId":77,"order":135,"_type":15,"_id":136,"_source":17,"_file":137,"_stem":138,"_extension":20},"/python-how-to/nested-lists","Work with Nested Lists","Learn how to work with nested lists (2D arrays) in Python","nested-lists",14,"content:python-how-to:14.nested-lists.md","python-how-to/14.nested-lists.md","python-how-to/14.nested-lists",{"_path":140,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":141,"description":142,"slug":143,"parentId":77,"order":144,"_type":15,"_id":145,"_source":17,"_file":146,"_stem":147,"_extension":20},"/python-how-to/enumerate-zip","Use enumerate() and zip()","Learn how to use enumerate() and zip() for efficient iteration in Python","enumerate-zip",15,"content:python-how-to:15.enumerate-zip.md","python-how-to/15.enumerate-zip.md","python-how-to/15.enumerate-zip",{"_path":149,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":150,"description":151,"slug":152,"order":153,"isParent":13,"icon":14,"_type":15,"_id":154,"_source":17,"_file":155,"_stem":156,"_extension":20,"children":157,"expanded":13},"/python-how-to/dictionary-operations","Dictionary Operations","Learn essential operations for working with dictionaries in Python","dictionary-operations",16,"content:python-how-to:16.dictionary-operations.md","python-how-to/16.dictionary-operations.md","python-how-to/16.dictionary-operations",[158,167,176,185,194,203],{"_path":159,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":160,"description":161,"slug":162,"parentId":149,"order":163,"_type":15,"_id":164,"_source":17,"_file":165,"_stem":166,"_extension":20},"/python-how-to/merge-dictionaries","Merge Dictionaries","Learn different methods to merge dictionaries in Python","merge-dictionaries",17,"content:python-how-to:17.merge-dictionaries.md","python-how-to/17.merge-dictionaries.md","python-how-to/17.merge-dictionaries",{"_path":168,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":169,"description":170,"slug":171,"parentId":149,"order":172,"_type":15,"_id":173,"_source":17,"_file":174,"_stem":175,"_extension":20},"/python-how-to/sort-dictionaries","Sort Dictionaries","Learn how to sort dictionaries by keys or values in Python","sort-dictionaries",18,"content:python-how-to:18.sort-dictionaries.md","python-how-to/18.sort-dictionaries.md","python-how-to/18.sort-dictionaries",{"_path":177,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":178,"description":179,"slug":180,"parentId":149,"order":181,"_type":15,"_id":182,"_source":17,"_file":183,"_stem":184,"_extension":20},"/python-how-to/filter-dictionaries","Filter Dictionaries","Learn how to filter dictionaries based on keys or values in Python","filter-dictionaries",19,"content:python-how-to:19.filter-dictionaries.md","python-how-to/19.filter-dictionaries.md","python-how-to/19.filter-dictionaries",{"_path":186,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":187,"description":188,"slug":189,"parentId":149,"order":190,"_type":15,"_id":191,"_source":17,"_file":192,"_stem":193,"_extension":20},"/python-how-to/handle-missing-keys","Handle Missing Keys","Learn safe ways to access dictionary keys and handle missing values","handle-missing-keys",20,"content:python-how-to:20.handle-missing-keys.md","python-how-to/20.handle-missing-keys.md","python-how-to/20.handle-missing-keys",{"_path":195,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":196,"description":197,"slug":198,"parentId":149,"order":199,"_type":15,"_id":200,"_source":17,"_file":201,"_stem":202,"_extension":20},"/python-how-to/dictionary-comprehensions","Use Dictionary Comprehensions","Learn how to create dictionaries efficiently using comprehensions","dictionary-comprehensions",21,"content:python-how-to:21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions",{"_path":204,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":205,"description":206,"slug":207,"parentId":149,"order":208,"_type":15,"_id":209,"_source":17,"_file":210,"_stem":211,"_extension":20},"/python-how-to/convert-lists-dictionaries","Convert Between Lists and Dictionaries","Learn how to transform data between lists and dictionaries in Python","convert-lists-dictionaries",22,"content:python-how-to:22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries",{"_path":213,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":214,"description":215,"slug":216,"order":217,"isParent":13,"icon":14,"_type":15,"_id":218,"_source":17,"_file":219,"_stem":220,"_extension":20,"children":221},"/python-how-to/file-operations","File Operations","Learn essential file operations in Python for reading, writing, and managing files","file-operations",23,"content:python-how-to:23.file-operations.md","python-how-to/23.file-operations.md","python-how-to/23.file-operations",[222,231,240,249,258,267,276],{"_path":223,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":224,"description":225,"slug":226,"parentId":213,"order":227,"_type":15,"_id":228,"_source":17,"_file":229,"_stem":230,"_extension":20},"/python-how-to/read-text-files","Read Text Files","Learn how to read text files in Python using different methods","read-text-files",24,"content:python-how-to:24.read-text-files.md","python-how-to/24.read-text-files.md","python-how-to/24.read-text-files",{"_path":232,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":233,"description":234,"slug":235,"parentId":213,"order":236,"_type":15,"_id":237,"_source":17,"_file":238,"_stem":239,"_extension":20},"/python-how-to/write-to-files","Write to Files","Learn how to write and create files in Python using different methods","write-to-files",25,"content:python-how-to:25.write-to-files.md","python-how-to/25.write-to-files.md","python-how-to/25.write-to-files",{"_path":241,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":242,"description":243,"slug":244,"parentId":213,"order":245,"_type":15,"_id":246,"_source":17,"_file":247,"_stem":248,"_extension":20},"/python-how-to/work-csv-files","Work with CSV Files","Learn how to read and write CSV files in Python using the csv module","work-csv-files",26,"content:python-how-to:26.work-csv-files.md","python-how-to/26.work-csv-files.md","python-how-to/26.work-csv-files",{"_path":250,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":251,"description":252,"slug":253,"parentId":213,"order":254,"_type":15,"_id":255,"_source":17,"_file":256,"_stem":257,"_extension":20},"/python-how-to/handle-file-paths","Handle File Paths","Learn how to work with file and directory paths in Python using pathlib and os modules","handle-file-paths",27,"content:python-how-to:27.handle-file-paths.md","python-how-to/27.handle-file-paths.md","python-how-to/27.handle-file-paths",{"_path":259,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":260,"description":261,"slug":262,"parentId":213,"order":263,"_type":15,"_id":264,"_source":17,"_file":265,"_stem":266,"_extension":20},"/python-how-to/work-json-files","Work with JSON Files","Learn how to read and write JSON files in Python using the json module","work-json-files",28,"content:python-how-to:28.work-json-files.md","python-how-to/28.work-json-files.md","python-how-to/28.work-json-files",{"_path":268,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":269,"description":270,"slug":271,"parentId":213,"order":272,"_type":15,"_id":273,"_source":17,"_file":274,"_stem":275,"_extension":20},"/python-how-to/handle-binary-files","Handle Binary Files","Learn how to work with binary files in Python for images, data, and other non-text content","handle-binary-files",29,"content:python-how-to:29.handle-binary-files.md","python-how-to/29.handle-binary-files.md","python-how-to/29.handle-binary-files",{"_path":277,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":278,"description":279,"slug":280,"parentId":213,"order":281,"_type":15,"_id":282,"_source":17,"_file":283,"_stem":284,"_extension":20},"/python-how-to/use-context-managers","Use Context Managers","Learn how to use context managers for safe resource handling in Python","use-context-managers",30,"content:python-how-to:30.use-context-managers.md","python-how-to/30.use-context-managers.md","python-how-to/30.use-context-managers",{"_path":286,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":287,"description":288,"slug":289,"parentId":290,"order":291,"isParent":13,"icon":292,"_type":15,"_id":293,"_source":17,"_file":294,"_stem":295,"_extension":20,"children":296},"/python-how-to/date-and-time","Date and Time","Master Python's date and time handling with datetime, time zones, formatting, and calculations","date-and-time","/python-how-to",31,"pi pi-calendar","content:python-how-to:31.date-and-time.md","python-how-to/31.date-and-time.md","python-how-to/31.date-and-time",[297,306,315,324,333,342],{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":286,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python-how-to/get-current-datetime","Get Current Date/Time","Learn how to get current date, time, and timestamps using Python's datetime module","get-current-datetime",32,"content:python-how-to:32.get-current-datetime.md","python-how-to/32.get-current-datetime.md","python-how-to/32.get-current-datetime",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":286,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python-how-to/format-dates","Format Dates","Master date formatting with strftime, custom formats, and locale-aware formatting for user-friendly displays","format-dates",33,"content:python-how-to:33.format-dates.md","python-how-to/33.format-dates.md","python-how-to/33.format-dates",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python-how-to/calculate-date-differences","Calculate Date Differences","Learn to calculate time differences, durations, and intervals using Python's timedelta for scheduling and analytics","calculate-date-differences",34,"content:python-how-to:34.calculate-date-differences.md","python-how-to/34.calculate-date-differences.md","python-how-to/34.calculate-date-differences",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python-how-to/parse-date-strings","Parse Date Strings","Convert text dates into Python datetime objects using strptime, handle multiple formats, and validate date input","parse-date-strings",35,"content:python-how-to:35.parse-date-strings.md","python-how-to/35.parse-date-strings.md","python-how-to/35.parse-date-strings",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":286,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python-how-to/handle-timezones","Handle Timezones","Master timezone handling with zoneinfo, UTC conversions, and timezone-aware datetime objects for global applications","handle-timezones",36,"content:python-how-to:36.handle-timezones.md","python-how-to/36.handle-timezones.md","python-how-to/36.handle-timezones",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python-how-to/work-with-timestamps","Work with Timestamps","Master Unix timestamps in Python - convert between datetime objects and timestamps for APIs, databases, and system integration","work-with-timestamps",37,"content:python-how-to:37.work-with-timestamps.md","python-how-to/37.work-with-timestamps.md","python-how-to/37.work-with-timestamps",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":290,"order":356,"isParent":13,"icon":357,"_type":15,"_id":358,"_source":17,"_file":359,"_stem":360,"_extension":20,"children":361},"/python-how-to/error-handling","Error Handling","Learn Python's error handling with try/except, custom exceptions, debugging, logging, and retry logic for robust applications","error-handling",38,"pi pi-exclamation-triangle","content:python-how-to:38.error-handling.md","python-how-to/38.error-handling.md","python-how-to/38.error-handling",[362,371,380,389,398],{"_path":363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":364,"description":365,"slug":366,"parentId":352,"order":367,"_type":15,"_id":368,"_source":17,"_file":369,"_stem":370,"_extension":20},"/python-how-to/handle-exceptions","Handle Exceptions","Master try/except blocks, multiple exception handling, and finally clauses for robust error handling in Python","handle-exceptions",39,"content:python-how-to:39.handle-exceptions.md","python-how-to/39.handle-exceptions.md","python-how-to/39.handle-exceptions",{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},"/python-how-to/create-custom-exceptions","Create Custom Exceptions","Learn to create custom exception classes in Python for specific error handling and better code organization","create-custom-exceptions",40,"content:python-how-to:40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions",{"_path":381,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":382,"description":383,"slug":384,"parentId":352,"order":385,"_type":15,"_id":386,"_source":17,"_file":387,"_stem":388,"_extension":20},"/python-how-to/debug-code","Debug Code","Learn Python debugging techniques using print statements, the debugger, and tools to find and fix code issues","debug-code",41,"content:python-how-to:41.debug-code.md","python-how-to/41.debug-code.md","python-how-to/41.debug-code",{"_path":390,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":391,"description":392,"slug":393,"parentId":352,"order":394,"_type":15,"_id":395,"_source":17,"_file":396,"_stem":397,"_extension":20},"/python-how-to/use-logging","Use Logging","Learn Python's logging module for tracking application behavior, errors, and debugging information","use-logging",42,"content:python-how-to:42.use-logging.md","python-how-to/42.use-logging.md","python-how-to/42.use-logging",{"_path":399,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":400,"description":401,"slug":402,"parentId":352,"order":403,"_type":15,"_id":404,"_source":17,"_file":405,"_stem":406,"_extension":20},"/python-how-to/implement-retry-logic","Implement Retry Logic","Learn to implement retry mechanisms in Python for handling temporary failures and building resilient applications","implement-retry-logic",43,"content:python-how-to:43.implement-retry-logic.md","python-how-to/43.implement-retry-logic.md","python-how-to/43.implement-retry-logic",{"_path":408,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":409,"description":410,"slug":411,"parentId":290,"order":412,"isParent":13,"icon":413,"_type":15,"_id":414,"_source":17,"_file":415,"_stem":416,"_extension":20,"children":417},"/python-how-to/functions-and-modules","Functions and Modules","Learn Python functions, modules, and code organization for building reusable, maintainable applications","functions-and-modules",44,"pi pi-box","content:python-how-to:44.functions-and-modules.md","python-how-to/44.functions-and-modules.md","python-how-to/44.functions-and-modules",[418,427,436,445,454,463],{"_path":419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":420,"description":421,"slug":422,"parentId":408,"order":423,"_type":15,"_id":424,"_source":17,"_file":425,"_stem":426,"_extension":20},"/python-how-to/write-functions","Write Functions","Learn to create Python functions with parameters, return values, and documentation for reusable code","write-functions",45,"content:python-how-to:45.write-functions.md","python-how-to/45.write-functions.md","python-how-to/45.write-functions",{"_path":428,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":429,"description":430,"slug":431,"parentId":408,"order":432,"_type":15,"_id":433,"_source":17,"_file":434,"_stem":435,"_extension":20},"/python-how-to/use-args-kwargs","Use *args and **kwargs","Learn to use *args and **kwargs for flexible function arguments in Python","use-args-kwargs",46,"content:python-how-to:46.use-args-kwargs.md","python-how-to/46.use-args-kwargs.md","python-how-to/46.use-args-kwargs",{"_path":437,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":438,"description":439,"slug":440,"parentId":408,"order":441,"_type":15,"_id":442,"_source":17,"_file":443,"_stem":444,"_extension":20},"/python-how-to/create-decorators","Create Decorators","Learn to create and use Python decorators to enhance function behavior and add functionality","create-decorators",47,"content:python-how-to:47.create-decorators.md","python-how-to/47.create-decorators.md","python-how-to/47.create-decorators",{"_path":446,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":447,"description":448,"slug":449,"parentId":408,"order":450,"_type":15,"_id":451,"_source":17,"_file":452,"_stem":453,"_extension":20},"/python-how-to/use-generators","Use Generators","Learn to create memory-efficient generators with yield for processing large datasets and sequences","use-generators",48,"content:python-how-to:48.use-generators.md","python-how-to/48.use-generators.md","python-how-to/48.use-generators",{"_path":455,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":456,"description":457,"slug":458,"parentId":408,"order":459,"_type":15,"_id":460,"_source":17,"_file":461,"_stem":462,"_extension":20},"/python-how-to/work-modules-packages","Work with Modules and Packages","Learn to organize Python code with modules and packages, and use imports effectively","work-modules-packages",49,"content:python-how-to:49.work-modules-packages.md","python-how-to/49.work-modules-packages.md","python-how-to/49.work-modules-packages",{"_path":464,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":465,"description":466,"slug":467,"parentId":408,"order":468,"_type":15,"_id":469,"_source":17,"_file":470,"_stem":471,"_extension":20},"/python-how-to/create-virtual-environments","Create Virtual Environments","Learn to create and manage Python virtual environments for project dependency isolation","create-virtual-environments",50,"content:python-how-to:50.create-virtual-environments.md","python-how-to/50.create-virtual-environments.md","python-how-to/50.create-virtual-environments",{"_path":473,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":474,"description":475,"slug":476,"parentId":290,"order":477,"isParent":13,"icon":478,"_type":15,"_id":479,"_source":17,"_file":480,"_stem":481,"_extension":20,"children":482},"/python-how-to/data-processing","Data Processing","Learn Python data processing techniques including regex, APIs, databases, and large file handling","data-processing",51,"pi pi-database","content:python-how-to:51.data-processing.md","python-how-to/51.data-processing.md","python-how-to/51.data-processing",[483,492,501,510,519],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},"/python-how-to/work-regular-expressions","Work with Regular Expressions","Learn to use Python's re module for pattern matching, text extraction, and data validation","work-regular-expressions",52,"content:python-how-to:52.work-regular-expressions.md","python-how-to/52.work-regular-expressions.md","python-how-to/52.work-regular-expressions",{"_path":493,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":494,"description":495,"slug":496,"parentId":473,"order":497,"_type":15,"_id":498,"_source":17,"_file":499,"_stem":500,"_extension":20},"/python-how-to/parse-xml-html","Parse XML and HTML","Learn to extract data from XML and HTML documents using Python's built-in parsing tools","parse-xml-html",53,"content:python-how-to:53.parse-xml-html.md","python-how-to/53.parse-xml-html.md","python-how-to/53.parse-xml-html",{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},"/python-how-to/handle-api-requests","Handle API Requests","Learn to fetch and process data from web APIs using Python's urllib and external requests library","handle-api-requests",54,"content:python-how-to:54.handle-api-requests.md","python-how-to/54.handle-api-requests.md","python-how-to/54.handle-api-requests",{"_path":511,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":512,"description":513,"slug":514,"parentId":473,"order":515,"_type":15,"_id":516,"_source":17,"_file":517,"_stem":518,"_extension":20},"/python-how-to/work-databases","Work with Databases","Learn to connect to and query SQL databases using Python's sqlite3 and database techniques","work-databases",55,"content:python-how-to:55.work-databases.md","python-how-to/55.work-databases.md","python-how-to/55.work-databases",{"_path":520,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":521,"description":522,"slug":523,"parentId":473,"order":524,"_type":15,"_id":525,"_source":17,"_file":526,"_stem":527,"_extension":20},"/python-how-to/process-large-files","Process Large Files","Learn memory-efficient techniques for handling large files and datasets in Python","process-large-files",56,"content:python-how-to:56.process-large-files.md","python-how-to/56.process-large-files.md","python-how-to/56.process-large-files",{"_path":529,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":530,"description":531,"slug":532,"parentId":290,"order":533,"isParent":13,"icon":534,"_type":15,"_id":535,"_source":17,"_file":536,"_stem":537,"_extension":20,"children":538},"/python-how-to/best-practices","Best Practices","Learn Python best practices for writing clean, maintainable, and efficient code","best-practices",57,"pi pi-star","content:python-how-to:57.best-practices.md","python-how-to/57.best-practices.md","python-how-to/57.best-practices",[539,548,557,566,575,584],{"_path":540,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":541,"description":542,"slug":543,"parentId":529,"order":544,"_type":15,"_id":545,"_source":17,"_file":546,"_stem":547,"_extension":20},"/python-how-to/structure-code","Structure Your Code","Learn to organize Python code with proper module structure, functions, and classes","structure-code",58,"content:python-how-to:58.structure-code.md","python-how-to/58.structure-code.md","python-how-to/58.structure-code",{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},"/python-how-to/write-clean-code","Write Clean Code","Learn to write readable, maintainable Python code with proper naming, comments, and clear logic","write-clean-code",59,"content:python-how-to:59.write-clean-code.md","python-how-to/59.write-clean-code.md","python-how-to/59.write-clean-code",{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},"/python-how-to/optimize-performance","Optimize Performance","Learn to identify and fix performance bottlenecks in Python code for faster execution","optimize-performance",60,"content:python-how-to:60.optimize-performance.md","python-how-to/60.optimize-performance.md","python-how-to/60.optimize-performance",{"_path":567,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":568,"description":569,"slug":570,"parentId":529,"order":571,"_type":15,"_id":572,"_source":17,"_file":573,"_stem":574,"_extension":20},"/python-how-to/write-unit-tests","Write Unit Tests","Learn to create reliable unit tests to verify your Python code works correctly and catch bugs early","write-unit-tests",61,"content:python-how-to:61.write-unit-tests.md","python-how-to/61.write-unit-tests.md","python-how-to/61.write-unit-tests",{"_path":576,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":577,"description":578,"slug":579,"parentId":529,"order":580,"_type":15,"_id":581,"_source":17,"_file":582,"_stem":583,"_extension":20},"/python-how-to/document-code","Document Your Code","Learn to write clear documentation and helpful comments for your Python code","document-code",62,"content:python-how-to:62.document-code.md","python-how-to/62.document-code.md","python-how-to/62.document-code",{"_path":585,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":586,"description":587,"slug":588,"parentId":529,"order":589,"_type":15,"_id":590,"_source":17,"_file":591,"_stem":592,"_extension":20},"/python-how-to/use-type-hints","Use Type Hints","Learn to add type annotations to Python code for better clarity, tooling support, and error detection","use-type-hints",63,"content:python-how-to:63.use-type-hints.md","python-how-to/63.use-type-hints.md","python-how-to/63.use-type-hints",{"_path":290,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":594,"description":595,"slug":6,"order":596,"icon":14,"_type":15,"_id":597,"_source":17,"_file":598,"_stem":599,"_extension":20},"Python How-To Guide","Practical Python tutorials for common programming tasks. Learn step-by-step solutions for string manipulation, file operations, data processing, and more with real-world examples.",0,"content:python-how-to:index.md","python-how-to/index.md","python-how-to/index",[185],{"_path":186,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":187,"description":188,"slug":189,"parentId":149,"order":190,"body":602,"_type":15,"_id":191,"_source":17,"_file":192,"_stem":193,"_extension":20},{"type":603,"children":604,"toc":2362},"root",[605,614,620,796,803,808,906,913,1451,1457,1462,2199,2205,2356],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"️-handling-missing-keys",[611],{"type":612,"value":613},"text","🛡️ Handling Missing Keys",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618],{"type":612,"value":619},"Python provides several safe ways to access dictionary keys without raising errors. Understanding these methods is essential for robust code and error prevention.",{"type":606,"tag":621,"props":622,"children":623},"code-try",{},[624],{"type":606,"tag":625,"props":626,"children":630},"pre",{"className":627,"code":628,"language":629,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Basic safe key access\nperson = {'name': 'Alice', 'age': 25}\ncity = person.get('city', 'Unknown')\nprint(f\"City: {city}\")  # City: Unknown\n","python",[631],{"type":606,"tag":632,"props":633,"children":634},"code",{"__ignoreMap":8},[635,646,707,743],{"type":606,"tag":636,"props":637,"children":639},"span",{"class":638,"line":12},"line",[640],{"type":606,"tag":636,"props":641,"children":643},{"style":642},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[644],{"type":612,"value":645},"# Basic safe key access\n",{"type":606,"tag":636,"props":647,"children":648},{"class":638,"line":27},[649,655,661,666,672,677,682,687,692,696,702],{"type":606,"tag":636,"props":650,"children":652},{"style":651},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[653],{"type":612,"value":654},"person ",{"type":606,"tag":636,"props":656,"children":658},{"style":657},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[659],{"type":612,"value":660},"=",{"type":606,"tag":636,"props":662,"children":663},{"style":651},[664],{"type":612,"value":665}," {",{"type":606,"tag":636,"props":667,"children":669},{"style":668},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[670],{"type":612,"value":671},"'name'",{"type":606,"tag":636,"props":673,"children":674},{"style":651},[675],{"type":612,"value":676},": ",{"type":606,"tag":636,"props":678,"children":679},{"style":668},[680],{"type":612,"value":681},"'Alice'",{"type":606,"tag":636,"props":683,"children":684},{"style":651},[685],{"type":612,"value":686},", ",{"type":606,"tag":636,"props":688,"children":689},{"style":668},[690],{"type":612,"value":691},"'age'",{"type":606,"tag":636,"props":693,"children":694},{"style":651},[695],{"type":612,"value":676},{"type":606,"tag":636,"props":697,"children":699},{"style":698},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[700],{"type":612,"value":701},"25",{"type":606,"tag":636,"props":703,"children":704},{"style":651},[705],{"type":612,"value":706},"}\n",{"type":606,"tag":636,"props":708,"children":709},{"class":638,"line":36},[710,715,719,724,729,733,738],{"type":606,"tag":636,"props":711,"children":712},{"style":651},[713],{"type":612,"value":714},"city ",{"type":606,"tag":636,"props":716,"children":717},{"style":657},[718],{"type":612,"value":660},{"type":606,"tag":636,"props":720,"children":721},{"style":651},[722],{"type":612,"value":723}," person.get(",{"type":606,"tag":636,"props":725,"children":726},{"style":668},[727],{"type":612,"value":728},"'city'",{"type":606,"tag":636,"props":730,"children":731},{"style":651},[732],{"type":612,"value":686},{"type":606,"tag":636,"props":734,"children":735},{"style":668},[736],{"type":612,"value":737},"'Unknown'",{"type":606,"tag":636,"props":739,"children":740},{"style":651},[741],{"type":612,"value":742},")\n",{"type":606,"tag":636,"props":744,"children":745},{"class":638,"line":45},[746,751,756,761,766,771,776,781,786,791],{"type":606,"tag":636,"props":747,"children":748},{"style":698},[749],{"type":612,"value":750},"print",{"type":606,"tag":636,"props":752,"children":753},{"style":651},[754],{"type":612,"value":755},"(",{"type":606,"tag":636,"props":757,"children":758},{"style":657},[759],{"type":612,"value":760},"f",{"type":606,"tag":636,"props":762,"children":763},{"style":668},[764],{"type":612,"value":765},"\"City: ",{"type":606,"tag":636,"props":767,"children":768},{"style":698},[769],{"type":612,"value":770},"{",{"type":606,"tag":636,"props":772,"children":773},{"style":651},[774],{"type":612,"value":775},"city",{"type":606,"tag":636,"props":777,"children":778},{"style":698},[779],{"type":612,"value":780},"}",{"type":606,"tag":636,"props":782,"children":783},{"style":668},[784],{"type":612,"value":785},"\"",{"type":606,"tag":636,"props":787,"children":788},{"style":651},[789],{"type":612,"value":790},")  ",{"type":606,"tag":636,"props":792,"children":793},{"style":642},[794],{"type":612,"value":795},"# City: Unknown\n",{"type":606,"tag":797,"props":798,"children":800},"h2",{"id":799},"safe-access-methods",[801],{"type":612,"value":802},"🎯 Safe Access Methods",{"type":606,"tag":615,"props":804,"children":805},{},[806],{"type":612,"value":807},"Python offers several approaches to handle missing keys safely.",{"type":606,"tag":809,"props":810,"children":814},"info-box",{"emoji":811,"title":812,"type":813},"📝","Missing Key Methods","info",[815,824,862,870],{"type":606,"tag":615,"props":816,"children":817},{},[818],{"type":606,"tag":819,"props":820,"children":821},"strong",{},[822],{"type":612,"value":823},"Basic Methods:",{"type":606,"tag":825,"props":826,"children":827},"ul",{},[828,840,851],{"type":606,"tag":829,"props":830,"children":831},"li",{},[832,838],{"type":606,"tag":632,"props":833,"children":835},{"className":834},[],[836],{"type":612,"value":837},".get(key, default)",{"type":612,"value":839},": Return default if key missing",{"type":606,"tag":829,"props":841,"children":842},{},[843,849],{"type":606,"tag":632,"props":844,"children":846},{"className":845},[],[847],{"type":612,"value":848},"in",{"type":612,"value":850}," operator: Check if key exists",{"type":606,"tag":829,"props":852,"children":853},{},[854,860],{"type":606,"tag":632,"props":855,"children":857},{"className":856},[],[858],{"type":612,"value":859},"try/except",{"type":612,"value":861},": Handle KeyError exceptions",{"type":606,"tag":615,"props":863,"children":864},{},[865],{"type":606,"tag":819,"props":866,"children":867},{},[868],{"type":612,"value":869},"Advanced Methods:",{"type":606,"tag":825,"props":871,"children":872},{},[873,884,895],{"type":606,"tag":829,"props":874,"children":875},{},[876,882],{"type":606,"tag":632,"props":877,"children":879},{"className":878},[],[880],{"type":612,"value":881},"collections.defaultdict",{"type":612,"value":883},": Automatic default values",{"type":606,"tag":829,"props":885,"children":886},{},[887,893],{"type":606,"tag":632,"props":888,"children":890},{"className":889},[],[891],{"type":612,"value":892},".setdefault()",{"type":612,"value":894},": Get or set default value",{"type":606,"tag":829,"props":896,"children":897},{},[898,904],{"type":606,"tag":632,"props":899,"children":901},{"className":900},[],[902],{"type":612,"value":903},"collections.ChainMap",{"type":612,"value":905},": Fallback dictionaries",{"type":606,"tag":907,"props":908,"children":910},"h3",{"id":909},"basic-examples",[911],{"type":612,"value":912},"Basic Examples",{"type":606,"tag":621,"props":914,"children":915},{},[916],{"type":606,"tag":625,"props":917,"children":919},{"className":627,"code":918,"language":629,"meta":8,"style":8},"# Different ways to handle missing keys\nperson = {'name': 'Alice', 'age': 25}\n\n# Using get() method\ncity = person.get('city', 'Unknown')\nprint(f\"City: {city}\")\n\n# Using in operator\nif 'email' in person:\n    print(f\"Email: {person['email']}\")\nelse:\n    print(\"Email not found\")\n\n# Using try/except\ntry:\n    phone = person['phone']\n    print(f\"Phone: {phone}\")\nexcept KeyError:\n    print(\"Phone not found\")\n\n# Using setdefault()\nemail = person.setdefault('email', 'no-email@example.com')\nprint(f\"Email set to: {email}\")\nprint(f\"Updated person: {person}\")\n",[920],{"type":606,"tag":632,"props":921,"children":922},{"__ignoreMap":8},[923,931,978,986,994,1025,1064,1071,1079,1103,1155,1168,1188,1195,1203,1215,1242,1283,1300,1320,1327,1335,1369,1410],{"type":606,"tag":636,"props":924,"children":925},{"class":638,"line":12},[926],{"type":606,"tag":636,"props":927,"children":928},{"style":642},[929],{"type":612,"value":930},"# Different ways to handle missing keys\n",{"type":606,"tag":636,"props":932,"children":933},{"class":638,"line":27},[934,938,942,946,950,954,958,962,966,970,974],{"type":606,"tag":636,"props":935,"children":936},{"style":651},[937],{"type":612,"value":654},{"type":606,"tag":636,"props":939,"children":940},{"style":657},[941],{"type":612,"value":660},{"type":606,"tag":636,"props":943,"children":944},{"style":651},[945],{"type":612,"value":665},{"type":606,"tag":636,"props":947,"children":948},{"style":668},[949],{"type":612,"value":671},{"type":606,"tag":636,"props":951,"children":952},{"style":651},[953],{"type":612,"value":676},{"type":606,"tag":636,"props":955,"children":956},{"style":668},[957],{"type":612,"value":681},{"type":606,"tag":636,"props":959,"children":960},{"style":651},[961],{"type":612,"value":686},{"type":606,"tag":636,"props":963,"children":964},{"style":668},[965],{"type":612,"value":691},{"type":606,"tag":636,"props":967,"children":968},{"style":651},[969],{"type":612,"value":676},{"type":606,"tag":636,"props":971,"children":972},{"style":698},[973],{"type":612,"value":701},{"type":606,"tag":636,"props":975,"children":976},{"style":651},[977],{"type":612,"value":706},{"type":606,"tag":636,"props":979,"children":980},{"class":638,"line":36},[981],{"type":606,"tag":636,"props":982,"children":983},{"emptyLinePlaceholder":13},[984],{"type":612,"value":985},"\n",{"type":606,"tag":636,"props":987,"children":988},{"class":638,"line":45},[989],{"type":606,"tag":636,"props":990,"children":991},{"style":642},[992],{"type":612,"value":993},"# Using get() method\n",{"type":606,"tag":636,"props":995,"children":996},{"class":638,"line":54},[997,1001,1005,1009,1013,1017,1021],{"type":606,"tag":636,"props":998,"children":999},{"style":651},[1000],{"type":612,"value":714},{"type":606,"tag":636,"props":1002,"children":1003},{"style":657},[1004],{"type":612,"value":660},{"type":606,"tag":636,"props":1006,"children":1007},{"style":651},[1008],{"type":612,"value":723},{"type":606,"tag":636,"props":1010,"children":1011},{"style":668},[1012],{"type":612,"value":728},{"type":606,"tag":636,"props":1014,"children":1015},{"style":651},[1016],{"type":612,"value":686},{"type":606,"tag":636,"props":1018,"children":1019},{"style":668},[1020],{"type":612,"value":737},{"type":606,"tag":636,"props":1022,"children":1023},{"style":651},[1024],{"type":612,"value":742},{"type":606,"tag":636,"props":1026,"children":1027},{"class":638,"line":63},[1028,1032,1036,1040,1044,1048,1052,1056,1060],{"type":606,"tag":636,"props":1029,"children":1030},{"style":698},[1031],{"type":612,"value":750},{"type":606,"tag":636,"props":1033,"children":1034},{"style":651},[1035],{"type":612,"value":755},{"type":606,"tag":636,"props":1037,"children":1038},{"style":657},[1039],{"type":612,"value":760},{"type":606,"tag":636,"props":1041,"children":1042},{"style":668},[1043],{"type":612,"value":765},{"type":606,"tag":636,"props":1045,"children":1046},{"style":698},[1047],{"type":612,"value":770},{"type":606,"tag":636,"props":1049,"children":1050},{"style":651},[1051],{"type":612,"value":775},{"type":606,"tag":636,"props":1053,"children":1054},{"style":698},[1055],{"type":612,"value":780},{"type":606,"tag":636,"props":1057,"children":1058},{"style":668},[1059],{"type":612,"value":785},{"type":606,"tag":636,"props":1061,"children":1062},{"style":651},[1063],{"type":612,"value":742},{"type":606,"tag":636,"props":1065,"children":1066},{"class":638,"line":72},[1067],{"type":606,"tag":636,"props":1068,"children":1069},{"emptyLinePlaceholder":13},[1070],{"type":612,"value":985},{"type":606,"tag":636,"props":1072,"children":1073},{"class":638,"line":81},[1074],{"type":606,"tag":636,"props":1075,"children":1076},{"style":642},[1077],{"type":612,"value":1078},"# Using in operator\n",{"type":606,"tag":636,"props":1080,"children":1082},{"class":638,"line":1081},9,[1083,1088,1093,1098],{"type":606,"tag":636,"props":1084,"children":1085},{"style":657},[1086],{"type":612,"value":1087},"if",{"type":606,"tag":636,"props":1089,"children":1090},{"style":668},[1091],{"type":612,"value":1092}," 'email'",{"type":606,"tag":636,"props":1094,"children":1095},{"style":657},[1096],{"type":612,"value":1097}," in",{"type":606,"tag":636,"props":1099,"children":1100},{"style":651},[1101],{"type":612,"value":1102}," person:\n",{"type":606,"tag":636,"props":1104,"children":1105},{"class":638,"line":99},[1106,1111,1115,1119,1124,1128,1133,1138,1143,1147,1151],{"type":606,"tag":636,"props":1107,"children":1108},{"style":698},[1109],{"type":612,"value":1110},"    print",{"type":606,"tag":636,"props":1112,"children":1113},{"style":651},[1114],{"type":612,"value":755},{"type":606,"tag":636,"props":1116,"children":1117},{"style":657},[1118],{"type":612,"value":760},{"type":606,"tag":636,"props":1120,"children":1121},{"style":668},[1122],{"type":612,"value":1123},"\"Email: ",{"type":606,"tag":636,"props":1125,"children":1126},{"style":698},[1127],{"type":612,"value":770},{"type":606,"tag":636,"props":1129,"children":1130},{"style":651},[1131],{"type":612,"value":1132},"person[",{"type":606,"tag":636,"props":1134,"children":1135},{"style":668},[1136],{"type":612,"value":1137},"'email'",{"type":606,"tag":636,"props":1139,"children":1140},{"style":651},[1141],{"type":612,"value":1142},"]",{"type":606,"tag":636,"props":1144,"children":1145},{"style":698},[1146],{"type":612,"value":780},{"type":606,"tag":636,"props":1148,"children":1149},{"style":668},[1150],{"type":612,"value":785},{"type":606,"tag":636,"props":1152,"children":1153},{"style":651},[1154],{"type":612,"value":742},{"type":606,"tag":636,"props":1156,"children":1157},{"class":638,"line":108},[1158,1163],{"type":606,"tag":636,"props":1159,"children":1160},{"style":657},[1161],{"type":612,"value":1162},"else",{"type":606,"tag":636,"props":1164,"children":1165},{"style":651},[1166],{"type":612,"value":1167},":\n",{"type":606,"tag":636,"props":1169,"children":1170},{"class":638,"line":117},[1171,1175,1179,1184],{"type":606,"tag":636,"props":1172,"children":1173},{"style":698},[1174],{"type":612,"value":1110},{"type":606,"tag":636,"props":1176,"children":1177},{"style":651},[1178],{"type":612,"value":755},{"type":606,"tag":636,"props":1180,"children":1181},{"style":668},[1182],{"type":612,"value":1183},"\"Email not found\"",{"type":606,"tag":636,"props":1185,"children":1186},{"style":651},[1187],{"type":612,"value":742},{"type":606,"tag":636,"props":1189,"children":1190},{"class":638,"line":126},[1191],{"type":606,"tag":636,"props":1192,"children":1193},{"emptyLinePlaceholder":13},[1194],{"type":612,"value":985},{"type":606,"tag":636,"props":1196,"children":1197},{"class":638,"line":135},[1198],{"type":606,"tag":636,"props":1199,"children":1200},{"style":642},[1201],{"type":612,"value":1202},"# Using try/except\n",{"type":606,"tag":636,"props":1204,"children":1205},{"class":638,"line":144},[1206,1211],{"type":606,"tag":636,"props":1207,"children":1208},{"style":657},[1209],{"type":612,"value":1210},"try",{"type":606,"tag":636,"props":1212,"children":1213},{"style":651},[1214],{"type":612,"value":1167},{"type":606,"tag":636,"props":1216,"children":1217},{"class":638,"line":153},[1218,1223,1227,1232,1237],{"type":606,"tag":636,"props":1219,"children":1220},{"style":651},[1221],{"type":612,"value":1222},"    phone ",{"type":606,"tag":636,"props":1224,"children":1225},{"style":657},[1226],{"type":612,"value":660},{"type":606,"tag":636,"props":1228,"children":1229},{"style":651},[1230],{"type":612,"value":1231}," person[",{"type":606,"tag":636,"props":1233,"children":1234},{"style":668},[1235],{"type":612,"value":1236},"'phone'",{"type":606,"tag":636,"props":1238,"children":1239},{"style":651},[1240],{"type":612,"value":1241},"]\n",{"type":606,"tag":636,"props":1243,"children":1244},{"class":638,"line":163},[1245,1249,1253,1257,1262,1266,1271,1275,1279],{"type":606,"tag":636,"props":1246,"children":1247},{"style":698},[1248],{"type":612,"value":1110},{"type":606,"tag":636,"props":1250,"children":1251},{"style":651},[1252],{"type":612,"value":755},{"type":606,"tag":636,"props":1254,"children":1255},{"style":657},[1256],{"type":612,"value":760},{"type":606,"tag":636,"props":1258,"children":1259},{"style":668},[1260],{"type":612,"value":1261},"\"Phone: ",{"type":606,"tag":636,"props":1263,"children":1264},{"style":698},[1265],{"type":612,"value":770},{"type":606,"tag":636,"props":1267,"children":1268},{"style":651},[1269],{"type":612,"value":1270},"phone",{"type":606,"tag":636,"props":1272,"children":1273},{"style":698},[1274],{"type":612,"value":780},{"type":606,"tag":636,"props":1276,"children":1277},{"style":668},[1278],{"type":612,"value":785},{"type":606,"tag":636,"props":1280,"children":1281},{"style":651},[1282],{"type":612,"value":742},{"type":606,"tag":636,"props":1284,"children":1285},{"class":638,"line":172},[1286,1291,1296],{"type":606,"tag":636,"props":1287,"children":1288},{"style":657},[1289],{"type":612,"value":1290},"except",{"type":606,"tag":636,"props":1292,"children":1293},{"style":698},[1294],{"type":612,"value":1295}," KeyError",{"type":606,"tag":636,"props":1297,"children":1298},{"style":651},[1299],{"type":612,"value":1167},{"type":606,"tag":636,"props":1301,"children":1302},{"class":638,"line":181},[1303,1307,1311,1316],{"type":606,"tag":636,"props":1304,"children":1305},{"style":698},[1306],{"type":612,"value":1110},{"type":606,"tag":636,"props":1308,"children":1309},{"style":651},[1310],{"type":612,"value":755},{"type":606,"tag":636,"props":1312,"children":1313},{"style":668},[1314],{"type":612,"value":1315},"\"Phone not found\"",{"type":606,"tag":636,"props":1317,"children":1318},{"style":651},[1319],{"type":612,"value":742},{"type":606,"tag":636,"props":1321,"children":1322},{"class":638,"line":190},[1323],{"type":606,"tag":636,"props":1324,"children":1325},{"emptyLinePlaceholder":13},[1326],{"type":612,"value":985},{"type":606,"tag":636,"props":1328,"children":1329},{"class":638,"line":199},[1330],{"type":606,"tag":636,"props":1331,"children":1332},{"style":642},[1333],{"type":612,"value":1334},"# Using setdefault()\n",{"type":606,"tag":636,"props":1336,"children":1337},{"class":638,"line":208},[1338,1343,1347,1352,1356,1360,1365],{"type":606,"tag":636,"props":1339,"children":1340},{"style":651},[1341],{"type":612,"value":1342},"email ",{"type":606,"tag":636,"props":1344,"children":1345},{"style":657},[1346],{"type":612,"value":660},{"type":606,"tag":636,"props":1348,"children":1349},{"style":651},[1350],{"type":612,"value":1351}," person.setdefault(",{"type":606,"tag":636,"props":1353,"children":1354},{"style":668},[1355],{"type":612,"value":1137},{"type":606,"tag":636,"props":1357,"children":1358},{"style":651},[1359],{"type":612,"value":686},{"type":606,"tag":636,"props":1361,"children":1362},{"style":668},[1363],{"type":612,"value":1364},"'no-email@example.com'",{"type":606,"tag":636,"props":1366,"children":1367},{"style":651},[1368],{"type":612,"value":742},{"type":606,"tag":636,"props":1370,"children":1371},{"class":638,"line":217},[1372,1376,1380,1384,1389,1393,1398,1402,1406],{"type":606,"tag":636,"props":1373,"children":1374},{"style":698},[1375],{"type":612,"value":750},{"type":606,"tag":636,"props":1377,"children":1378},{"style":651},[1379],{"type":612,"value":755},{"type":606,"tag":636,"props":1381,"children":1382},{"style":657},[1383],{"type":612,"value":760},{"type":606,"tag":636,"props":1385,"children":1386},{"style":668},[1387],{"type":612,"value":1388},"\"Email set to: ",{"type":606,"tag":636,"props":1390,"children":1391},{"style":698},[1392],{"type":612,"value":770},{"type":606,"tag":636,"props":1394,"children":1395},{"style":651},[1396],{"type":612,"value":1397},"email",{"type":606,"tag":636,"props":1399,"children":1400},{"style":698},[1401],{"type":612,"value":780},{"type":606,"tag":636,"props":1403,"children":1404},{"style":668},[1405],{"type":612,"value":785},{"type":606,"tag":636,"props":1407,"children":1408},{"style":651},[1409],{"type":612,"value":742},{"type":606,"tag":636,"props":1411,"children":1412},{"class":638,"line":227},[1413,1417,1421,1425,1430,1434,1439,1443,1447],{"type":606,"tag":636,"props":1414,"children":1415},{"style":698},[1416],{"type":612,"value":750},{"type":606,"tag":636,"props":1418,"children":1419},{"style":651},[1420],{"type":612,"value":755},{"type":606,"tag":636,"props":1422,"children":1423},{"style":657},[1424],{"type":612,"value":760},{"type":606,"tag":636,"props":1426,"children":1427},{"style":668},[1428],{"type":612,"value":1429},"\"Updated person: ",{"type":606,"tag":636,"props":1431,"children":1432},{"style":698},[1433],{"type":612,"value":770},{"type":606,"tag":636,"props":1435,"children":1436},{"style":651},[1437],{"type":612,"value":1438},"person",{"type":606,"tag":636,"props":1440,"children":1441},{"style":698},[1442],{"type":612,"value":780},{"type":606,"tag":636,"props":1444,"children":1445},{"style":668},[1446],{"type":612,"value":785},{"type":606,"tag":636,"props":1448,"children":1449},{"style":651},[1450],{"type":612,"value":742},{"type":606,"tag":797,"props":1452,"children":1454},{"id":1453},"advanced-handling",[1455],{"type":612,"value":1456},"🔍 Advanced Handling",{"type":606,"tag":615,"props":1458,"children":1459},{},[1460],{"type":612,"value":1461},"Python allows more sophisticated missing key handling strategies.",{"type":606,"tag":621,"props":1463,"children":1464},{},[1465],{"type":606,"tag":625,"props":1466,"children":1468},{"className":627,"code":1467,"language":629,"meta":8,"style":8},"# Advanced missing key handling\nfrom collections import defaultdict, ChainMap\n\n# Using defaultdict\nscores = defaultdict(int)\nscores['Alice'] = 85\nscores['Bob'] = 92\nprint(f\"Charlie's score: {scores['Charlie']}\")  # Returns 0\n\n# Using defaultdict with list\ngroups = defaultdict(list)\ngroups['students'].append('Alice')\ngroups['teachers'].append('Bob')\nprint(f\"Groups: {dict(groups)}\")\n\n# Using ChainMap for fallbacks\ndefaults = {'theme': 'dark', 'language': 'en'}\nuser_prefs = {'theme': 'light'}\nconfig = ChainMap(user_prefs, defaults)\nprint(f\"Theme: {config['theme']}\")      # light\nprint(f\"Language: {config['language']}\")  # en\n\n# Custom default function\ndef get_with_fallback(dictionary, key, fallback_func):\n    if key in dictionary:\n        return dictionary[key]\n    return fallback_func()\n\ndef default_name():\n    return \"Anonymous User\"\n\nname = get_with_fallback(person, 'username', default_name)\nprint(f\"Username: {name}\")\n",[1469],{"type":606,"tag":632,"props":1470,"children":1471},{"__ignoreMap":8},[1472,1480,1503,1510,1518,1544,1570,1595,1649,1656,1664,1689,1715,1739,1781,1788,1796,1848,1881,1898,1953,2006,2013,2021,2040,2062,2075,2088,2095,2112,2124,2131,2158],{"type":606,"tag":636,"props":1473,"children":1474},{"class":638,"line":12},[1475],{"type":606,"tag":636,"props":1476,"children":1477},{"style":642},[1478],{"type":612,"value":1479},"# Advanced missing key handling\n",{"type":606,"tag":636,"props":1481,"children":1482},{"class":638,"line":27},[1483,1488,1493,1498],{"type":606,"tag":636,"props":1484,"children":1485},{"style":657},[1486],{"type":612,"value":1487},"from",{"type":606,"tag":636,"props":1489,"children":1490},{"style":651},[1491],{"type":612,"value":1492}," collections ",{"type":606,"tag":636,"props":1494,"children":1495},{"style":657},[1496],{"type":612,"value":1497},"import",{"type":606,"tag":636,"props":1499,"children":1500},{"style":651},[1501],{"type":612,"value":1502}," defaultdict, ChainMap\n",{"type":606,"tag":636,"props":1504,"children":1505},{"class":638,"line":36},[1506],{"type":606,"tag":636,"props":1507,"children":1508},{"emptyLinePlaceholder":13},[1509],{"type":612,"value":985},{"type":606,"tag":636,"props":1511,"children":1512},{"class":638,"line":45},[1513],{"type":606,"tag":636,"props":1514,"children":1515},{"style":642},[1516],{"type":612,"value":1517},"# Using defaultdict\n",{"type":606,"tag":636,"props":1519,"children":1520},{"class":638,"line":54},[1521,1526,1530,1535,1540],{"type":606,"tag":636,"props":1522,"children":1523},{"style":651},[1524],{"type":612,"value":1525},"scores ",{"type":606,"tag":636,"props":1527,"children":1528},{"style":657},[1529],{"type":612,"value":660},{"type":606,"tag":636,"props":1531,"children":1532},{"style":651},[1533],{"type":612,"value":1534}," defaultdict(",{"type":606,"tag":636,"props":1536,"children":1537},{"style":698},[1538],{"type":612,"value":1539},"int",{"type":606,"tag":636,"props":1541,"children":1542},{"style":651},[1543],{"type":612,"value":742},{"type":606,"tag":636,"props":1545,"children":1546},{"class":638,"line":63},[1547,1552,1556,1561,1565],{"type":606,"tag":636,"props":1548,"children":1549},{"style":651},[1550],{"type":612,"value":1551},"scores[",{"type":606,"tag":636,"props":1553,"children":1554},{"style":668},[1555],{"type":612,"value":681},{"type":606,"tag":636,"props":1557,"children":1558},{"style":651},[1559],{"type":612,"value":1560},"] ",{"type":606,"tag":636,"props":1562,"children":1563},{"style":657},[1564],{"type":612,"value":660},{"type":606,"tag":636,"props":1566,"children":1567},{"style":698},[1568],{"type":612,"value":1569}," 85\n",{"type":606,"tag":636,"props":1571,"children":1572},{"class":638,"line":72},[1573,1577,1582,1586,1590],{"type":606,"tag":636,"props":1574,"children":1575},{"style":651},[1576],{"type":612,"value":1551},{"type":606,"tag":636,"props":1578,"children":1579},{"style":668},[1580],{"type":612,"value":1581},"'Bob'",{"type":606,"tag":636,"props":1583,"children":1584},{"style":651},[1585],{"type":612,"value":1560},{"type":606,"tag":636,"props":1587,"children":1588},{"style":657},[1589],{"type":612,"value":660},{"type":606,"tag":636,"props":1591,"children":1592},{"style":698},[1593],{"type":612,"value":1594}," 92\n",{"type":606,"tag":636,"props":1596,"children":1597},{"class":638,"line":81},[1598,1602,1606,1610,1615,1619,1623,1628,1632,1636,1640,1644],{"type":606,"tag":636,"props":1599,"children":1600},{"style":698},[1601],{"type":612,"value":750},{"type":606,"tag":636,"props":1603,"children":1604},{"style":651},[1605],{"type":612,"value":755},{"type":606,"tag":636,"props":1607,"children":1608},{"style":657},[1609],{"type":612,"value":760},{"type":606,"tag":636,"props":1611,"children":1612},{"style":668},[1613],{"type":612,"value":1614},"\"Charlie's score: ",{"type":606,"tag":636,"props":1616,"children":1617},{"style":698},[1618],{"type":612,"value":770},{"type":606,"tag":636,"props":1620,"children":1621},{"style":651},[1622],{"type":612,"value":1551},{"type":606,"tag":636,"props":1624,"children":1625},{"style":668},[1626],{"type":612,"value":1627},"'Charlie'",{"type":606,"tag":636,"props":1629,"children":1630},{"style":651},[1631],{"type":612,"value":1142},{"type":606,"tag":636,"props":1633,"children":1634},{"style":698},[1635],{"type":612,"value":780},{"type":606,"tag":636,"props":1637,"children":1638},{"style":668},[1639],{"type":612,"value":785},{"type":606,"tag":636,"props":1641,"children":1642},{"style":651},[1643],{"type":612,"value":790},{"type":606,"tag":636,"props":1645,"children":1646},{"style":642},[1647],{"type":612,"value":1648},"# Returns 0\n",{"type":606,"tag":636,"props":1650,"children":1651},{"class":638,"line":1081},[1652],{"type":606,"tag":636,"props":1653,"children":1654},{"emptyLinePlaceholder":13},[1655],{"type":612,"value":985},{"type":606,"tag":636,"props":1657,"children":1658},{"class":638,"line":99},[1659],{"type":606,"tag":636,"props":1660,"children":1661},{"style":642},[1662],{"type":612,"value":1663},"# Using defaultdict with list\n",{"type":606,"tag":636,"props":1665,"children":1666},{"class":638,"line":108},[1667,1672,1676,1680,1685],{"type":606,"tag":636,"props":1668,"children":1669},{"style":651},[1670],{"type":612,"value":1671},"groups ",{"type":606,"tag":636,"props":1673,"children":1674},{"style":657},[1675],{"type":612,"value":660},{"type":606,"tag":636,"props":1677,"children":1678},{"style":651},[1679],{"type":612,"value":1534},{"type":606,"tag":636,"props":1681,"children":1682},{"style":698},[1683],{"type":612,"value":1684},"list",{"type":606,"tag":636,"props":1686,"children":1687},{"style":651},[1688],{"type":612,"value":742},{"type":606,"tag":636,"props":1690,"children":1691},{"class":638,"line":117},[1692,1697,1702,1707,1711],{"type":606,"tag":636,"props":1693,"children":1694},{"style":651},[1695],{"type":612,"value":1696},"groups[",{"type":606,"tag":636,"props":1698,"children":1699},{"style":668},[1700],{"type":612,"value":1701},"'students'",{"type":606,"tag":636,"props":1703,"children":1704},{"style":651},[1705],{"type":612,"value":1706},"].append(",{"type":606,"tag":636,"props":1708,"children":1709},{"style":668},[1710],{"type":612,"value":681},{"type":606,"tag":636,"props":1712,"children":1713},{"style":651},[1714],{"type":612,"value":742},{"type":606,"tag":636,"props":1716,"children":1717},{"class":638,"line":126},[1718,1722,1727,1731,1735],{"type":606,"tag":636,"props":1719,"children":1720},{"style":651},[1721],{"type":612,"value":1696},{"type":606,"tag":636,"props":1723,"children":1724},{"style":668},[1725],{"type":612,"value":1726},"'teachers'",{"type":606,"tag":636,"props":1728,"children":1729},{"style":651},[1730],{"type":612,"value":1706},{"type":606,"tag":636,"props":1732,"children":1733},{"style":668},[1734],{"type":612,"value":1581},{"type":606,"tag":636,"props":1736,"children":1737},{"style":651},[1738],{"type":612,"value":742},{"type":606,"tag":636,"props":1740,"children":1741},{"class":638,"line":135},[1742,1746,1750,1754,1759,1764,1769,1773,1777],{"type":606,"tag":636,"props":1743,"children":1744},{"style":698},[1745],{"type":612,"value":750},{"type":606,"tag":636,"props":1747,"children":1748},{"style":651},[1749],{"type":612,"value":755},{"type":606,"tag":636,"props":1751,"children":1752},{"style":657},[1753],{"type":612,"value":760},{"type":606,"tag":636,"props":1755,"children":1756},{"style":668},[1757],{"type":612,"value":1758},"\"Groups: ",{"type":606,"tag":636,"props":1760,"children":1761},{"style":698},[1762],{"type":612,"value":1763},"{dict",{"type":606,"tag":636,"props":1765,"children":1766},{"style":651},[1767],{"type":612,"value":1768},"(groups)",{"type":606,"tag":636,"props":1770,"children":1771},{"style":698},[1772],{"type":612,"value":780},{"type":606,"tag":636,"props":1774,"children":1775},{"style":668},[1776],{"type":612,"value":785},{"type":606,"tag":636,"props":1778,"children":1779},{"style":651},[1780],{"type":612,"value":742},{"type":606,"tag":636,"props":1782,"children":1783},{"class":638,"line":144},[1784],{"type":606,"tag":636,"props":1785,"children":1786},{"emptyLinePlaceholder":13},[1787],{"type":612,"value":985},{"type":606,"tag":636,"props":1789,"children":1790},{"class":638,"line":153},[1791],{"type":606,"tag":636,"props":1792,"children":1793},{"style":642},[1794],{"type":612,"value":1795},"# Using ChainMap for fallbacks\n",{"type":606,"tag":636,"props":1797,"children":1798},{"class":638,"line":163},[1799,1804,1808,1812,1817,1821,1826,1830,1835,1839,1844],{"type":606,"tag":636,"props":1800,"children":1801},{"style":651},[1802],{"type":612,"value":1803},"defaults ",{"type":606,"tag":636,"props":1805,"children":1806},{"style":657},[1807],{"type":612,"value":660},{"type":606,"tag":636,"props":1809,"children":1810},{"style":651},[1811],{"type":612,"value":665},{"type":606,"tag":636,"props":1813,"children":1814},{"style":668},[1815],{"type":612,"value":1816},"'theme'",{"type":606,"tag":636,"props":1818,"children":1819},{"style":651},[1820],{"type":612,"value":676},{"type":606,"tag":636,"props":1822,"children":1823},{"style":668},[1824],{"type":612,"value":1825},"'dark'",{"type":606,"tag":636,"props":1827,"children":1828},{"style":651},[1829],{"type":612,"value":686},{"type":606,"tag":636,"props":1831,"children":1832},{"style":668},[1833],{"type":612,"value":1834},"'language'",{"type":606,"tag":636,"props":1836,"children":1837},{"style":651},[1838],{"type":612,"value":676},{"type":606,"tag":636,"props":1840,"children":1841},{"style":668},[1842],{"type":612,"value":1843},"'en'",{"type":606,"tag":636,"props":1845,"children":1846},{"style":651},[1847],{"type":612,"value":706},{"type":606,"tag":636,"props":1849,"children":1850},{"class":638,"line":172},[1851,1856,1860,1864,1868,1872,1877],{"type":606,"tag":636,"props":1852,"children":1853},{"style":651},[1854],{"type":612,"value":1855},"user_prefs ",{"type":606,"tag":636,"props":1857,"children":1858},{"style":657},[1859],{"type":612,"value":660},{"type":606,"tag":636,"props":1861,"children":1862},{"style":651},[1863],{"type":612,"value":665},{"type":606,"tag":636,"props":1865,"children":1866},{"style":668},[1867],{"type":612,"value":1816},{"type":606,"tag":636,"props":1869,"children":1870},{"style":651},[1871],{"type":612,"value":676},{"type":606,"tag":636,"props":1873,"children":1874},{"style":668},[1875],{"type":612,"value":1876},"'light'",{"type":606,"tag":636,"props":1878,"children":1879},{"style":651},[1880],{"type":612,"value":706},{"type":606,"tag":636,"props":1882,"children":1883},{"class":638,"line":181},[1884,1889,1893],{"type":606,"tag":636,"props":1885,"children":1886},{"style":651},[1887],{"type":612,"value":1888},"config ",{"type":606,"tag":636,"props":1890,"children":1891},{"style":657},[1892],{"type":612,"value":660},{"type":606,"tag":636,"props":1894,"children":1895},{"style":651},[1896],{"type":612,"value":1897}," ChainMap(user_prefs, defaults)\n",{"type":606,"tag":636,"props":1899,"children":1900},{"class":638,"line":190},[1901,1905,1909,1913,1918,1922,1927,1931,1935,1939,1943,1948],{"type":606,"tag":636,"props":1902,"children":1903},{"style":698},[1904],{"type":612,"value":750},{"type":606,"tag":636,"props":1906,"children":1907},{"style":651},[1908],{"type":612,"value":755},{"type":606,"tag":636,"props":1910,"children":1911},{"style":657},[1912],{"type":612,"value":760},{"type":606,"tag":636,"props":1914,"children":1915},{"style":668},[1916],{"type":612,"value":1917},"\"Theme: ",{"type":606,"tag":636,"props":1919,"children":1920},{"style":698},[1921],{"type":612,"value":770},{"type":606,"tag":636,"props":1923,"children":1924},{"style":651},[1925],{"type":612,"value":1926},"config[",{"type":606,"tag":636,"props":1928,"children":1929},{"style":668},[1930],{"type":612,"value":1816},{"type":606,"tag":636,"props":1932,"children":1933},{"style":651},[1934],{"type":612,"value":1142},{"type":606,"tag":636,"props":1936,"children":1937},{"style":698},[1938],{"type":612,"value":780},{"type":606,"tag":636,"props":1940,"children":1941},{"style":668},[1942],{"type":612,"value":785},{"type":606,"tag":636,"props":1944,"children":1945},{"style":651},[1946],{"type":612,"value":1947},")      ",{"type":606,"tag":636,"props":1949,"children":1950},{"style":642},[1951],{"type":612,"value":1952},"# light\n",{"type":606,"tag":636,"props":1954,"children":1955},{"class":638,"line":199},[1956,1960,1964,1968,1973,1977,1981,1985,1989,1993,1997,2001],{"type":606,"tag":636,"props":1957,"children":1958},{"style":698},[1959],{"type":612,"value":750},{"type":606,"tag":636,"props":1961,"children":1962},{"style":651},[1963],{"type":612,"value":755},{"type":606,"tag":636,"props":1965,"children":1966},{"style":657},[1967],{"type":612,"value":760},{"type":606,"tag":636,"props":1969,"children":1970},{"style":668},[1971],{"type":612,"value":1972},"\"Language: ",{"type":606,"tag":636,"props":1974,"children":1975},{"style":698},[1976],{"type":612,"value":770},{"type":606,"tag":636,"props":1978,"children":1979},{"style":651},[1980],{"type":612,"value":1926},{"type":606,"tag":636,"props":1982,"children":1983},{"style":668},[1984],{"type":612,"value":1834},{"type":606,"tag":636,"props":1986,"children":1987},{"style":651},[1988],{"type":612,"value":1142},{"type":606,"tag":636,"props":1990,"children":1991},{"style":698},[1992],{"type":612,"value":780},{"type":606,"tag":636,"props":1994,"children":1995},{"style":668},[1996],{"type":612,"value":785},{"type":606,"tag":636,"props":1998,"children":1999},{"style":651},[2000],{"type":612,"value":790},{"type":606,"tag":636,"props":2002,"children":2003},{"style":642},[2004],{"type":612,"value":2005},"# en\n",{"type":606,"tag":636,"props":2007,"children":2008},{"class":638,"line":208},[2009],{"type":606,"tag":636,"props":2010,"children":2011},{"emptyLinePlaceholder":13},[2012],{"type":612,"value":985},{"type":606,"tag":636,"props":2014,"children":2015},{"class":638,"line":217},[2016],{"type":606,"tag":636,"props":2017,"children":2018},{"style":642},[2019],{"type":612,"value":2020},"# Custom default function\n",{"type":606,"tag":636,"props":2022,"children":2023},{"class":638,"line":227},[2024,2029,2035],{"type":606,"tag":636,"props":2025,"children":2026},{"style":657},[2027],{"type":612,"value":2028},"def",{"type":606,"tag":636,"props":2030,"children":2032},{"style":2031},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[2033],{"type":612,"value":2034}," get_with_fallback",{"type":606,"tag":636,"props":2036,"children":2037},{"style":651},[2038],{"type":612,"value":2039},"(dictionary, key, fallback_func):\n",{"type":606,"tag":636,"props":2041,"children":2042},{"class":638,"line":236},[2043,2048,2053,2057],{"type":606,"tag":636,"props":2044,"children":2045},{"style":657},[2046],{"type":612,"value":2047},"    if",{"type":606,"tag":636,"props":2049,"children":2050},{"style":651},[2051],{"type":612,"value":2052}," key ",{"type":606,"tag":636,"props":2054,"children":2055},{"style":657},[2056],{"type":612,"value":848},{"type":606,"tag":636,"props":2058,"children":2059},{"style":651},[2060],{"type":612,"value":2061}," dictionary:\n",{"type":606,"tag":636,"props":2063,"children":2064},{"class":638,"line":245},[2065,2070],{"type":606,"tag":636,"props":2066,"children":2067},{"style":657},[2068],{"type":612,"value":2069},"        return",{"type":606,"tag":636,"props":2071,"children":2072},{"style":651},[2073],{"type":612,"value":2074}," dictionary[key]\n",{"type":606,"tag":636,"props":2076,"children":2077},{"class":638,"line":254},[2078,2083],{"type":606,"tag":636,"props":2079,"children":2080},{"style":657},[2081],{"type":612,"value":2082},"    return",{"type":606,"tag":636,"props":2084,"children":2085},{"style":651},[2086],{"type":612,"value":2087}," fallback_func()\n",{"type":606,"tag":636,"props":2089,"children":2090},{"class":638,"line":263},[2091],{"type":606,"tag":636,"props":2092,"children":2093},{"emptyLinePlaceholder":13},[2094],{"type":612,"value":985},{"type":606,"tag":636,"props":2096,"children":2097},{"class":638,"line":272},[2098,2102,2107],{"type":606,"tag":636,"props":2099,"children":2100},{"style":657},[2101],{"type":612,"value":2028},{"type":606,"tag":636,"props":2103,"children":2104},{"style":2031},[2105],{"type":612,"value":2106}," default_name",{"type":606,"tag":636,"props":2108,"children":2109},{"style":651},[2110],{"type":612,"value":2111},"():\n",{"type":606,"tag":636,"props":2113,"children":2114},{"class":638,"line":281},[2115,2119],{"type":606,"tag":636,"props":2116,"children":2117},{"style":657},[2118],{"type":612,"value":2082},{"type":606,"tag":636,"props":2120,"children":2121},{"style":668},[2122],{"type":612,"value":2123}," \"Anonymous User\"\n",{"type":606,"tag":636,"props":2125,"children":2126},{"class":638,"line":291},[2127],{"type":606,"tag":636,"props":2128,"children":2129},{"emptyLinePlaceholder":13},[2130],{"type":612,"value":985},{"type":606,"tag":636,"props":2132,"children":2133},{"class":638,"line":302},[2134,2139,2143,2148,2153],{"type":606,"tag":636,"props":2135,"children":2136},{"style":651},[2137],{"type":612,"value":2138},"name ",{"type":606,"tag":636,"props":2140,"children":2141},{"style":657},[2142],{"type":612,"value":660},{"type":606,"tag":636,"props":2144,"children":2145},{"style":651},[2146],{"type":612,"value":2147}," get_with_fallback(person, ",{"type":606,"tag":636,"props":2149,"children":2150},{"style":668},[2151],{"type":612,"value":2152},"'username'",{"type":606,"tag":636,"props":2154,"children":2155},{"style":651},[2156],{"type":612,"value":2157},", default_name)\n",{"type":606,"tag":636,"props":2159,"children":2160},{"class":638,"line":311},[2161,2165,2169,2173,2178,2182,2187,2191,2195],{"type":606,"tag":636,"props":2162,"children":2163},{"style":698},[2164],{"type":612,"value":750},{"type":606,"tag":636,"props":2166,"children":2167},{"style":651},[2168],{"type":612,"value":755},{"type":606,"tag":636,"props":2170,"children":2171},{"style":657},[2172],{"type":612,"value":760},{"type":606,"tag":636,"props":2174,"children":2175},{"style":668},[2176],{"type":612,"value":2177},"\"Username: ",{"type":606,"tag":636,"props":2179,"children":2180},{"style":698},[2181],{"type":612,"value":770},{"type":606,"tag":636,"props":2183,"children":2184},{"style":651},[2185],{"type":612,"value":2186},"name",{"type":606,"tag":636,"props":2188,"children":2189},{"style":698},[2190],{"type":612,"value":780},{"type":606,"tag":636,"props":2192,"children":2193},{"style":668},[2194],{"type":612,"value":785},{"type":606,"tag":636,"props":2196,"children":2197},{"style":651},[2198],{"type":612,"value":742},{"type":606,"tag":797,"props":2200,"children":2202},{"id":2201},"key-takeaways",[2203],{"type":612,"value":2204},"🎯 Key Takeaways",{"type":606,"tag":809,"props":2206,"children":2210},{"emoji":2207,"title":2208,"type":2209},"📚","Missing Key Handling Essentials","success",[2211,2218,2252,2260,2296,2304,2346],{"type":606,"tag":615,"props":2212,"children":2213},{},[2214],{"type":606,"tag":819,"props":2215,"children":2216},{},[2217],{"type":612,"value":823},{"type":606,"tag":825,"props":2219,"children":2220},{},[2221,2232,2242],{"type":606,"tag":829,"props":2222,"children":2223},{},[2224,2230],{"type":606,"tag":632,"props":2225,"children":2227},{"className":2226},[],[2228],{"type":612,"value":2229},".get()",{"type":612,"value":2231}," for simple defaults",{"type":606,"tag":829,"props":2233,"children":2234},{},[2235,2240],{"type":606,"tag":632,"props":2236,"children":2238},{"className":2237},[],[2239],{"type":612,"value":848},{"type":612,"value":2241}," operator for existence checks",{"type":606,"tag":829,"props":2243,"children":2244},{},[2245,2250],{"type":606,"tag":632,"props":2246,"children":2248},{"className":2247},[],[2249],{"type":612,"value":859},{"type":612,"value":2251}," for error handling",{"type":606,"tag":615,"props":2253,"children":2254},{},[2255],{"type":606,"tag":819,"props":2256,"children":2257},{},[2258],{"type":612,"value":2259},"Advanced Features:",{"type":606,"tag":825,"props":2261,"children":2262},{},[2263,2274,2285],{"type":606,"tag":829,"props":2264,"children":2265},{},[2266,2272],{"type":606,"tag":632,"props":2267,"children":2269},{"className":2268},[],[2270],{"type":612,"value":2271},"defaultdict",{"type":612,"value":2273}," for automatic defaults",{"type":606,"tag":829,"props":2275,"children":2276},{},[2277,2283],{"type":606,"tag":632,"props":2278,"children":2280},{"className":2279},[],[2281],{"type":612,"value":2282},"setdefault()",{"type":612,"value":2284}," for get-or-set operations",{"type":606,"tag":829,"props":2286,"children":2287},{},[2288,2294],{"type":606,"tag":632,"props":2289,"children":2291},{"className":2290},[],[2292],{"type":612,"value":2293},"ChainMap",{"type":612,"value":2295}," for fallback hierarchies",{"type":606,"tag":615,"props":2297,"children":2298},{},[2299],{"type":606,"tag":819,"props":2300,"children":2301},{},[2302],{"type":612,"value":2303},"Best Practices:",{"type":606,"tag":825,"props":2305,"children":2306},{},[2307,2319,2330,2341],{"type":606,"tag":829,"props":2308,"children":2309},{},[2310,2312,2317],{"type":612,"value":2311},"Use ",{"type":606,"tag":632,"props":2313,"children":2315},{"className":2314},[],[2316],{"type":612,"value":2229},{"type":612,"value":2318}," for most cases",{"type":606,"tag":829,"props":2320,"children":2321},{},[2322,2323,2328],{"type":612,"value":2311},{"type":606,"tag":632,"props":2324,"children":2326},{"className":2325},[],[2327],{"type":612,"value":2271},{"type":612,"value":2329}," for counters/collections",{"type":606,"tag":829,"props":2331,"children":2332},{},[2333,2334,2339],{"type":612,"value":2311},{"type":606,"tag":632,"props":2335,"children":2337},{"className":2336},[],[2338],{"type":612,"value":848},{"type":612,"value":2340}," for conditional access",{"type":606,"tag":829,"props":2342,"children":2343},{},[2344],{"type":612,"value":2345},"Handle edge cases gracefully",{"type":606,"tag":615,"props":2347,"children":2348},{},[2349,2354],{"type":606,"tag":819,"props":2350,"children":2351},{},[2352],{"type":612,"value":2353},"Remember:",{"type":612,"value":2355}," Preventing KeyError exceptions makes your code more robust and user-friendly!",{"type":606,"tag":2357,"props":2358,"children":2359},"style",{},[2360],{"type":612,"value":2361},"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":2363},[2364,2367,2368],{"id":799,"depth":27,"text":802,"children":2365},[2366],{"id":909,"depth":36,"text":912},{"id":1453,"depth":27,"text":1456},{"id":2201,"depth":27,"text":2204},1782373755781]