[{"data":1,"prerenderedAt":4334},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/write-clean-code":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,"expanded":13},"/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,"expanded":13},"/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,"expanded":13},"/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,"expanded":13},"/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,"expanded":13},"/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,"expanded":13},"/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,"expanded":13},"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",[548],{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"body":602,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},{"type":603,"children":604,"toc":4325},"root",[605,613,619,1348,1355,1360,1463,1470,2770,2776,3882,3888,4150,4156,4294,4300,4305,4319],{"type":606,"tag":607,"props":608,"children":609},"element","h1",{"id":552},[610],{"type":611,"value":612},"text","✨ Write Clean Code",{"type":606,"tag":614,"props":615,"children":616},"p",{},[617],{"type":611,"value":618},"Clean code is easy to read, understand, and modify. It uses meaningful names, clear logic, and helpful comments. Writing clean code makes debugging easier and helps other developers work with your code.",{"type":606,"tag":620,"props":621,"children":622},"code-try",{},[623],{"type":606,"tag":624,"props":625,"children":629},"pre",{"className":626,"code":627,"language":628,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Example of clean, readable code\n\ndef calculate_monthly_payment(loan_amount: float, annual_rate: float, years: int) -> float:\n    \"\"\"Calculate monthly loan payment using standard formula.\"\"\"\n    \n    if loan_amount \u003C= 0 or annual_rate \u003C 0 or years \u003C= 0:\n        raise ValueError(\"All values must be positive\")\n    \n    # Convert annual rate to monthly rate\n    monthly_rate = annual_rate / 12 / 100\n    \n    # Calculate total number of payments\n    total_payments = years * 12\n    \n    # Handle zero interest rate\n    if monthly_rate == 0:\n        return loan_amount / total_payments\n    \n    # Apply standard loan payment formula\n    payment = loan_amount * (\n        monthly_rate * (1 + monthly_rate) ** total_payments\n    ) / (\n        (1 + monthly_rate) ** total_payments - 1\n    )\n    \n    return round(payment, 2)\n\n# Clean usage with meaningful variable names\nhome_price = 300000\ndown_payment = 60000\nloan_amount = home_price - down_payment\ninterest_rate = 4.5  # Annual percentage\nloan_term = 30  # Years\n\nmonthly_payment = calculate_monthly_payment(loan_amount, interest_rate, loan_term)\nprint(f\"Monthly payment: ${monthly_payment:,}\")\n","python",[630],{"type":606,"tag":631,"props":632,"children":633},"code",{"__ignoreMap":8},[634,645,653,713,722,730,793,821,828,837,874,881,889,915,922,930,955,976,983,991,1016,1057,1073,1112,1120,1127,1154,1161,1169,1186,1203,1229,1251,1273,1280,1297],{"type":606,"tag":635,"props":636,"children":638},"span",{"class":637,"line":12},"line",[639],{"type":606,"tag":635,"props":640,"children":642},{"style":641},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[643],{"type":611,"value":644},"# Example of clean, readable code\n",{"type":606,"tag":635,"props":646,"children":647},{"class":637,"line":27},[648],{"type":606,"tag":635,"props":649,"children":650},{"emptyLinePlaceholder":13},[651],{"type":611,"value":652},"\n",{"type":606,"tag":635,"props":654,"children":655},{"class":637,"line":36},[656,662,668,674,680,685,689,694,699,704,708],{"type":606,"tag":635,"props":657,"children":659},{"style":658},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[660],{"type":611,"value":661},"def",{"type":606,"tag":635,"props":663,"children":665},{"style":664},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[666],{"type":611,"value":667}," calculate_monthly_payment",{"type":606,"tag":635,"props":669,"children":671},{"style":670},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[672],{"type":611,"value":673},"(loan_amount: ",{"type":606,"tag":635,"props":675,"children":677},{"style":676},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[678],{"type":611,"value":679},"float",{"type":606,"tag":635,"props":681,"children":682},{"style":670},[683],{"type":611,"value":684},", annual_rate: ",{"type":606,"tag":635,"props":686,"children":687},{"style":676},[688],{"type":611,"value":679},{"type":606,"tag":635,"props":690,"children":691},{"style":670},[692],{"type":611,"value":693},", years: ",{"type":606,"tag":635,"props":695,"children":696},{"style":676},[697],{"type":611,"value":698},"int",{"type":606,"tag":635,"props":700,"children":701},{"style":670},[702],{"type":611,"value":703},") -> ",{"type":606,"tag":635,"props":705,"children":706},{"style":676},[707],{"type":611,"value":679},{"type":606,"tag":635,"props":709,"children":710},{"style":670},[711],{"type":611,"value":712},":\n",{"type":606,"tag":635,"props":714,"children":715},{"class":637,"line":45},[716],{"type":606,"tag":635,"props":717,"children":719},{"style":718},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[720],{"type":611,"value":721},"    \"\"\"Calculate monthly loan payment using standard formula.\"\"\"\n",{"type":606,"tag":635,"props":723,"children":724},{"class":637,"line":54},[725],{"type":606,"tag":635,"props":726,"children":727},{"style":670},[728],{"type":611,"value":729},"    \n",{"type":606,"tag":635,"props":731,"children":732},{"class":637,"line":63},[733,738,743,748,753,758,763,768,772,776,781,785,789],{"type":606,"tag":635,"props":734,"children":735},{"style":658},[736],{"type":611,"value":737},"    if",{"type":606,"tag":635,"props":739,"children":740},{"style":670},[741],{"type":611,"value":742}," loan_amount ",{"type":606,"tag":635,"props":744,"children":745},{"style":658},[746],{"type":611,"value":747},"\u003C=",{"type":606,"tag":635,"props":749,"children":750},{"style":676},[751],{"type":611,"value":752}," 0",{"type":606,"tag":635,"props":754,"children":755},{"style":658},[756],{"type":611,"value":757}," or",{"type":606,"tag":635,"props":759,"children":760},{"style":670},[761],{"type":611,"value":762}," annual_rate ",{"type":606,"tag":635,"props":764,"children":765},{"style":658},[766],{"type":611,"value":767},"\u003C",{"type":606,"tag":635,"props":769,"children":770},{"style":676},[771],{"type":611,"value":752},{"type":606,"tag":635,"props":773,"children":774},{"style":658},[775],{"type":611,"value":757},{"type":606,"tag":635,"props":777,"children":778},{"style":670},[779],{"type":611,"value":780}," years ",{"type":606,"tag":635,"props":782,"children":783},{"style":658},[784],{"type":611,"value":747},{"type":606,"tag":635,"props":786,"children":787},{"style":676},[788],{"type":611,"value":752},{"type":606,"tag":635,"props":790,"children":791},{"style":670},[792],{"type":611,"value":712},{"type":606,"tag":635,"props":794,"children":795},{"class":637,"line":72},[796,801,806,811,816],{"type":606,"tag":635,"props":797,"children":798},{"style":658},[799],{"type":611,"value":800},"        raise",{"type":606,"tag":635,"props":802,"children":803},{"style":676},[804],{"type":611,"value":805}," ValueError",{"type":606,"tag":635,"props":807,"children":808},{"style":670},[809],{"type":611,"value":810},"(",{"type":606,"tag":635,"props":812,"children":813},{"style":718},[814],{"type":611,"value":815},"\"All values must be positive\"",{"type":606,"tag":635,"props":817,"children":818},{"style":670},[819],{"type":611,"value":820},")\n",{"type":606,"tag":635,"props":822,"children":823},{"class":637,"line":81},[824],{"type":606,"tag":635,"props":825,"children":826},{"style":670},[827],{"type":611,"value":729},{"type":606,"tag":635,"props":829,"children":831},{"class":637,"line":830},9,[832],{"type":606,"tag":635,"props":833,"children":834},{"style":641},[835],{"type":611,"value":836},"    # Convert annual rate to monthly rate\n",{"type":606,"tag":635,"props":838,"children":839},{"class":637,"line":99},[840,845,850,854,859,864,869],{"type":606,"tag":635,"props":841,"children":842},{"style":670},[843],{"type":611,"value":844},"    monthly_rate ",{"type":606,"tag":635,"props":846,"children":847},{"style":658},[848],{"type":611,"value":849},"=",{"type":606,"tag":635,"props":851,"children":852},{"style":670},[853],{"type":611,"value":762},{"type":606,"tag":635,"props":855,"children":856},{"style":658},[857],{"type":611,"value":858},"/",{"type":606,"tag":635,"props":860,"children":861},{"style":676},[862],{"type":611,"value":863}," 12",{"type":606,"tag":635,"props":865,"children":866},{"style":658},[867],{"type":611,"value":868}," /",{"type":606,"tag":635,"props":870,"children":871},{"style":676},[872],{"type":611,"value":873}," 100\n",{"type":606,"tag":635,"props":875,"children":876},{"class":637,"line":108},[877],{"type":606,"tag":635,"props":878,"children":879},{"style":670},[880],{"type":611,"value":729},{"type":606,"tag":635,"props":882,"children":883},{"class":637,"line":117},[884],{"type":606,"tag":635,"props":885,"children":886},{"style":641},[887],{"type":611,"value":888},"    # Calculate total number of payments\n",{"type":606,"tag":635,"props":890,"children":891},{"class":637,"line":126},[892,897,901,905,910],{"type":606,"tag":635,"props":893,"children":894},{"style":670},[895],{"type":611,"value":896},"    total_payments ",{"type":606,"tag":635,"props":898,"children":899},{"style":658},[900],{"type":611,"value":849},{"type":606,"tag":635,"props":902,"children":903},{"style":670},[904],{"type":611,"value":780},{"type":606,"tag":635,"props":906,"children":907},{"style":658},[908],{"type":611,"value":909},"*",{"type":606,"tag":635,"props":911,"children":912},{"style":676},[913],{"type":611,"value":914}," 12\n",{"type":606,"tag":635,"props":916,"children":917},{"class":637,"line":135},[918],{"type":606,"tag":635,"props":919,"children":920},{"style":670},[921],{"type":611,"value":729},{"type":606,"tag":635,"props":923,"children":924},{"class":637,"line":144},[925],{"type":606,"tag":635,"props":926,"children":927},{"style":641},[928],{"type":611,"value":929},"    # Handle zero interest rate\n",{"type":606,"tag":635,"props":931,"children":932},{"class":637,"line":153},[933,937,942,947,951],{"type":606,"tag":635,"props":934,"children":935},{"style":658},[936],{"type":611,"value":737},{"type":606,"tag":635,"props":938,"children":939},{"style":670},[940],{"type":611,"value":941}," monthly_rate ",{"type":606,"tag":635,"props":943,"children":944},{"style":658},[945],{"type":611,"value":946},"==",{"type":606,"tag":635,"props":948,"children":949},{"style":676},[950],{"type":611,"value":752},{"type":606,"tag":635,"props":952,"children":953},{"style":670},[954],{"type":611,"value":712},{"type":606,"tag":635,"props":956,"children":957},{"class":637,"line":163},[958,963,967,971],{"type":606,"tag":635,"props":959,"children":960},{"style":658},[961],{"type":611,"value":962},"        return",{"type":606,"tag":635,"props":964,"children":965},{"style":670},[966],{"type":611,"value":742},{"type":606,"tag":635,"props":968,"children":969},{"style":658},[970],{"type":611,"value":858},{"type":606,"tag":635,"props":972,"children":973},{"style":670},[974],{"type":611,"value":975}," total_payments\n",{"type":606,"tag":635,"props":977,"children":978},{"class":637,"line":172},[979],{"type":606,"tag":635,"props":980,"children":981},{"style":670},[982],{"type":611,"value":729},{"type":606,"tag":635,"props":984,"children":985},{"class":637,"line":181},[986],{"type":606,"tag":635,"props":987,"children":988},{"style":641},[989],{"type":611,"value":990},"    # Apply standard loan payment formula\n",{"type":606,"tag":635,"props":992,"children":993},{"class":637,"line":190},[994,999,1003,1007,1011],{"type":606,"tag":635,"props":995,"children":996},{"style":670},[997],{"type":611,"value":998},"    payment ",{"type":606,"tag":635,"props":1000,"children":1001},{"style":658},[1002],{"type":611,"value":849},{"type":606,"tag":635,"props":1004,"children":1005},{"style":670},[1006],{"type":611,"value":742},{"type":606,"tag":635,"props":1008,"children":1009},{"style":658},[1010],{"type":611,"value":909},{"type":606,"tag":635,"props":1012,"children":1013},{"style":670},[1014],{"type":611,"value":1015}," (\n",{"type":606,"tag":635,"props":1017,"children":1018},{"class":637,"line":199},[1019,1024,1028,1033,1038,1043,1048,1053],{"type":606,"tag":635,"props":1020,"children":1021},{"style":670},[1022],{"type":611,"value":1023},"        monthly_rate ",{"type":606,"tag":635,"props":1025,"children":1026},{"style":658},[1027],{"type":611,"value":909},{"type":606,"tag":635,"props":1029,"children":1030},{"style":670},[1031],{"type":611,"value":1032}," (",{"type":606,"tag":635,"props":1034,"children":1035},{"style":676},[1036],{"type":611,"value":1037},"1",{"type":606,"tag":635,"props":1039,"children":1040},{"style":658},[1041],{"type":611,"value":1042}," +",{"type":606,"tag":635,"props":1044,"children":1045},{"style":670},[1046],{"type":611,"value":1047}," monthly_rate) ",{"type":606,"tag":635,"props":1049,"children":1050},{"style":658},[1051],{"type":611,"value":1052},"**",{"type":606,"tag":635,"props":1054,"children":1055},{"style":670},[1056],{"type":611,"value":975},{"type":606,"tag":635,"props":1058,"children":1059},{"class":637,"line":208},[1060,1065,1069],{"type":606,"tag":635,"props":1061,"children":1062},{"style":670},[1063],{"type":611,"value":1064},"    ) ",{"type":606,"tag":635,"props":1066,"children":1067},{"style":658},[1068],{"type":611,"value":858},{"type":606,"tag":635,"props":1070,"children":1071},{"style":670},[1072],{"type":611,"value":1015},{"type":606,"tag":635,"props":1074,"children":1075},{"class":637,"line":217},[1076,1081,1085,1089,1093,1097,1102,1107],{"type":606,"tag":635,"props":1077,"children":1078},{"style":670},[1079],{"type":611,"value":1080},"        (",{"type":606,"tag":635,"props":1082,"children":1083},{"style":676},[1084],{"type":611,"value":1037},{"type":606,"tag":635,"props":1086,"children":1087},{"style":658},[1088],{"type":611,"value":1042},{"type":606,"tag":635,"props":1090,"children":1091},{"style":670},[1092],{"type":611,"value":1047},{"type":606,"tag":635,"props":1094,"children":1095},{"style":658},[1096],{"type":611,"value":1052},{"type":606,"tag":635,"props":1098,"children":1099},{"style":670},[1100],{"type":611,"value":1101}," total_payments ",{"type":606,"tag":635,"props":1103,"children":1104},{"style":658},[1105],{"type":611,"value":1106},"-",{"type":606,"tag":635,"props":1108,"children":1109},{"style":676},[1110],{"type":611,"value":1111}," 1\n",{"type":606,"tag":635,"props":1113,"children":1114},{"class":637,"line":227},[1115],{"type":606,"tag":635,"props":1116,"children":1117},{"style":670},[1118],{"type":611,"value":1119},"    )\n",{"type":606,"tag":635,"props":1121,"children":1122},{"class":637,"line":236},[1123],{"type":606,"tag":635,"props":1124,"children":1125},{"style":670},[1126],{"type":611,"value":729},{"type":606,"tag":635,"props":1128,"children":1129},{"class":637,"line":245},[1130,1135,1140,1145,1150],{"type":606,"tag":635,"props":1131,"children":1132},{"style":658},[1133],{"type":611,"value":1134},"    return",{"type":606,"tag":635,"props":1136,"children":1137},{"style":676},[1138],{"type":611,"value":1139}," round",{"type":606,"tag":635,"props":1141,"children":1142},{"style":670},[1143],{"type":611,"value":1144},"(payment, ",{"type":606,"tag":635,"props":1146,"children":1147},{"style":676},[1148],{"type":611,"value":1149},"2",{"type":606,"tag":635,"props":1151,"children":1152},{"style":670},[1153],{"type":611,"value":820},{"type":606,"tag":635,"props":1155,"children":1156},{"class":637,"line":254},[1157],{"type":606,"tag":635,"props":1158,"children":1159},{"emptyLinePlaceholder":13},[1160],{"type":611,"value":652},{"type":606,"tag":635,"props":1162,"children":1163},{"class":637,"line":263},[1164],{"type":606,"tag":635,"props":1165,"children":1166},{"style":641},[1167],{"type":611,"value":1168},"# Clean usage with meaningful variable names\n",{"type":606,"tag":635,"props":1170,"children":1171},{"class":637,"line":272},[1172,1177,1181],{"type":606,"tag":635,"props":1173,"children":1174},{"style":670},[1175],{"type":611,"value":1176},"home_price ",{"type":606,"tag":635,"props":1178,"children":1179},{"style":658},[1180],{"type":611,"value":849},{"type":606,"tag":635,"props":1182,"children":1183},{"style":676},[1184],{"type":611,"value":1185}," 300000\n",{"type":606,"tag":635,"props":1187,"children":1188},{"class":637,"line":281},[1189,1194,1198],{"type":606,"tag":635,"props":1190,"children":1191},{"style":670},[1192],{"type":611,"value":1193},"down_payment ",{"type":606,"tag":635,"props":1195,"children":1196},{"style":658},[1197],{"type":611,"value":849},{"type":606,"tag":635,"props":1199,"children":1200},{"style":676},[1201],{"type":611,"value":1202}," 60000\n",{"type":606,"tag":635,"props":1204,"children":1205},{"class":637,"line":291},[1206,1211,1215,1220,1224],{"type":606,"tag":635,"props":1207,"children":1208},{"style":670},[1209],{"type":611,"value":1210},"loan_amount ",{"type":606,"tag":635,"props":1212,"children":1213},{"style":658},[1214],{"type":611,"value":849},{"type":606,"tag":635,"props":1216,"children":1217},{"style":670},[1218],{"type":611,"value":1219}," home_price ",{"type":606,"tag":635,"props":1221,"children":1222},{"style":658},[1223],{"type":611,"value":1106},{"type":606,"tag":635,"props":1225,"children":1226},{"style":670},[1227],{"type":611,"value":1228}," down_payment\n",{"type":606,"tag":635,"props":1230,"children":1231},{"class":637,"line":302},[1232,1237,1241,1246],{"type":606,"tag":635,"props":1233,"children":1234},{"style":670},[1235],{"type":611,"value":1236},"interest_rate ",{"type":606,"tag":635,"props":1238,"children":1239},{"style":658},[1240],{"type":611,"value":849},{"type":606,"tag":635,"props":1242,"children":1243},{"style":676},[1244],{"type":611,"value":1245}," 4.5",{"type":606,"tag":635,"props":1247,"children":1248},{"style":641},[1249],{"type":611,"value":1250},"  # Annual percentage\n",{"type":606,"tag":635,"props":1252,"children":1253},{"class":637,"line":311},[1254,1259,1263,1268],{"type":606,"tag":635,"props":1255,"children":1256},{"style":670},[1257],{"type":611,"value":1258},"loan_term ",{"type":606,"tag":635,"props":1260,"children":1261},{"style":658},[1262],{"type":611,"value":849},{"type":606,"tag":635,"props":1264,"children":1265},{"style":676},[1266],{"type":611,"value":1267}," 30",{"type":606,"tag":635,"props":1269,"children":1270},{"style":641},[1271],{"type":611,"value":1272},"  # Years\n",{"type":606,"tag":635,"props":1274,"children":1275},{"class":637,"line":320},[1276],{"type":606,"tag":635,"props":1277,"children":1278},{"emptyLinePlaceholder":13},[1279],{"type":611,"value":652},{"type":606,"tag":635,"props":1281,"children":1282},{"class":637,"line":329},[1283,1288,1292],{"type":606,"tag":635,"props":1284,"children":1285},{"style":670},[1286],{"type":611,"value":1287},"monthly_payment ",{"type":606,"tag":635,"props":1289,"children":1290},{"style":658},[1291],{"type":611,"value":849},{"type":606,"tag":635,"props":1293,"children":1294},{"style":670},[1295],{"type":611,"value":1296}," calculate_monthly_payment(loan_amount, interest_rate, loan_term)\n",{"type":606,"tag":635,"props":1298,"children":1299},{"class":637,"line":338},[1300,1305,1309,1314,1319,1324,1329,1334,1339,1344],{"type":606,"tag":635,"props":1301,"children":1302},{"style":676},[1303],{"type":611,"value":1304},"print",{"type":606,"tag":635,"props":1306,"children":1307},{"style":670},[1308],{"type":611,"value":810},{"type":606,"tag":635,"props":1310,"children":1311},{"style":658},[1312],{"type":611,"value":1313},"f",{"type":606,"tag":635,"props":1315,"children":1316},{"style":718},[1317],{"type":611,"value":1318},"\"Monthly payment: $",{"type":606,"tag":635,"props":1320,"children":1321},{"style":676},[1322],{"type":611,"value":1323},"{",{"type":606,"tag":635,"props":1325,"children":1326},{"style":670},[1327],{"type":611,"value":1328},"monthly_payment",{"type":606,"tag":635,"props":1330,"children":1331},{"style":658},[1332],{"type":611,"value":1333},":,",{"type":606,"tag":635,"props":1335,"children":1336},{"style":676},[1337],{"type":611,"value":1338},"}",{"type":606,"tag":635,"props":1340,"children":1341},{"style":718},[1342],{"type":611,"value":1343},"\"",{"type":606,"tag":635,"props":1345,"children":1346},{"style":670},[1347],{"type":611,"value":820},{"type":606,"tag":1349,"props":1350,"children":1352},"h2",{"id":1351},"understanding-clean-code",[1353],{"type":611,"value":1354},"🎯 Understanding Clean Code",{"type":606,"tag":614,"props":1356,"children":1357},{},[1358],{"type":611,"value":1359},"Clean code follows principles that make it easy for humans to read and understand.",{"type":606,"tag":1361,"props":1362,"children":1366},"info-box",{"emoji":1363,"title":1364,"type":1365},"✨","Clean Code Principles","info",[1367,1376,1401,1409,1432,1440],{"type":606,"tag":614,"props":1368,"children":1369},{},[1370],{"type":606,"tag":1371,"props":1372,"children":1373},"strong",{},[1374],{"type":611,"value":1375},"Readability:",{"type":606,"tag":1377,"props":1378,"children":1379},"ul",{},[1380,1386,1391,1396],{"type":606,"tag":1381,"props":1382,"children":1383},"li",{},[1384],{"type":611,"value":1385},"Use descriptive variable and function names",{"type":606,"tag":1381,"props":1387,"children":1388},{},[1389],{"type":611,"value":1390},"Write clear, logical flow",{"type":606,"tag":1381,"props":1392,"children":1393},{},[1394],{"type":611,"value":1395},"Keep functions small and focused",{"type":606,"tag":1381,"props":1397,"children":1398},{},[1399],{"type":611,"value":1400},"Use consistent formatting",{"type":606,"tag":614,"props":1402,"children":1403},{},[1404],{"type":606,"tag":1371,"props":1405,"children":1406},{},[1407],{"type":611,"value":1408},"Simplicity:",{"type":606,"tag":1377,"props":1410,"children":1411},{},[1412,1417,1422,1427],{"type":606,"tag":1381,"props":1413,"children":1414},{},[1415],{"type":611,"value":1416},"Avoid complex nested logic",{"type":606,"tag":1381,"props":1418,"children":1419},{},[1420],{"type":611,"value":1421},"Use early returns to reduce nesting",{"type":606,"tag":1381,"props":1423,"children":1424},{},[1425],{"type":611,"value":1426},"Break complex operations into steps",{"type":606,"tag":1381,"props":1428,"children":1429},{},[1430],{"type":611,"value":1431},"Choose simple solutions over clever ones",{"type":606,"tag":614,"props":1433,"children":1434},{},[1435],{"type":606,"tag":1371,"props":1436,"children":1437},{},[1438],{"type":611,"value":1439},"Clarity:",{"type":606,"tag":1377,"props":1441,"children":1442},{},[1443,1448,1453,1458],{"type":606,"tag":1381,"props":1444,"children":1445},{},[1446],{"type":611,"value":1447},"Add comments to explain why, not what",{"type":606,"tag":1381,"props":1449,"children":1450},{},[1451],{"type":611,"value":1452},"Use meaningful variable names",{"type":606,"tag":1381,"props":1454,"children":1455},{},[1456],{"type":611,"value":1457},"Group related code together",{"type":606,"tag":1381,"props":1459,"children":1460},{},[1461],{"type":611,"value":1462},"Remove dead or unused code",{"type":606,"tag":1464,"props":1465,"children":1467},"h3",{"id":1466},"naming-conventions",[1468],{"type":611,"value":1469},"Naming Conventions",{"type":606,"tag":620,"props":1471,"children":1472},{},[1473],{"type":606,"tag":624,"props":1474,"children":1476},{"className":626,"code":1475,"language":628,"meta":8,"style":8},"# Good naming practices\n\n# Use descriptive names for variables\nuser_email = \"alice@example.com\"\ntotal_price = 199.99\nis_valid_user = True\nmax_retry_attempts = 3\n\n# Use clear function names that describe what they do\ndef send_welcome_email(user_email: str) -> bool:\n    \"\"\"Send welcome email to new user.\"\"\"\n    print(f\"Sending welcome email to {user_email}\")\n    return True\n\ndef calculate_discount_amount(original_price: float, discount_percent: float) -> float:\n    \"\"\"Calculate the discount amount in dollars.\"\"\"\n    return original_price * (discount_percent / 100)\n\ndef is_weekend_day(day_name: str) -> bool:\n    \"\"\"Check if the given day is a weekend day.\"\"\"\n    weekend_days = {'saturday', 'sunday'}\n    return day_name.lower() in weekend_days\n\n# Use clear class names\nclass CustomerOrder:\n    \"\"\"Represents a customer's order with items and shipping info.\"\"\"\n    \n    def __init__(self, customer_id: str):\n        self.customer_id = customer_id\n        self.order_items = []\n        self.shipping_address = None\n        self.order_date = None\n    \n    def add_item(self, product_name: str, quantity: int, unit_price: float):\n        \"\"\"Add an item to the order.\"\"\"\n        item = {\n            'product_name': product_name,\n            'quantity': quantity,\n            'unit_price': unit_price,\n            'total_price': quantity * unit_price\n        }\n        self.order_items.append(item)\n    \n    def get_order_total(self) -> float:\n        \"\"\"Calculate the total price of all items in the order.\"\"\"\n        return sum(item['total_price'] for item in self.order_items)\n\n# Example usage with clean, readable code\ndef process_customer_order():\n    \"\"\"Process a sample customer order.\"\"\"\n    \n    # Create new order\n    order = CustomerOrder(\"CUST-12345\")\n    \n    # Add items with clear names\n    order.add_item(\"Wireless Headphones\", 1, 89.99)\n    order.add_item(\"Phone Case\", 2, 15.99)\n    \n    # Calculate totals\n    subtotal = order.get_order_total()\n    tax_rate = 8.5  # Percent\n    tax_amount = calculate_discount_amount(subtotal, tax_rate)\n    final_total = subtotal + tax_amount\n    \n    print(f\"Order for customer {order.customer_id}\")\n    print(f\"Subtotal: ${subtotal:.2f}\")\n    print(f\"Tax ({tax_rate}%): ${tax_amount:.2f}\")\n    print(f\"Total: ${final_total:.2f}\")\n\nprocess_customer_order()\n",[1477],{"type":606,"tag":631,"props":1478,"children":1479},{"__ignoreMap":8},[1480,1488,1495,1503,1520,1537,1554,1571,1578,1586,1621,1629,1671,1682,1689,1731,1739,1773,1780,1813,1821,1858,1880,1887,1895,1912,1920,1927,1954,1976,1997,2018,2038,2045,2088,2096,2113,2126,2139,2152,2174,2182,2194,2201,2226,2234,2285,2292,2300,2317,2325,2332,2340,2366,2373,2381,2415,2448,2455,2463,2480,2502,2519,2546,2554,2596,2643,2707,2753,2761],{"type":606,"tag":635,"props":1481,"children":1482},{"class":637,"line":12},[1483],{"type":606,"tag":635,"props":1484,"children":1485},{"style":641},[1486],{"type":611,"value":1487},"# Good naming practices\n",{"type":606,"tag":635,"props":1489,"children":1490},{"class":637,"line":27},[1491],{"type":606,"tag":635,"props":1492,"children":1493},{"emptyLinePlaceholder":13},[1494],{"type":611,"value":652},{"type":606,"tag":635,"props":1496,"children":1497},{"class":637,"line":36},[1498],{"type":606,"tag":635,"props":1499,"children":1500},{"style":641},[1501],{"type":611,"value":1502},"# Use descriptive names for variables\n",{"type":606,"tag":635,"props":1504,"children":1505},{"class":637,"line":45},[1506,1511,1515],{"type":606,"tag":635,"props":1507,"children":1508},{"style":670},[1509],{"type":611,"value":1510},"user_email ",{"type":606,"tag":635,"props":1512,"children":1513},{"style":658},[1514],{"type":611,"value":849},{"type":606,"tag":635,"props":1516,"children":1517},{"style":718},[1518],{"type":611,"value":1519}," \"alice@example.com\"\n",{"type":606,"tag":635,"props":1521,"children":1522},{"class":637,"line":54},[1523,1528,1532],{"type":606,"tag":635,"props":1524,"children":1525},{"style":670},[1526],{"type":611,"value":1527},"total_price ",{"type":606,"tag":635,"props":1529,"children":1530},{"style":658},[1531],{"type":611,"value":849},{"type":606,"tag":635,"props":1533,"children":1534},{"style":676},[1535],{"type":611,"value":1536}," 199.99\n",{"type":606,"tag":635,"props":1538,"children":1539},{"class":637,"line":63},[1540,1545,1549],{"type":606,"tag":635,"props":1541,"children":1542},{"style":670},[1543],{"type":611,"value":1544},"is_valid_user ",{"type":606,"tag":635,"props":1546,"children":1547},{"style":658},[1548],{"type":611,"value":849},{"type":606,"tag":635,"props":1550,"children":1551},{"style":676},[1552],{"type":611,"value":1553}," True\n",{"type":606,"tag":635,"props":1555,"children":1556},{"class":637,"line":72},[1557,1562,1566],{"type":606,"tag":635,"props":1558,"children":1559},{"style":670},[1560],{"type":611,"value":1561},"max_retry_attempts ",{"type":606,"tag":635,"props":1563,"children":1564},{"style":658},[1565],{"type":611,"value":849},{"type":606,"tag":635,"props":1567,"children":1568},{"style":676},[1569],{"type":611,"value":1570}," 3\n",{"type":606,"tag":635,"props":1572,"children":1573},{"class":637,"line":81},[1574],{"type":606,"tag":635,"props":1575,"children":1576},{"emptyLinePlaceholder":13},[1577],{"type":611,"value":652},{"type":606,"tag":635,"props":1579,"children":1580},{"class":637,"line":830},[1581],{"type":606,"tag":635,"props":1582,"children":1583},{"style":641},[1584],{"type":611,"value":1585},"# Use clear function names that describe what they do\n",{"type":606,"tag":635,"props":1587,"children":1588},{"class":637,"line":99},[1589,1593,1598,1603,1608,1612,1617],{"type":606,"tag":635,"props":1590,"children":1591},{"style":658},[1592],{"type":611,"value":661},{"type":606,"tag":635,"props":1594,"children":1595},{"style":664},[1596],{"type":611,"value":1597}," send_welcome_email",{"type":606,"tag":635,"props":1599,"children":1600},{"style":670},[1601],{"type":611,"value":1602},"(user_email: ",{"type":606,"tag":635,"props":1604,"children":1605},{"style":676},[1606],{"type":611,"value":1607},"str",{"type":606,"tag":635,"props":1609,"children":1610},{"style":670},[1611],{"type":611,"value":703},{"type":606,"tag":635,"props":1613,"children":1614},{"style":676},[1615],{"type":611,"value":1616},"bool",{"type":606,"tag":635,"props":1618,"children":1619},{"style":670},[1620],{"type":611,"value":712},{"type":606,"tag":635,"props":1622,"children":1623},{"class":637,"line":108},[1624],{"type":606,"tag":635,"props":1625,"children":1626},{"style":718},[1627],{"type":611,"value":1628},"    \"\"\"Send welcome email to new user.\"\"\"\n",{"type":606,"tag":635,"props":1630,"children":1631},{"class":637,"line":117},[1632,1637,1641,1645,1650,1654,1659,1663,1667],{"type":606,"tag":635,"props":1633,"children":1634},{"style":676},[1635],{"type":611,"value":1636},"    print",{"type":606,"tag":635,"props":1638,"children":1639},{"style":670},[1640],{"type":611,"value":810},{"type":606,"tag":635,"props":1642,"children":1643},{"style":658},[1644],{"type":611,"value":1313},{"type":606,"tag":635,"props":1646,"children":1647},{"style":718},[1648],{"type":611,"value":1649},"\"Sending welcome email to ",{"type":606,"tag":635,"props":1651,"children":1652},{"style":676},[1653],{"type":611,"value":1323},{"type":606,"tag":635,"props":1655,"children":1656},{"style":670},[1657],{"type":611,"value":1658},"user_email",{"type":606,"tag":635,"props":1660,"children":1661},{"style":676},[1662],{"type":611,"value":1338},{"type":606,"tag":635,"props":1664,"children":1665},{"style":718},[1666],{"type":611,"value":1343},{"type":606,"tag":635,"props":1668,"children":1669},{"style":670},[1670],{"type":611,"value":820},{"type":606,"tag":635,"props":1672,"children":1673},{"class":637,"line":126},[1674,1678],{"type":606,"tag":635,"props":1675,"children":1676},{"style":658},[1677],{"type":611,"value":1134},{"type":606,"tag":635,"props":1679,"children":1680},{"style":676},[1681],{"type":611,"value":1553},{"type":606,"tag":635,"props":1683,"children":1684},{"class":637,"line":135},[1685],{"type":606,"tag":635,"props":1686,"children":1687},{"emptyLinePlaceholder":13},[1688],{"type":611,"value":652},{"type":606,"tag":635,"props":1690,"children":1691},{"class":637,"line":144},[1692,1696,1701,1706,1710,1715,1719,1723,1727],{"type":606,"tag":635,"props":1693,"children":1694},{"style":658},[1695],{"type":611,"value":661},{"type":606,"tag":635,"props":1697,"children":1698},{"style":664},[1699],{"type":611,"value":1700}," calculate_discount_amount",{"type":606,"tag":635,"props":1702,"children":1703},{"style":670},[1704],{"type":611,"value":1705},"(original_price: ",{"type":606,"tag":635,"props":1707,"children":1708},{"style":676},[1709],{"type":611,"value":679},{"type":606,"tag":635,"props":1711,"children":1712},{"style":670},[1713],{"type":611,"value":1714},", discount_percent: ",{"type":606,"tag":635,"props":1716,"children":1717},{"style":676},[1718],{"type":611,"value":679},{"type":606,"tag":635,"props":1720,"children":1721},{"style":670},[1722],{"type":611,"value":703},{"type":606,"tag":635,"props":1724,"children":1725},{"style":676},[1726],{"type":611,"value":679},{"type":606,"tag":635,"props":1728,"children":1729},{"style":670},[1730],{"type":611,"value":712},{"type":606,"tag":635,"props":1732,"children":1733},{"class":637,"line":153},[1734],{"type":606,"tag":635,"props":1735,"children":1736},{"style":718},[1737],{"type":611,"value":1738},"    \"\"\"Calculate the discount amount in dollars.\"\"\"\n",{"type":606,"tag":635,"props":1740,"children":1741},{"class":637,"line":163},[1742,1746,1751,1755,1760,1764,1769],{"type":606,"tag":635,"props":1743,"children":1744},{"style":658},[1745],{"type":611,"value":1134},{"type":606,"tag":635,"props":1747,"children":1748},{"style":670},[1749],{"type":611,"value":1750}," original_price ",{"type":606,"tag":635,"props":1752,"children":1753},{"style":658},[1754],{"type":611,"value":909},{"type":606,"tag":635,"props":1756,"children":1757},{"style":670},[1758],{"type":611,"value":1759}," (discount_percent ",{"type":606,"tag":635,"props":1761,"children":1762},{"style":658},[1763],{"type":611,"value":858},{"type":606,"tag":635,"props":1765,"children":1766},{"style":676},[1767],{"type":611,"value":1768}," 100",{"type":606,"tag":635,"props":1770,"children":1771},{"style":670},[1772],{"type":611,"value":820},{"type":606,"tag":635,"props":1774,"children":1775},{"class":637,"line":172},[1776],{"type":606,"tag":635,"props":1777,"children":1778},{"emptyLinePlaceholder":13},[1779],{"type":611,"value":652},{"type":606,"tag":635,"props":1781,"children":1782},{"class":637,"line":181},[1783,1787,1792,1797,1801,1805,1809],{"type":606,"tag":635,"props":1784,"children":1785},{"style":658},[1786],{"type":611,"value":661},{"type":606,"tag":635,"props":1788,"children":1789},{"style":664},[1790],{"type":611,"value":1791}," is_weekend_day",{"type":606,"tag":635,"props":1793,"children":1794},{"style":670},[1795],{"type":611,"value":1796},"(day_name: ",{"type":606,"tag":635,"props":1798,"children":1799},{"style":676},[1800],{"type":611,"value":1607},{"type":606,"tag":635,"props":1802,"children":1803},{"style":670},[1804],{"type":611,"value":703},{"type":606,"tag":635,"props":1806,"children":1807},{"style":676},[1808],{"type":611,"value":1616},{"type":606,"tag":635,"props":1810,"children":1811},{"style":670},[1812],{"type":611,"value":712},{"type":606,"tag":635,"props":1814,"children":1815},{"class":637,"line":190},[1816],{"type":606,"tag":635,"props":1817,"children":1818},{"style":718},[1819],{"type":611,"value":1820},"    \"\"\"Check if the given day is a weekend day.\"\"\"\n",{"type":606,"tag":635,"props":1822,"children":1823},{"class":637,"line":199},[1824,1829,1833,1838,1843,1848,1853],{"type":606,"tag":635,"props":1825,"children":1826},{"style":670},[1827],{"type":611,"value":1828},"    weekend_days ",{"type":606,"tag":635,"props":1830,"children":1831},{"style":658},[1832],{"type":611,"value":849},{"type":606,"tag":635,"props":1834,"children":1835},{"style":670},[1836],{"type":611,"value":1837}," {",{"type":606,"tag":635,"props":1839,"children":1840},{"style":718},[1841],{"type":611,"value":1842},"'saturday'",{"type":606,"tag":635,"props":1844,"children":1845},{"style":670},[1846],{"type":611,"value":1847},", ",{"type":606,"tag":635,"props":1849,"children":1850},{"style":718},[1851],{"type":611,"value":1852},"'sunday'",{"type":606,"tag":635,"props":1854,"children":1855},{"style":670},[1856],{"type":611,"value":1857},"}\n",{"type":606,"tag":635,"props":1859,"children":1860},{"class":637,"line":208},[1861,1865,1870,1875],{"type":606,"tag":635,"props":1862,"children":1863},{"style":658},[1864],{"type":611,"value":1134},{"type":606,"tag":635,"props":1866,"children":1867},{"style":670},[1868],{"type":611,"value":1869}," day_name.lower() ",{"type":606,"tag":635,"props":1871,"children":1872},{"style":658},[1873],{"type":611,"value":1874},"in",{"type":606,"tag":635,"props":1876,"children":1877},{"style":670},[1878],{"type":611,"value":1879}," weekend_days\n",{"type":606,"tag":635,"props":1881,"children":1882},{"class":637,"line":217},[1883],{"type":606,"tag":635,"props":1884,"children":1885},{"emptyLinePlaceholder":13},[1886],{"type":611,"value":652},{"type":606,"tag":635,"props":1888,"children":1889},{"class":637,"line":227},[1890],{"type":606,"tag":635,"props":1891,"children":1892},{"style":641},[1893],{"type":611,"value":1894},"# Use clear class names\n",{"type":606,"tag":635,"props":1896,"children":1897},{"class":637,"line":236},[1898,1903,1908],{"type":606,"tag":635,"props":1899,"children":1900},{"style":658},[1901],{"type":611,"value":1902},"class",{"type":606,"tag":635,"props":1904,"children":1905},{"style":664},[1906],{"type":611,"value":1907}," CustomerOrder",{"type":606,"tag":635,"props":1909,"children":1910},{"style":670},[1911],{"type":611,"value":712},{"type":606,"tag":635,"props":1913,"children":1914},{"class":637,"line":245},[1915],{"type":606,"tag":635,"props":1916,"children":1917},{"style":718},[1918],{"type":611,"value":1919},"    \"\"\"Represents a customer's order with items and shipping info.\"\"\"\n",{"type":606,"tag":635,"props":1921,"children":1922},{"class":637,"line":254},[1923],{"type":606,"tag":635,"props":1924,"children":1925},{"style":670},[1926],{"type":611,"value":729},{"type":606,"tag":635,"props":1928,"children":1929},{"class":637,"line":263},[1930,1935,1940,1945,1949],{"type":606,"tag":635,"props":1931,"children":1932},{"style":658},[1933],{"type":611,"value":1934},"    def",{"type":606,"tag":635,"props":1936,"children":1937},{"style":676},[1938],{"type":611,"value":1939}," __init__",{"type":606,"tag":635,"props":1941,"children":1942},{"style":670},[1943],{"type":611,"value":1944},"(self, customer_id: ",{"type":606,"tag":635,"props":1946,"children":1947},{"style":676},[1948],{"type":611,"value":1607},{"type":606,"tag":635,"props":1950,"children":1951},{"style":670},[1952],{"type":611,"value":1953},"):\n",{"type":606,"tag":635,"props":1955,"children":1956},{"class":637,"line":272},[1957,1962,1967,1971],{"type":606,"tag":635,"props":1958,"children":1959},{"style":676},[1960],{"type":611,"value":1961},"        self",{"type":606,"tag":635,"props":1963,"children":1964},{"style":670},[1965],{"type":611,"value":1966},".customer_id ",{"type":606,"tag":635,"props":1968,"children":1969},{"style":658},[1970],{"type":611,"value":849},{"type":606,"tag":635,"props":1972,"children":1973},{"style":670},[1974],{"type":611,"value":1975}," customer_id\n",{"type":606,"tag":635,"props":1977,"children":1978},{"class":637,"line":281},[1979,1983,1988,1992],{"type":606,"tag":635,"props":1980,"children":1981},{"style":676},[1982],{"type":611,"value":1961},{"type":606,"tag":635,"props":1984,"children":1985},{"style":670},[1986],{"type":611,"value":1987},".order_items ",{"type":606,"tag":635,"props":1989,"children":1990},{"style":658},[1991],{"type":611,"value":849},{"type":606,"tag":635,"props":1993,"children":1994},{"style":670},[1995],{"type":611,"value":1996}," []\n",{"type":606,"tag":635,"props":1998,"children":1999},{"class":637,"line":291},[2000,2004,2009,2013],{"type":606,"tag":635,"props":2001,"children":2002},{"style":676},[2003],{"type":611,"value":1961},{"type":606,"tag":635,"props":2005,"children":2006},{"style":670},[2007],{"type":611,"value":2008},".shipping_address ",{"type":606,"tag":635,"props":2010,"children":2011},{"style":658},[2012],{"type":611,"value":849},{"type":606,"tag":635,"props":2014,"children":2015},{"style":676},[2016],{"type":611,"value":2017}," None\n",{"type":606,"tag":635,"props":2019,"children":2020},{"class":637,"line":302},[2021,2025,2030,2034],{"type":606,"tag":635,"props":2022,"children":2023},{"style":676},[2024],{"type":611,"value":1961},{"type":606,"tag":635,"props":2026,"children":2027},{"style":670},[2028],{"type":611,"value":2029},".order_date ",{"type":606,"tag":635,"props":2031,"children":2032},{"style":658},[2033],{"type":611,"value":849},{"type":606,"tag":635,"props":2035,"children":2036},{"style":676},[2037],{"type":611,"value":2017},{"type":606,"tag":635,"props":2039,"children":2040},{"class":637,"line":311},[2041],{"type":606,"tag":635,"props":2042,"children":2043},{"style":670},[2044],{"type":611,"value":729},{"type":606,"tag":635,"props":2046,"children":2047},{"class":637,"line":320},[2048,2052,2057,2062,2066,2071,2075,2080,2084],{"type":606,"tag":635,"props":2049,"children":2050},{"style":658},[2051],{"type":611,"value":1934},{"type":606,"tag":635,"props":2053,"children":2054},{"style":664},[2055],{"type":611,"value":2056}," add_item",{"type":606,"tag":635,"props":2058,"children":2059},{"style":670},[2060],{"type":611,"value":2061},"(self, product_name: ",{"type":606,"tag":635,"props":2063,"children":2064},{"style":676},[2065],{"type":611,"value":1607},{"type":606,"tag":635,"props":2067,"children":2068},{"style":670},[2069],{"type":611,"value":2070},", quantity: ",{"type":606,"tag":635,"props":2072,"children":2073},{"style":676},[2074],{"type":611,"value":698},{"type":606,"tag":635,"props":2076,"children":2077},{"style":670},[2078],{"type":611,"value":2079},", unit_price: ",{"type":606,"tag":635,"props":2081,"children":2082},{"style":676},[2083],{"type":611,"value":679},{"type":606,"tag":635,"props":2085,"children":2086},{"style":670},[2087],{"type":611,"value":1953},{"type":606,"tag":635,"props":2089,"children":2090},{"class":637,"line":329},[2091],{"type":606,"tag":635,"props":2092,"children":2093},{"style":718},[2094],{"type":611,"value":2095},"        \"\"\"Add an item to the order.\"\"\"\n",{"type":606,"tag":635,"props":2097,"children":2098},{"class":637,"line":338},[2099,2104,2108],{"type":606,"tag":635,"props":2100,"children":2101},{"style":670},[2102],{"type":611,"value":2103},"        item ",{"type":606,"tag":635,"props":2105,"children":2106},{"style":658},[2107],{"type":611,"value":849},{"type":606,"tag":635,"props":2109,"children":2110},{"style":670},[2111],{"type":611,"value":2112}," {\n",{"type":606,"tag":635,"props":2114,"children":2115},{"class":637,"line":347},[2116,2121],{"type":606,"tag":635,"props":2117,"children":2118},{"style":718},[2119],{"type":611,"value":2120},"            'product_name'",{"type":606,"tag":635,"props":2122,"children":2123},{"style":670},[2124],{"type":611,"value":2125},": product_name,\n",{"type":606,"tag":635,"props":2127,"children":2128},{"class":637,"line":356},[2129,2134],{"type":606,"tag":635,"props":2130,"children":2131},{"style":718},[2132],{"type":611,"value":2133},"            'quantity'",{"type":606,"tag":635,"props":2135,"children":2136},{"style":670},[2137],{"type":611,"value":2138},": quantity,\n",{"type":606,"tag":635,"props":2140,"children":2141},{"class":637,"line":367},[2142,2147],{"type":606,"tag":635,"props":2143,"children":2144},{"style":718},[2145],{"type":611,"value":2146},"            'unit_price'",{"type":606,"tag":635,"props":2148,"children":2149},{"style":670},[2150],{"type":611,"value":2151},": unit_price,\n",{"type":606,"tag":635,"props":2153,"children":2154},{"class":637,"line":376},[2155,2160,2165,2169],{"type":606,"tag":635,"props":2156,"children":2157},{"style":718},[2158],{"type":611,"value":2159},"            'total_price'",{"type":606,"tag":635,"props":2161,"children":2162},{"style":670},[2163],{"type":611,"value":2164},": quantity ",{"type":606,"tag":635,"props":2166,"children":2167},{"style":658},[2168],{"type":611,"value":909},{"type":606,"tag":635,"props":2170,"children":2171},{"style":670},[2172],{"type":611,"value":2173}," unit_price\n",{"type":606,"tag":635,"props":2175,"children":2176},{"class":637,"line":385},[2177],{"type":606,"tag":635,"props":2178,"children":2179},{"style":670},[2180],{"type":611,"value":2181},"        }\n",{"type":606,"tag":635,"props":2183,"children":2184},{"class":637,"line":394},[2185,2189],{"type":606,"tag":635,"props":2186,"children":2187},{"style":676},[2188],{"type":611,"value":1961},{"type":606,"tag":635,"props":2190,"children":2191},{"style":670},[2192],{"type":611,"value":2193},".order_items.append(item)\n",{"type":606,"tag":635,"props":2195,"children":2196},{"class":637,"line":403},[2197],{"type":606,"tag":635,"props":2198,"children":2199},{"style":670},[2200],{"type":611,"value":729},{"type":606,"tag":635,"props":2202,"children":2203},{"class":637,"line":412},[2204,2208,2213,2218,2222],{"type":606,"tag":635,"props":2205,"children":2206},{"style":658},[2207],{"type":611,"value":1934},{"type":606,"tag":635,"props":2209,"children":2210},{"style":664},[2211],{"type":611,"value":2212}," get_order_total",{"type":606,"tag":635,"props":2214,"children":2215},{"style":670},[2216],{"type":611,"value":2217},"(self) -> ",{"type":606,"tag":635,"props":2219,"children":2220},{"style":676},[2221],{"type":611,"value":679},{"type":606,"tag":635,"props":2223,"children":2224},{"style":670},[2225],{"type":611,"value":712},{"type":606,"tag":635,"props":2227,"children":2228},{"class":637,"line":423},[2229],{"type":606,"tag":635,"props":2230,"children":2231},{"style":718},[2232],{"type":611,"value":2233},"        \"\"\"Calculate the total price of all items in the order.\"\"\"\n",{"type":606,"tag":635,"props":2235,"children":2236},{"class":637,"line":432},[2237,2241,2246,2251,2256,2261,2266,2271,2275,2280],{"type":606,"tag":635,"props":2238,"children":2239},{"style":658},[2240],{"type":611,"value":962},{"type":606,"tag":635,"props":2242,"children":2243},{"style":676},[2244],{"type":611,"value":2245}," sum",{"type":606,"tag":635,"props":2247,"children":2248},{"style":670},[2249],{"type":611,"value":2250},"(item[",{"type":606,"tag":635,"props":2252,"children":2253},{"style":718},[2254],{"type":611,"value":2255},"'total_price'",{"type":606,"tag":635,"props":2257,"children":2258},{"style":670},[2259],{"type":611,"value":2260},"] ",{"type":606,"tag":635,"props":2262,"children":2263},{"style":658},[2264],{"type":611,"value":2265},"for",{"type":606,"tag":635,"props":2267,"children":2268},{"style":670},[2269],{"type":611,"value":2270}," item ",{"type":606,"tag":635,"props":2272,"children":2273},{"style":658},[2274],{"type":611,"value":1874},{"type":606,"tag":635,"props":2276,"children":2277},{"style":676},[2278],{"type":611,"value":2279}," self",{"type":606,"tag":635,"props":2281,"children":2282},{"style":670},[2283],{"type":611,"value":2284},".order_items)\n",{"type":606,"tag":635,"props":2286,"children":2287},{"class":637,"line":441},[2288],{"type":606,"tag":635,"props":2289,"children":2290},{"emptyLinePlaceholder":13},[2291],{"type":611,"value":652},{"type":606,"tag":635,"props":2293,"children":2294},{"class":637,"line":450},[2295],{"type":606,"tag":635,"props":2296,"children":2297},{"style":641},[2298],{"type":611,"value":2299},"# Example usage with clean, readable code\n",{"type":606,"tag":635,"props":2301,"children":2302},{"class":637,"line":459},[2303,2307,2312],{"type":606,"tag":635,"props":2304,"children":2305},{"style":658},[2306],{"type":611,"value":661},{"type":606,"tag":635,"props":2308,"children":2309},{"style":664},[2310],{"type":611,"value":2311}," process_customer_order",{"type":606,"tag":635,"props":2313,"children":2314},{"style":670},[2315],{"type":611,"value":2316},"():\n",{"type":606,"tag":635,"props":2318,"children":2319},{"class":637,"line":468},[2320],{"type":606,"tag":635,"props":2321,"children":2322},{"style":718},[2323],{"type":611,"value":2324},"    \"\"\"Process a sample customer order.\"\"\"\n",{"type":606,"tag":635,"props":2326,"children":2327},{"class":637,"line":477},[2328],{"type":606,"tag":635,"props":2329,"children":2330},{"style":670},[2331],{"type":611,"value":729},{"type":606,"tag":635,"props":2333,"children":2334},{"class":637,"line":488},[2335],{"type":606,"tag":635,"props":2336,"children":2337},{"style":641},[2338],{"type":611,"value":2339},"    # Create new order\n",{"type":606,"tag":635,"props":2341,"children":2342},{"class":637,"line":497},[2343,2348,2352,2357,2362],{"type":606,"tag":635,"props":2344,"children":2345},{"style":670},[2346],{"type":611,"value":2347},"    order ",{"type":606,"tag":635,"props":2349,"children":2350},{"style":658},[2351],{"type":611,"value":849},{"type":606,"tag":635,"props":2353,"children":2354},{"style":670},[2355],{"type":611,"value":2356}," CustomerOrder(",{"type":606,"tag":635,"props":2358,"children":2359},{"style":718},[2360],{"type":611,"value":2361},"\"CUST-12345\"",{"type":606,"tag":635,"props":2363,"children":2364},{"style":670},[2365],{"type":611,"value":820},{"type":606,"tag":635,"props":2367,"children":2368},{"class":637,"line":506},[2369],{"type":606,"tag":635,"props":2370,"children":2371},{"style":670},[2372],{"type":611,"value":729},{"type":606,"tag":635,"props":2374,"children":2375},{"class":637,"line":515},[2376],{"type":606,"tag":635,"props":2377,"children":2378},{"style":641},[2379],{"type":611,"value":2380},"    # Add items with clear names\n",{"type":606,"tag":635,"props":2382,"children":2383},{"class":637,"line":524},[2384,2389,2394,2398,2402,2406,2411],{"type":606,"tag":635,"props":2385,"children":2386},{"style":670},[2387],{"type":611,"value":2388},"    order.add_item(",{"type":606,"tag":635,"props":2390,"children":2391},{"style":718},[2392],{"type":611,"value":2393},"\"Wireless Headphones\"",{"type":606,"tag":635,"props":2395,"children":2396},{"style":670},[2397],{"type":611,"value":1847},{"type":606,"tag":635,"props":2399,"children":2400},{"style":676},[2401],{"type":611,"value":1037},{"type":606,"tag":635,"props":2403,"children":2404},{"style":670},[2405],{"type":611,"value":1847},{"type":606,"tag":635,"props":2407,"children":2408},{"style":676},[2409],{"type":611,"value":2410},"89.99",{"type":606,"tag":635,"props":2412,"children":2413},{"style":670},[2414],{"type":611,"value":820},{"type":606,"tag":635,"props":2416,"children":2417},{"class":637,"line":533},[2418,2422,2427,2431,2435,2439,2444],{"type":606,"tag":635,"props":2419,"children":2420},{"style":670},[2421],{"type":611,"value":2388},{"type":606,"tag":635,"props":2423,"children":2424},{"style":718},[2425],{"type":611,"value":2426},"\"Phone Case\"",{"type":606,"tag":635,"props":2428,"children":2429},{"style":670},[2430],{"type":611,"value":1847},{"type":606,"tag":635,"props":2432,"children":2433},{"style":676},[2434],{"type":611,"value":1149},{"type":606,"tag":635,"props":2436,"children":2437},{"style":670},[2438],{"type":611,"value":1847},{"type":606,"tag":635,"props":2440,"children":2441},{"style":676},[2442],{"type":611,"value":2443},"15.99",{"type":606,"tag":635,"props":2445,"children":2446},{"style":670},[2447],{"type":611,"value":820},{"type":606,"tag":635,"props":2449,"children":2450},{"class":637,"line":544},[2451],{"type":606,"tag":635,"props":2452,"children":2453},{"style":670},[2454],{"type":611,"value":729},{"type":606,"tag":635,"props":2456,"children":2457},{"class":637,"line":553},[2458],{"type":606,"tag":635,"props":2459,"children":2460},{"style":641},[2461],{"type":611,"value":2462},"    # Calculate totals\n",{"type":606,"tag":635,"props":2464,"children":2465},{"class":637,"line":562},[2466,2471,2475],{"type":606,"tag":635,"props":2467,"children":2468},{"style":670},[2469],{"type":611,"value":2470},"    subtotal ",{"type":606,"tag":635,"props":2472,"children":2473},{"style":658},[2474],{"type":611,"value":849},{"type":606,"tag":635,"props":2476,"children":2477},{"style":670},[2478],{"type":611,"value":2479}," order.get_order_total()\n",{"type":606,"tag":635,"props":2481,"children":2482},{"class":637,"line":571},[2483,2488,2492,2497],{"type":606,"tag":635,"props":2484,"children":2485},{"style":670},[2486],{"type":611,"value":2487},"    tax_rate ",{"type":606,"tag":635,"props":2489,"children":2490},{"style":658},[2491],{"type":611,"value":849},{"type":606,"tag":635,"props":2493,"children":2494},{"style":676},[2495],{"type":611,"value":2496}," 8.5",{"type":606,"tag":635,"props":2498,"children":2499},{"style":641},[2500],{"type":611,"value":2501},"  # Percent\n",{"type":606,"tag":635,"props":2503,"children":2504},{"class":637,"line":580},[2505,2510,2514],{"type":606,"tag":635,"props":2506,"children":2507},{"style":670},[2508],{"type":611,"value":2509},"    tax_amount ",{"type":606,"tag":635,"props":2511,"children":2512},{"style":658},[2513],{"type":611,"value":849},{"type":606,"tag":635,"props":2515,"children":2516},{"style":670},[2517],{"type":611,"value":2518}," calculate_discount_amount(subtotal, tax_rate)\n",{"type":606,"tag":635,"props":2520,"children":2521},{"class":637,"line":589},[2522,2527,2531,2536,2541],{"type":606,"tag":635,"props":2523,"children":2524},{"style":670},[2525],{"type":611,"value":2526},"    final_total ",{"type":606,"tag":635,"props":2528,"children":2529},{"style":658},[2530],{"type":611,"value":849},{"type":606,"tag":635,"props":2532,"children":2533},{"style":670},[2534],{"type":611,"value":2535}," subtotal ",{"type":606,"tag":635,"props":2537,"children":2538},{"style":658},[2539],{"type":611,"value":2540},"+",{"type":606,"tag":635,"props":2542,"children":2543},{"style":670},[2544],{"type":611,"value":2545}," tax_amount\n",{"type":606,"tag":635,"props":2547,"children":2549},{"class":637,"line":2548},64,[2550],{"type":606,"tag":635,"props":2551,"children":2552},{"style":670},[2553],{"type":611,"value":729},{"type":606,"tag":635,"props":2555,"children":2557},{"class":637,"line":2556},65,[2558,2562,2566,2570,2575,2579,2584,2588,2592],{"type":606,"tag":635,"props":2559,"children":2560},{"style":676},[2561],{"type":611,"value":1636},{"type":606,"tag":635,"props":2563,"children":2564},{"style":670},[2565],{"type":611,"value":810},{"type":606,"tag":635,"props":2567,"children":2568},{"style":658},[2569],{"type":611,"value":1313},{"type":606,"tag":635,"props":2571,"children":2572},{"style":718},[2573],{"type":611,"value":2574},"\"Order for customer ",{"type":606,"tag":635,"props":2576,"children":2577},{"style":676},[2578],{"type":611,"value":1323},{"type":606,"tag":635,"props":2580,"children":2581},{"style":670},[2582],{"type":611,"value":2583},"order.customer_id",{"type":606,"tag":635,"props":2585,"children":2586},{"style":676},[2587],{"type":611,"value":1338},{"type":606,"tag":635,"props":2589,"children":2590},{"style":718},[2591],{"type":611,"value":1343},{"type":606,"tag":635,"props":2593,"children":2594},{"style":670},[2595],{"type":611,"value":820},{"type":606,"tag":635,"props":2597,"children":2599},{"class":637,"line":2598},66,[2600,2604,2608,2612,2617,2621,2626,2631,2635,2639],{"type":606,"tag":635,"props":2601,"children":2602},{"style":676},[2603],{"type":611,"value":1636},{"type":606,"tag":635,"props":2605,"children":2606},{"style":670},[2607],{"type":611,"value":810},{"type":606,"tag":635,"props":2609,"children":2610},{"style":658},[2611],{"type":611,"value":1313},{"type":606,"tag":635,"props":2613,"children":2614},{"style":718},[2615],{"type":611,"value":2616},"\"Subtotal: $",{"type":606,"tag":635,"props":2618,"children":2619},{"style":676},[2620],{"type":611,"value":1323},{"type":606,"tag":635,"props":2622,"children":2623},{"style":670},[2624],{"type":611,"value":2625},"subtotal",{"type":606,"tag":635,"props":2627,"children":2628},{"style":658},[2629],{"type":611,"value":2630},":.2f",{"type":606,"tag":635,"props":2632,"children":2633},{"style":676},[2634],{"type":611,"value":1338},{"type":606,"tag":635,"props":2636,"children":2637},{"style":718},[2638],{"type":611,"value":1343},{"type":606,"tag":635,"props":2640,"children":2641},{"style":670},[2642],{"type":611,"value":820},{"type":606,"tag":635,"props":2644,"children":2646},{"class":637,"line":2645},67,[2647,2651,2655,2659,2664,2668,2673,2677,2682,2686,2691,2695,2699,2703],{"type":606,"tag":635,"props":2648,"children":2649},{"style":676},[2650],{"type":611,"value":1636},{"type":606,"tag":635,"props":2652,"children":2653},{"style":670},[2654],{"type":611,"value":810},{"type":606,"tag":635,"props":2656,"children":2657},{"style":658},[2658],{"type":611,"value":1313},{"type":606,"tag":635,"props":2660,"children":2661},{"style":718},[2662],{"type":611,"value":2663},"\"Tax (",{"type":606,"tag":635,"props":2665,"children":2666},{"style":676},[2667],{"type":611,"value":1323},{"type":606,"tag":635,"props":2669,"children":2670},{"style":670},[2671],{"type":611,"value":2672},"tax_rate",{"type":606,"tag":635,"props":2674,"children":2675},{"style":676},[2676],{"type":611,"value":1338},{"type":606,"tag":635,"props":2678,"children":2679},{"style":718},[2680],{"type":611,"value":2681},"%): $",{"type":606,"tag":635,"props":2683,"children":2684},{"style":676},[2685],{"type":611,"value":1323},{"type":606,"tag":635,"props":2687,"children":2688},{"style":670},[2689],{"type":611,"value":2690},"tax_amount",{"type":606,"tag":635,"props":2692,"children":2693},{"style":658},[2694],{"type":611,"value":2630},{"type":606,"tag":635,"props":2696,"children":2697},{"style":676},[2698],{"type":611,"value":1338},{"type":606,"tag":635,"props":2700,"children":2701},{"style":718},[2702],{"type":611,"value":1343},{"type":606,"tag":635,"props":2704,"children":2705},{"style":670},[2706],{"type":611,"value":820},{"type":606,"tag":635,"props":2708,"children":2710},{"class":637,"line":2709},68,[2711,2715,2719,2723,2728,2732,2737,2741,2745,2749],{"type":606,"tag":635,"props":2712,"children":2713},{"style":676},[2714],{"type":611,"value":1636},{"type":606,"tag":635,"props":2716,"children":2717},{"style":670},[2718],{"type":611,"value":810},{"type":606,"tag":635,"props":2720,"children":2721},{"style":658},[2722],{"type":611,"value":1313},{"type":606,"tag":635,"props":2724,"children":2725},{"style":718},[2726],{"type":611,"value":2727},"\"Total: $",{"type":606,"tag":635,"props":2729,"children":2730},{"style":676},[2731],{"type":611,"value":1323},{"type":606,"tag":635,"props":2733,"children":2734},{"style":670},[2735],{"type":611,"value":2736},"final_total",{"type":606,"tag":635,"props":2738,"children":2739},{"style":658},[2740],{"type":611,"value":2630},{"type":606,"tag":635,"props":2742,"children":2743},{"style":676},[2744],{"type":611,"value":1338},{"type":606,"tag":635,"props":2746,"children":2747},{"style":718},[2748],{"type":611,"value":1343},{"type":606,"tag":635,"props":2750,"children":2751},{"style":670},[2752],{"type":611,"value":820},{"type":606,"tag":635,"props":2754,"children":2756},{"class":637,"line":2755},69,[2757],{"type":606,"tag":635,"props":2758,"children":2759},{"emptyLinePlaceholder":13},[2760],{"type":611,"value":652},{"type":606,"tag":635,"props":2762,"children":2764},{"class":637,"line":2763},70,[2765],{"type":606,"tag":635,"props":2766,"children":2767},{"style":670},[2768],{"type":611,"value":2769},"process_customer_order()\n",{"type":606,"tag":1464,"props":2771,"children":2773},{"id":2772},"clear-logic-and-control-flow",[2774],{"type":611,"value":2775},"Clear Logic and Control Flow",{"type":606,"tag":620,"props":2777,"children":2778},{},[2779],{"type":606,"tag":624,"props":2780,"children":2782},{"className":626,"code":2781,"language":628,"meta":8,"style":8},"# Clean control flow and logic\n\ndef validate_user_input(username: str, password: str, email: str) -> dict:\n    \"\"\"Validate user registration input and return result.\"\"\"\n    \n    # Use early returns for validation\n    if not username or len(username) \u003C 3:\n        return {\n            'valid': False,\n            'error': 'Username must be at least 3 characters'\n        }\n    \n    if not password or len(password) \u003C 8:\n        return {\n            'valid': False,\n            'error': 'Password must be at least 8 characters'\n        }\n    \n    if not email or '@' not in email:\n        return {\n            'valid': False,\n            'error': 'Please provide a valid email address'\n        }\n    \n    # All validations passed\n    return {\n        'valid': True,\n        'error': None\n    }\n\ndef determine_shipping_cost(weight_kg: float, distance_km: float, is_express: bool) -> float:\n    \"\"\"Calculate shipping cost based on weight, distance, and service type.\"\"\"\n    \n    # Base rate calculation\n    base_rate = 5.00\n    weight_rate = weight_kg * 0.50\n    distance_rate = distance_km * 0.02\n    \n    total_cost = base_rate + weight_rate + distance_rate\n    \n    # Apply express shipping surcharge\n    if is_express:\n        express_multiplier = 1.5\n        total_cost *= express_multiplier\n    \n    # Apply volume discounts\n    if total_cost > 50:\n        discount_rate = 0.10  # 10% discount for orders over $50\n        total_cost *= (1 - discount_rate)\n    \n    return round(total_cost, 2)\n\n# Example usage\ndef test_clean_code_examples():\n    \"\"\"Test the clean code examples.\"\"\"\n    \n    # Test validation\n    validation_result = validate_user_input(\"alice123\", \"secure_password\", \"alice@example.com\")\n    print(f\"Validation: {validation_result}\")\n    \n    # Test shipping calculation\n    shipping_cost = determine_shipping_cost(2.5, 100, True)\n    print(f\"Shipping cost: ${shipping_cost}\")\n\ntest_clean_code_examples()\n",[2783],{"type":606,"tag":631,"props":2784,"children":2785},{"__ignoreMap":8},[2786,2794,2801,2853,2861,2868,2876,2921,2932,2955,2972,2979,2986,3028,3039,3058,3074,3081,3088,3127,3138,3157,3173,3180,3187,3195,3206,3227,3244,3252,3259,3310,3318,3325,3333,3350,3376,3402,3409,3444,3451,3459,3471,3488,3506,3513,3521,3547,3569,3598,3605,3629,3636,3644,3660,3668,3675,3683,3727,3768,3775,3783,3826,3867,3874],{"type":606,"tag":635,"props":2787,"children":2788},{"class":637,"line":12},[2789],{"type":606,"tag":635,"props":2790,"children":2791},{"style":641},[2792],{"type":611,"value":2793},"# Clean control flow and logic\n",{"type":606,"tag":635,"props":2795,"children":2796},{"class":637,"line":27},[2797],{"type":606,"tag":635,"props":2798,"children":2799},{"emptyLinePlaceholder":13},[2800],{"type":611,"value":652},{"type":606,"tag":635,"props":2802,"children":2803},{"class":637,"line":36},[2804,2808,2813,2818,2822,2827,2831,2836,2840,2844,2849],{"type":606,"tag":635,"props":2805,"children":2806},{"style":658},[2807],{"type":611,"value":661},{"type":606,"tag":635,"props":2809,"children":2810},{"style":664},[2811],{"type":611,"value":2812}," validate_user_input",{"type":606,"tag":635,"props":2814,"children":2815},{"style":670},[2816],{"type":611,"value":2817},"(username: ",{"type":606,"tag":635,"props":2819,"children":2820},{"style":676},[2821],{"type":611,"value":1607},{"type":606,"tag":635,"props":2823,"children":2824},{"style":670},[2825],{"type":611,"value":2826},", password: ",{"type":606,"tag":635,"props":2828,"children":2829},{"style":676},[2830],{"type":611,"value":1607},{"type":606,"tag":635,"props":2832,"children":2833},{"style":670},[2834],{"type":611,"value":2835},", email: ",{"type":606,"tag":635,"props":2837,"children":2838},{"style":676},[2839],{"type":611,"value":1607},{"type":606,"tag":635,"props":2841,"children":2842},{"style":670},[2843],{"type":611,"value":703},{"type":606,"tag":635,"props":2845,"children":2846},{"style":676},[2847],{"type":611,"value":2848},"dict",{"type":606,"tag":635,"props":2850,"children":2851},{"style":670},[2852],{"type":611,"value":712},{"type":606,"tag":635,"props":2854,"children":2855},{"class":637,"line":45},[2856],{"type":606,"tag":635,"props":2857,"children":2858},{"style":718},[2859],{"type":611,"value":2860},"    \"\"\"Validate user registration input and return result.\"\"\"\n",{"type":606,"tag":635,"props":2862,"children":2863},{"class":637,"line":54},[2864],{"type":606,"tag":635,"props":2865,"children":2866},{"style":670},[2867],{"type":611,"value":729},{"type":606,"tag":635,"props":2869,"children":2870},{"class":637,"line":63},[2871],{"type":606,"tag":635,"props":2872,"children":2873},{"style":641},[2874],{"type":611,"value":2875},"    # Use early returns for validation\n",{"type":606,"tag":635,"props":2877,"children":2878},{"class":637,"line":72},[2879,2883,2888,2893,2898,2903,2908,2912,2917],{"type":606,"tag":635,"props":2880,"children":2881},{"style":658},[2882],{"type":611,"value":737},{"type":606,"tag":635,"props":2884,"children":2885},{"style":658},[2886],{"type":611,"value":2887}," not",{"type":606,"tag":635,"props":2889,"children":2890},{"style":670},[2891],{"type":611,"value":2892}," username ",{"type":606,"tag":635,"props":2894,"children":2895},{"style":658},[2896],{"type":611,"value":2897},"or",{"type":606,"tag":635,"props":2899,"children":2900},{"style":676},[2901],{"type":611,"value":2902}," len",{"type":606,"tag":635,"props":2904,"children":2905},{"style":670},[2906],{"type":611,"value":2907},"(username) ",{"type":606,"tag":635,"props":2909,"children":2910},{"style":658},[2911],{"type":611,"value":767},{"type":606,"tag":635,"props":2913,"children":2914},{"style":676},[2915],{"type":611,"value":2916}," 3",{"type":606,"tag":635,"props":2918,"children":2919},{"style":670},[2920],{"type":611,"value":712},{"type":606,"tag":635,"props":2922,"children":2923},{"class":637,"line":81},[2924,2928],{"type":606,"tag":635,"props":2925,"children":2926},{"style":658},[2927],{"type":611,"value":962},{"type":606,"tag":635,"props":2929,"children":2930},{"style":670},[2931],{"type":611,"value":2112},{"type":606,"tag":635,"props":2933,"children":2934},{"class":637,"line":830},[2935,2940,2945,2950],{"type":606,"tag":635,"props":2936,"children":2937},{"style":718},[2938],{"type":611,"value":2939},"            'valid'",{"type":606,"tag":635,"props":2941,"children":2942},{"style":670},[2943],{"type":611,"value":2944},": ",{"type":606,"tag":635,"props":2946,"children":2947},{"style":676},[2948],{"type":611,"value":2949},"False",{"type":606,"tag":635,"props":2951,"children":2952},{"style":670},[2953],{"type":611,"value":2954},",\n",{"type":606,"tag":635,"props":2956,"children":2957},{"class":637,"line":99},[2958,2963,2967],{"type":606,"tag":635,"props":2959,"children":2960},{"style":718},[2961],{"type":611,"value":2962},"            'error'",{"type":606,"tag":635,"props":2964,"children":2965},{"style":670},[2966],{"type":611,"value":2944},{"type":606,"tag":635,"props":2968,"children":2969},{"style":718},[2970],{"type":611,"value":2971},"'Username must be at least 3 characters'\n",{"type":606,"tag":635,"props":2973,"children":2974},{"class":637,"line":108},[2975],{"type":606,"tag":635,"props":2976,"children":2977},{"style":670},[2978],{"type":611,"value":2181},{"type":606,"tag":635,"props":2980,"children":2981},{"class":637,"line":117},[2982],{"type":606,"tag":635,"props":2983,"children":2984},{"style":670},[2985],{"type":611,"value":729},{"type":606,"tag":635,"props":2987,"children":2988},{"class":637,"line":126},[2989,2993,2997,3002,3006,3010,3015,3019,3024],{"type":606,"tag":635,"props":2990,"children":2991},{"style":658},[2992],{"type":611,"value":737},{"type":606,"tag":635,"props":2994,"children":2995},{"style":658},[2996],{"type":611,"value":2887},{"type":606,"tag":635,"props":2998,"children":2999},{"style":670},[3000],{"type":611,"value":3001}," password ",{"type":606,"tag":635,"props":3003,"children":3004},{"style":658},[3005],{"type":611,"value":2897},{"type":606,"tag":635,"props":3007,"children":3008},{"style":676},[3009],{"type":611,"value":2902},{"type":606,"tag":635,"props":3011,"children":3012},{"style":670},[3013],{"type":611,"value":3014},"(password) ",{"type":606,"tag":635,"props":3016,"children":3017},{"style":658},[3018],{"type":611,"value":767},{"type":606,"tag":635,"props":3020,"children":3021},{"style":676},[3022],{"type":611,"value":3023}," 8",{"type":606,"tag":635,"props":3025,"children":3026},{"style":670},[3027],{"type":611,"value":712},{"type":606,"tag":635,"props":3029,"children":3030},{"class":637,"line":135},[3031,3035],{"type":606,"tag":635,"props":3032,"children":3033},{"style":658},[3034],{"type":611,"value":962},{"type":606,"tag":635,"props":3036,"children":3037},{"style":670},[3038],{"type":611,"value":2112},{"type":606,"tag":635,"props":3040,"children":3041},{"class":637,"line":144},[3042,3046,3050,3054],{"type":606,"tag":635,"props":3043,"children":3044},{"style":718},[3045],{"type":611,"value":2939},{"type":606,"tag":635,"props":3047,"children":3048},{"style":670},[3049],{"type":611,"value":2944},{"type":606,"tag":635,"props":3051,"children":3052},{"style":676},[3053],{"type":611,"value":2949},{"type":606,"tag":635,"props":3055,"children":3056},{"style":670},[3057],{"type":611,"value":2954},{"type":606,"tag":635,"props":3059,"children":3060},{"class":637,"line":153},[3061,3065,3069],{"type":606,"tag":635,"props":3062,"children":3063},{"style":718},[3064],{"type":611,"value":2962},{"type":606,"tag":635,"props":3066,"children":3067},{"style":670},[3068],{"type":611,"value":2944},{"type":606,"tag":635,"props":3070,"children":3071},{"style":718},[3072],{"type":611,"value":3073},"'Password must be at least 8 characters'\n",{"type":606,"tag":635,"props":3075,"children":3076},{"class":637,"line":163},[3077],{"type":606,"tag":635,"props":3078,"children":3079},{"style":670},[3080],{"type":611,"value":2181},{"type":606,"tag":635,"props":3082,"children":3083},{"class":637,"line":172},[3084],{"type":606,"tag":635,"props":3085,"children":3086},{"style":670},[3087],{"type":611,"value":729},{"type":606,"tag":635,"props":3089,"children":3090},{"class":637,"line":181},[3091,3095,3099,3104,3108,3113,3117,3122],{"type":606,"tag":635,"props":3092,"children":3093},{"style":658},[3094],{"type":611,"value":737},{"type":606,"tag":635,"props":3096,"children":3097},{"style":658},[3098],{"type":611,"value":2887},{"type":606,"tag":635,"props":3100,"children":3101},{"style":670},[3102],{"type":611,"value":3103}," email ",{"type":606,"tag":635,"props":3105,"children":3106},{"style":658},[3107],{"type":611,"value":2897},{"type":606,"tag":635,"props":3109,"children":3110},{"style":718},[3111],{"type":611,"value":3112}," '@'",{"type":606,"tag":635,"props":3114,"children":3115},{"style":658},[3116],{"type":611,"value":2887},{"type":606,"tag":635,"props":3118,"children":3119},{"style":658},[3120],{"type":611,"value":3121}," in",{"type":606,"tag":635,"props":3123,"children":3124},{"style":670},[3125],{"type":611,"value":3126}," email:\n",{"type":606,"tag":635,"props":3128,"children":3129},{"class":637,"line":190},[3130,3134],{"type":606,"tag":635,"props":3131,"children":3132},{"style":658},[3133],{"type":611,"value":962},{"type":606,"tag":635,"props":3135,"children":3136},{"style":670},[3137],{"type":611,"value":2112},{"type":606,"tag":635,"props":3139,"children":3140},{"class":637,"line":199},[3141,3145,3149,3153],{"type":606,"tag":635,"props":3142,"children":3143},{"style":718},[3144],{"type":611,"value":2939},{"type":606,"tag":635,"props":3146,"children":3147},{"style":670},[3148],{"type":611,"value":2944},{"type":606,"tag":635,"props":3150,"children":3151},{"style":676},[3152],{"type":611,"value":2949},{"type":606,"tag":635,"props":3154,"children":3155},{"style":670},[3156],{"type":611,"value":2954},{"type":606,"tag":635,"props":3158,"children":3159},{"class":637,"line":208},[3160,3164,3168],{"type":606,"tag":635,"props":3161,"children":3162},{"style":718},[3163],{"type":611,"value":2962},{"type":606,"tag":635,"props":3165,"children":3166},{"style":670},[3167],{"type":611,"value":2944},{"type":606,"tag":635,"props":3169,"children":3170},{"style":718},[3171],{"type":611,"value":3172},"'Please provide a valid email address'\n",{"type":606,"tag":635,"props":3174,"children":3175},{"class":637,"line":217},[3176],{"type":606,"tag":635,"props":3177,"children":3178},{"style":670},[3179],{"type":611,"value":2181},{"type":606,"tag":635,"props":3181,"children":3182},{"class":637,"line":227},[3183],{"type":606,"tag":635,"props":3184,"children":3185},{"style":670},[3186],{"type":611,"value":729},{"type":606,"tag":635,"props":3188,"children":3189},{"class":637,"line":236},[3190],{"type":606,"tag":635,"props":3191,"children":3192},{"style":641},[3193],{"type":611,"value":3194},"    # All validations passed\n",{"type":606,"tag":635,"props":3196,"children":3197},{"class":637,"line":245},[3198,3202],{"type":606,"tag":635,"props":3199,"children":3200},{"style":658},[3201],{"type":611,"value":1134},{"type":606,"tag":635,"props":3203,"children":3204},{"style":670},[3205],{"type":611,"value":2112},{"type":606,"tag":635,"props":3207,"children":3208},{"class":637,"line":254},[3209,3214,3218,3223],{"type":606,"tag":635,"props":3210,"children":3211},{"style":718},[3212],{"type":611,"value":3213},"        'valid'",{"type":606,"tag":635,"props":3215,"children":3216},{"style":670},[3217],{"type":611,"value":2944},{"type":606,"tag":635,"props":3219,"children":3220},{"style":676},[3221],{"type":611,"value":3222},"True",{"type":606,"tag":635,"props":3224,"children":3225},{"style":670},[3226],{"type":611,"value":2954},{"type":606,"tag":635,"props":3228,"children":3229},{"class":637,"line":263},[3230,3235,3239],{"type":606,"tag":635,"props":3231,"children":3232},{"style":718},[3233],{"type":611,"value":3234},"        'error'",{"type":606,"tag":635,"props":3236,"children":3237},{"style":670},[3238],{"type":611,"value":2944},{"type":606,"tag":635,"props":3240,"children":3241},{"style":676},[3242],{"type":611,"value":3243},"None\n",{"type":606,"tag":635,"props":3245,"children":3246},{"class":637,"line":272},[3247],{"type":606,"tag":635,"props":3248,"children":3249},{"style":670},[3250],{"type":611,"value":3251},"    }\n",{"type":606,"tag":635,"props":3253,"children":3254},{"class":637,"line":281},[3255],{"type":606,"tag":635,"props":3256,"children":3257},{"emptyLinePlaceholder":13},[3258],{"type":611,"value":652},{"type":606,"tag":635,"props":3260,"children":3261},{"class":637,"line":291},[3262,3266,3271,3276,3280,3285,3289,3294,3298,3302,3306],{"type":606,"tag":635,"props":3263,"children":3264},{"style":658},[3265],{"type":611,"value":661},{"type":606,"tag":635,"props":3267,"children":3268},{"style":664},[3269],{"type":611,"value":3270}," determine_shipping_cost",{"type":606,"tag":635,"props":3272,"children":3273},{"style":670},[3274],{"type":611,"value":3275},"(weight_kg: ",{"type":606,"tag":635,"props":3277,"children":3278},{"style":676},[3279],{"type":611,"value":679},{"type":606,"tag":635,"props":3281,"children":3282},{"style":670},[3283],{"type":611,"value":3284},", distance_km: ",{"type":606,"tag":635,"props":3286,"children":3287},{"style":676},[3288],{"type":611,"value":679},{"type":606,"tag":635,"props":3290,"children":3291},{"style":670},[3292],{"type":611,"value":3293},", is_express: ",{"type":606,"tag":635,"props":3295,"children":3296},{"style":676},[3297],{"type":611,"value":1616},{"type":606,"tag":635,"props":3299,"children":3300},{"style":670},[3301],{"type":611,"value":703},{"type":606,"tag":635,"props":3303,"children":3304},{"style":676},[3305],{"type":611,"value":679},{"type":606,"tag":635,"props":3307,"children":3308},{"style":670},[3309],{"type":611,"value":712},{"type":606,"tag":635,"props":3311,"children":3312},{"class":637,"line":302},[3313],{"type":606,"tag":635,"props":3314,"children":3315},{"style":718},[3316],{"type":611,"value":3317},"    \"\"\"Calculate shipping cost based on weight, distance, and service type.\"\"\"\n",{"type":606,"tag":635,"props":3319,"children":3320},{"class":637,"line":311},[3321],{"type":606,"tag":635,"props":3322,"children":3323},{"style":670},[3324],{"type":611,"value":729},{"type":606,"tag":635,"props":3326,"children":3327},{"class":637,"line":320},[3328],{"type":606,"tag":635,"props":3329,"children":3330},{"style":641},[3331],{"type":611,"value":3332},"    # Base rate calculation\n",{"type":606,"tag":635,"props":3334,"children":3335},{"class":637,"line":329},[3336,3341,3345],{"type":606,"tag":635,"props":3337,"children":3338},{"style":670},[3339],{"type":611,"value":3340},"    base_rate ",{"type":606,"tag":635,"props":3342,"children":3343},{"style":658},[3344],{"type":611,"value":849},{"type":606,"tag":635,"props":3346,"children":3347},{"style":676},[3348],{"type":611,"value":3349}," 5.00\n",{"type":606,"tag":635,"props":3351,"children":3352},{"class":637,"line":338},[3353,3358,3362,3367,3371],{"type":606,"tag":635,"props":3354,"children":3355},{"style":670},[3356],{"type":611,"value":3357},"    weight_rate ",{"type":606,"tag":635,"props":3359,"children":3360},{"style":658},[3361],{"type":611,"value":849},{"type":606,"tag":635,"props":3363,"children":3364},{"style":670},[3365],{"type":611,"value":3366}," weight_kg ",{"type":606,"tag":635,"props":3368,"children":3369},{"style":658},[3370],{"type":611,"value":909},{"type":606,"tag":635,"props":3372,"children":3373},{"style":676},[3374],{"type":611,"value":3375}," 0.50\n",{"type":606,"tag":635,"props":3377,"children":3378},{"class":637,"line":347},[3379,3384,3388,3393,3397],{"type":606,"tag":635,"props":3380,"children":3381},{"style":670},[3382],{"type":611,"value":3383},"    distance_rate ",{"type":606,"tag":635,"props":3385,"children":3386},{"style":658},[3387],{"type":611,"value":849},{"type":606,"tag":635,"props":3389,"children":3390},{"style":670},[3391],{"type":611,"value":3392}," distance_km ",{"type":606,"tag":635,"props":3394,"children":3395},{"style":658},[3396],{"type":611,"value":909},{"type":606,"tag":635,"props":3398,"children":3399},{"style":676},[3400],{"type":611,"value":3401}," 0.02\n",{"type":606,"tag":635,"props":3403,"children":3404},{"class":637,"line":356},[3405],{"type":606,"tag":635,"props":3406,"children":3407},{"style":670},[3408],{"type":611,"value":729},{"type":606,"tag":635,"props":3410,"children":3411},{"class":637,"line":367},[3412,3417,3421,3426,3430,3435,3439],{"type":606,"tag":635,"props":3413,"children":3414},{"style":670},[3415],{"type":611,"value":3416},"    total_cost ",{"type":606,"tag":635,"props":3418,"children":3419},{"style":658},[3420],{"type":611,"value":849},{"type":606,"tag":635,"props":3422,"children":3423},{"style":670},[3424],{"type":611,"value":3425}," base_rate ",{"type":606,"tag":635,"props":3427,"children":3428},{"style":658},[3429],{"type":611,"value":2540},{"type":606,"tag":635,"props":3431,"children":3432},{"style":670},[3433],{"type":611,"value":3434}," weight_rate ",{"type":606,"tag":635,"props":3436,"children":3437},{"style":658},[3438],{"type":611,"value":2540},{"type":606,"tag":635,"props":3440,"children":3441},{"style":670},[3442],{"type":611,"value":3443}," distance_rate\n",{"type":606,"tag":635,"props":3445,"children":3446},{"class":637,"line":376},[3447],{"type":606,"tag":635,"props":3448,"children":3449},{"style":670},[3450],{"type":611,"value":729},{"type":606,"tag":635,"props":3452,"children":3453},{"class":637,"line":385},[3454],{"type":606,"tag":635,"props":3455,"children":3456},{"style":641},[3457],{"type":611,"value":3458},"    # Apply express shipping surcharge\n",{"type":606,"tag":635,"props":3460,"children":3461},{"class":637,"line":394},[3462,3466],{"type":606,"tag":635,"props":3463,"children":3464},{"style":658},[3465],{"type":611,"value":737},{"type":606,"tag":635,"props":3467,"children":3468},{"style":670},[3469],{"type":611,"value":3470}," is_express:\n",{"type":606,"tag":635,"props":3472,"children":3473},{"class":637,"line":403},[3474,3479,3483],{"type":606,"tag":635,"props":3475,"children":3476},{"style":670},[3477],{"type":611,"value":3478},"        express_multiplier ",{"type":606,"tag":635,"props":3480,"children":3481},{"style":658},[3482],{"type":611,"value":849},{"type":606,"tag":635,"props":3484,"children":3485},{"style":676},[3486],{"type":611,"value":3487}," 1.5\n",{"type":606,"tag":635,"props":3489,"children":3490},{"class":637,"line":412},[3491,3496,3501],{"type":606,"tag":635,"props":3492,"children":3493},{"style":670},[3494],{"type":611,"value":3495},"        total_cost ",{"type":606,"tag":635,"props":3497,"children":3498},{"style":658},[3499],{"type":611,"value":3500},"*=",{"type":606,"tag":635,"props":3502,"children":3503},{"style":670},[3504],{"type":611,"value":3505}," express_multiplier\n",{"type":606,"tag":635,"props":3507,"children":3508},{"class":637,"line":423},[3509],{"type":606,"tag":635,"props":3510,"children":3511},{"style":670},[3512],{"type":611,"value":729},{"type":606,"tag":635,"props":3514,"children":3515},{"class":637,"line":432},[3516],{"type":606,"tag":635,"props":3517,"children":3518},{"style":641},[3519],{"type":611,"value":3520},"    # Apply volume discounts\n",{"type":606,"tag":635,"props":3522,"children":3523},{"class":637,"line":441},[3524,3528,3533,3538,3543],{"type":606,"tag":635,"props":3525,"children":3526},{"style":658},[3527],{"type":611,"value":737},{"type":606,"tag":635,"props":3529,"children":3530},{"style":670},[3531],{"type":611,"value":3532}," total_cost ",{"type":606,"tag":635,"props":3534,"children":3535},{"style":658},[3536],{"type":611,"value":3537},">",{"type":606,"tag":635,"props":3539,"children":3540},{"style":676},[3541],{"type":611,"value":3542}," 50",{"type":606,"tag":635,"props":3544,"children":3545},{"style":670},[3546],{"type":611,"value":712},{"type":606,"tag":635,"props":3548,"children":3549},{"class":637,"line":450},[3550,3555,3559,3564],{"type":606,"tag":635,"props":3551,"children":3552},{"style":670},[3553],{"type":611,"value":3554},"        discount_rate ",{"type":606,"tag":635,"props":3556,"children":3557},{"style":658},[3558],{"type":611,"value":849},{"type":606,"tag":635,"props":3560,"children":3561},{"style":676},[3562],{"type":611,"value":3563}," 0.10",{"type":606,"tag":635,"props":3565,"children":3566},{"style":641},[3567],{"type":611,"value":3568},"  # 10% discount for orders over $50\n",{"type":606,"tag":635,"props":3570,"children":3571},{"class":637,"line":459},[3572,3576,3580,3584,3588,3593],{"type":606,"tag":635,"props":3573,"children":3574},{"style":670},[3575],{"type":611,"value":3495},{"type":606,"tag":635,"props":3577,"children":3578},{"style":658},[3579],{"type":611,"value":3500},{"type":606,"tag":635,"props":3581,"children":3582},{"style":670},[3583],{"type":611,"value":1032},{"type":606,"tag":635,"props":3585,"children":3586},{"style":676},[3587],{"type":611,"value":1037},{"type":606,"tag":635,"props":3589,"children":3590},{"style":658},[3591],{"type":611,"value":3592}," -",{"type":606,"tag":635,"props":3594,"children":3595},{"style":670},[3596],{"type":611,"value":3597}," discount_rate)\n",{"type":606,"tag":635,"props":3599,"children":3600},{"class":637,"line":468},[3601],{"type":606,"tag":635,"props":3602,"children":3603},{"style":670},[3604],{"type":611,"value":729},{"type":606,"tag":635,"props":3606,"children":3607},{"class":637,"line":477},[3608,3612,3616,3621,3625],{"type":606,"tag":635,"props":3609,"children":3610},{"style":658},[3611],{"type":611,"value":1134},{"type":606,"tag":635,"props":3613,"children":3614},{"style":676},[3615],{"type":611,"value":1139},{"type":606,"tag":635,"props":3617,"children":3618},{"style":670},[3619],{"type":611,"value":3620},"(total_cost, ",{"type":606,"tag":635,"props":3622,"children":3623},{"style":676},[3624],{"type":611,"value":1149},{"type":606,"tag":635,"props":3626,"children":3627},{"style":670},[3628],{"type":611,"value":820},{"type":606,"tag":635,"props":3630,"children":3631},{"class":637,"line":488},[3632],{"type":606,"tag":635,"props":3633,"children":3634},{"emptyLinePlaceholder":13},[3635],{"type":611,"value":652},{"type":606,"tag":635,"props":3637,"children":3638},{"class":637,"line":497},[3639],{"type":606,"tag":635,"props":3640,"children":3641},{"style":641},[3642],{"type":611,"value":3643},"# Example usage\n",{"type":606,"tag":635,"props":3645,"children":3646},{"class":637,"line":506},[3647,3651,3656],{"type":606,"tag":635,"props":3648,"children":3649},{"style":658},[3650],{"type":611,"value":661},{"type":606,"tag":635,"props":3652,"children":3653},{"style":664},[3654],{"type":611,"value":3655}," test_clean_code_examples",{"type":606,"tag":635,"props":3657,"children":3658},{"style":670},[3659],{"type":611,"value":2316},{"type":606,"tag":635,"props":3661,"children":3662},{"class":637,"line":515},[3663],{"type":606,"tag":635,"props":3664,"children":3665},{"style":718},[3666],{"type":611,"value":3667},"    \"\"\"Test the clean code examples.\"\"\"\n",{"type":606,"tag":635,"props":3669,"children":3670},{"class":637,"line":524},[3671],{"type":606,"tag":635,"props":3672,"children":3673},{"style":670},[3674],{"type":611,"value":729},{"type":606,"tag":635,"props":3676,"children":3677},{"class":637,"line":533},[3678],{"type":606,"tag":635,"props":3679,"children":3680},{"style":641},[3681],{"type":611,"value":3682},"    # Test validation\n",{"type":606,"tag":635,"props":3684,"children":3685},{"class":637,"line":544},[3686,3691,3695,3700,3705,3709,3714,3718,3723],{"type":606,"tag":635,"props":3687,"children":3688},{"style":670},[3689],{"type":611,"value":3690},"    validation_result ",{"type":606,"tag":635,"props":3692,"children":3693},{"style":658},[3694],{"type":611,"value":849},{"type":606,"tag":635,"props":3696,"children":3697},{"style":670},[3698],{"type":611,"value":3699}," validate_user_input(",{"type":606,"tag":635,"props":3701,"children":3702},{"style":718},[3703],{"type":611,"value":3704},"\"alice123\"",{"type":606,"tag":635,"props":3706,"children":3707},{"style":670},[3708],{"type":611,"value":1847},{"type":606,"tag":635,"props":3710,"children":3711},{"style":718},[3712],{"type":611,"value":3713},"\"secure_password\"",{"type":606,"tag":635,"props":3715,"children":3716},{"style":670},[3717],{"type":611,"value":1847},{"type":606,"tag":635,"props":3719,"children":3720},{"style":718},[3721],{"type":611,"value":3722},"\"alice@example.com\"",{"type":606,"tag":635,"props":3724,"children":3725},{"style":670},[3726],{"type":611,"value":820},{"type":606,"tag":635,"props":3728,"children":3729},{"class":637,"line":553},[3730,3734,3738,3742,3747,3751,3756,3760,3764],{"type":606,"tag":635,"props":3731,"children":3732},{"style":676},[3733],{"type":611,"value":1636},{"type":606,"tag":635,"props":3735,"children":3736},{"style":670},[3737],{"type":611,"value":810},{"type":606,"tag":635,"props":3739,"children":3740},{"style":658},[3741],{"type":611,"value":1313},{"type":606,"tag":635,"props":3743,"children":3744},{"style":718},[3745],{"type":611,"value":3746},"\"Validation: ",{"type":606,"tag":635,"props":3748,"children":3749},{"style":676},[3750],{"type":611,"value":1323},{"type":606,"tag":635,"props":3752,"children":3753},{"style":670},[3754],{"type":611,"value":3755},"validation_result",{"type":606,"tag":635,"props":3757,"children":3758},{"style":676},[3759],{"type":611,"value":1338},{"type":606,"tag":635,"props":3761,"children":3762},{"style":718},[3763],{"type":611,"value":1343},{"type":606,"tag":635,"props":3765,"children":3766},{"style":670},[3767],{"type":611,"value":820},{"type":606,"tag":635,"props":3769,"children":3770},{"class":637,"line":562},[3771],{"type":606,"tag":635,"props":3772,"children":3773},{"style":670},[3774],{"type":611,"value":729},{"type":606,"tag":635,"props":3776,"children":3777},{"class":637,"line":571},[3778],{"type":606,"tag":635,"props":3779,"children":3780},{"style":641},[3781],{"type":611,"value":3782},"    # Test shipping calculation\n",{"type":606,"tag":635,"props":3784,"children":3785},{"class":637,"line":580},[3786,3791,3795,3800,3805,3809,3814,3818,3822],{"type":606,"tag":635,"props":3787,"children":3788},{"style":670},[3789],{"type":611,"value":3790},"    shipping_cost ",{"type":606,"tag":635,"props":3792,"children":3793},{"style":658},[3794],{"type":611,"value":849},{"type":606,"tag":635,"props":3796,"children":3797},{"style":670},[3798],{"type":611,"value":3799}," determine_shipping_cost(",{"type":606,"tag":635,"props":3801,"children":3802},{"style":676},[3803],{"type":611,"value":3804},"2.5",{"type":606,"tag":635,"props":3806,"children":3807},{"style":670},[3808],{"type":611,"value":1847},{"type":606,"tag":635,"props":3810,"children":3811},{"style":676},[3812],{"type":611,"value":3813},"100",{"type":606,"tag":635,"props":3815,"children":3816},{"style":670},[3817],{"type":611,"value":1847},{"type":606,"tag":635,"props":3819,"children":3820},{"style":676},[3821],{"type":611,"value":3222},{"type":606,"tag":635,"props":3823,"children":3824},{"style":670},[3825],{"type":611,"value":820},{"type":606,"tag":635,"props":3827,"children":3828},{"class":637,"line":589},[3829,3833,3837,3841,3846,3850,3855,3859,3863],{"type":606,"tag":635,"props":3830,"children":3831},{"style":676},[3832],{"type":611,"value":1636},{"type":606,"tag":635,"props":3834,"children":3835},{"style":670},[3836],{"type":611,"value":810},{"type":606,"tag":635,"props":3838,"children":3839},{"style":658},[3840],{"type":611,"value":1313},{"type":606,"tag":635,"props":3842,"children":3843},{"style":718},[3844],{"type":611,"value":3845},"\"Shipping cost: $",{"type":606,"tag":635,"props":3847,"children":3848},{"style":676},[3849],{"type":611,"value":1323},{"type":606,"tag":635,"props":3851,"children":3852},{"style":670},[3853],{"type":611,"value":3854},"shipping_cost",{"type":606,"tag":635,"props":3856,"children":3857},{"style":676},[3858],{"type":611,"value":1338},{"type":606,"tag":635,"props":3860,"children":3861},{"style":718},[3862],{"type":611,"value":1343},{"type":606,"tag":635,"props":3864,"children":3865},{"style":670},[3866],{"type":611,"value":820},{"type":606,"tag":635,"props":3868,"children":3869},{"class":637,"line":2548},[3870],{"type":606,"tag":635,"props":3871,"children":3872},{"emptyLinePlaceholder":13},[3873],{"type":611,"value":652},{"type":606,"tag":635,"props":3875,"children":3876},{"class":637,"line":2556},[3877],{"type":606,"tag":635,"props":3878,"children":3879},{"style":670},[3880],{"type":611,"value":3881},"test_clean_code_examples()\n",{"type":606,"tag":1349,"props":3883,"children":3885},{"id":3884},"clean-code-guidelines",[3886],{"type":611,"value":3887},"📋 Clean Code Guidelines",{"type":606,"tag":3889,"props":3890,"children":3891},"table",{},[3892,3916],{"type":606,"tag":3893,"props":3894,"children":3895},"thead",{},[3896],{"type":606,"tag":3897,"props":3898,"children":3899},"tr",{},[3900,3906,3911],{"type":606,"tag":3901,"props":3902,"children":3903},"th",{},[3904],{"type":611,"value":3905},"Aspect",{"type":606,"tag":3901,"props":3907,"children":3908},{},[3909],{"type":611,"value":3910},"Good Practice",{"type":606,"tag":3901,"props":3912,"children":3913},{},[3914],{"type":611,"value":3915},"Bad Practice",{"type":606,"tag":3917,"props":3918,"children":3919},"tbody",{},[3920,3971,4014,4043,4086,4129],{"type":606,"tag":3897,"props":3921,"children":3922},{},[3923,3932,3948],{"type":606,"tag":3924,"props":3925,"children":3926},"td",{},[3927],{"type":606,"tag":1371,"props":3928,"children":3929},{},[3930],{"type":611,"value":3931},"Variables",{"type":606,"tag":3924,"props":3933,"children":3934},{},[3935,3941,3942],{"type":606,"tag":631,"props":3936,"children":3938},{"className":3937},[],[3939],{"type":611,"value":3940},"user_count",{"type":611,"value":1847},{"type":606,"tag":631,"props":3943,"children":3945},{"className":3944},[],[3946],{"type":611,"value":3947},"total_price",{"type":606,"tag":3924,"props":3949,"children":3950},{},[3951,3957,3958,3964,3965],{"type":606,"tag":631,"props":3952,"children":3954},{"className":3953},[],[3955],{"type":611,"value":3956},"uc",{"type":611,"value":1847},{"type":606,"tag":631,"props":3959,"children":3961},{"className":3960},[],[3962],{"type":611,"value":3963},"tp",{"type":611,"value":1847},{"type":606,"tag":631,"props":3966,"children":3968},{"className":3967},[],[3969],{"type":611,"value":3970},"data",{"type":606,"tag":3897,"props":3972,"children":3973},{},[3974,3982,3998],{"type":606,"tag":3924,"props":3975,"children":3976},{},[3977],{"type":606,"tag":1371,"props":3978,"children":3979},{},[3980],{"type":611,"value":3981},"Functions",{"type":606,"tag":3924,"props":3983,"children":3984},{},[3985,3991,3992],{"type":606,"tag":631,"props":3986,"children":3988},{"className":3987},[],[3989],{"type":611,"value":3990},"calculate_tax()",{"type":611,"value":1847},{"type":606,"tag":631,"props":3993,"children":3995},{"className":3994},[],[3996],{"type":611,"value":3997},"send_email()",{"type":606,"tag":3924,"props":3999,"children":4000},{},[4001,4007,4008],{"type":606,"tag":631,"props":4002,"children":4004},{"className":4003},[],[4005],{"type":611,"value":4006},"calc()",{"type":611,"value":1847},{"type":606,"tag":631,"props":4009,"children":4011},{"className":4010},[],[4012],{"type":611,"value":4013},"process()",{"type":606,"tag":3897,"props":4015,"children":4016},{},[4017,4025,4034],{"type":606,"tag":3924,"props":4018,"children":4019},{},[4020],{"type":606,"tag":1371,"props":4021,"children":4022},{},[4023],{"type":611,"value":4024},"Constants",{"type":606,"tag":3924,"props":4026,"children":4027},{},[4028],{"type":606,"tag":631,"props":4029,"children":4031},{"className":4030},[],[4032],{"type":611,"value":4033},"MAX_FILE_SIZE = 1024",{"type":606,"tag":3924,"props":4035,"children":4036},{},[4037],{"type":606,"tag":631,"props":4038,"children":4040},{"className":4039},[],[4041],{"type":611,"value":4042},"limit = 1024",{"type":606,"tag":3897,"props":4044,"children":4045},{},[4046,4054,4070],{"type":606,"tag":3924,"props":4047,"children":4048},{},[4049],{"type":606,"tag":1371,"props":4050,"children":4051},{},[4052],{"type":611,"value":4053},"Booleans",{"type":606,"tag":3924,"props":4055,"children":4056},{},[4057,4063,4064],{"type":606,"tag":631,"props":4058,"children":4060},{"className":4059},[],[4061],{"type":611,"value":4062},"is_valid",{"type":611,"value":1847},{"type":606,"tag":631,"props":4065,"children":4067},{"className":4066},[],[4068],{"type":611,"value":4069},"has_permission",{"type":606,"tag":3924,"props":4071,"children":4072},{},[4073,4079,4080],{"type":606,"tag":631,"props":4074,"children":4076},{"className":4075},[],[4077],{"type":611,"value":4078},"flag",{"type":611,"value":1847},{"type":606,"tag":631,"props":4081,"children":4083},{"className":4082},[],[4084],{"type":611,"value":4085},"check",{"type":606,"tag":3897,"props":4087,"children":4088},{},[4089,4097,4113],{"type":606,"tag":3924,"props":4090,"children":4091},{},[4092],{"type":606,"tag":1371,"props":4093,"children":4094},{},[4095],{"type":611,"value":4096},"Classes",{"type":606,"tag":3924,"props":4098,"children":4099},{},[4100,4106,4107],{"type":606,"tag":631,"props":4101,"children":4103},{"className":4102},[],[4104],{"type":611,"value":4105},"UserAccount",{"type":611,"value":1847},{"type":606,"tag":631,"props":4108,"children":4110},{"className":4109},[],[4111],{"type":611,"value":4112},"EmailService",{"type":606,"tag":3924,"props":4114,"children":4115},{},[4116,4122,4123],{"type":606,"tag":631,"props":4117,"children":4119},{"className":4118},[],[4120],{"type":611,"value":4121},"Manager",{"type":611,"value":1847},{"type":606,"tag":631,"props":4124,"children":4126},{"className":4125},[],[4127],{"type":611,"value":4128},"Handler",{"type":606,"tag":3897,"props":4130,"children":4131},{},[4132,4140,4145],{"type":606,"tag":3924,"props":4133,"children":4134},{},[4135],{"type":606,"tag":1371,"props":4136,"children":4137},{},[4138],{"type":611,"value":4139},"Comments",{"type":606,"tag":3924,"props":4141,"children":4142},{},[4143],{"type":611,"value":4144},"Explain why and business logic",{"type":606,"tag":3924,"props":4146,"children":4147},{},[4148],{"type":611,"value":4149},"Repeat what code does",{"type":606,"tag":1349,"props":4151,"children":4153},{"id":4152},"key-takeaways",[4154],{"type":611,"value":4155},"🎯 Key Takeaways",{"type":606,"tag":1361,"props":4157,"children":4161},{"emoji":4158,"title":4159,"type":4160},"📚","Clean Code Essentials","success",[4162,4170,4193,4201,4223,4231,4254,4262,4284],{"type":606,"tag":614,"props":4163,"children":4164},{},[4165],{"type":606,"tag":1371,"props":4166,"children":4167},{},[4168],{"type":611,"value":4169},"Naming:",{"type":606,"tag":1377,"props":4171,"children":4172},{},[4173,4178,4183,4188],{"type":606,"tag":1381,"props":4174,"children":4175},{},[4176],{"type":611,"value":4177},"Use descriptive, meaningful names",{"type":606,"tag":1381,"props":4179,"children":4180},{},[4181],{"type":611,"value":4182},"Be consistent with naming conventions",{"type":606,"tag":1381,"props":4184,"children":4185},{},[4186],{"type":611,"value":4187},"Avoid abbreviations and single letters",{"type":606,"tag":1381,"props":4189,"children":4190},{},[4191],{"type":611,"value":4192},"Make boolean variables read like questions",{"type":606,"tag":614,"props":4194,"children":4195},{},[4196],{"type":606,"tag":1371,"props":4197,"children":4198},{},[4199],{"type":611,"value":4200},"Functions:",{"type":606,"tag":1377,"props":4202,"children":4203},{},[4204,4209,4214,4218],{"type":606,"tag":1381,"props":4205,"children":4206},{},[4207],{"type":611,"value":4208},"Keep functions small (5-20 lines)",{"type":606,"tag":1381,"props":4210,"children":4211},{},[4212],{"type":611,"value":4213},"Do one thing well",{"type":606,"tag":1381,"props":4215,"children":4216},{},[4217],{"type":611,"value":1421},{"type":606,"tag":1381,"props":4219,"children":4220},{},[4221],{"type":611,"value":4222},"Add clear docstrings",{"type":606,"tag":614,"props":4224,"children":4225},{},[4226],{"type":606,"tag":1371,"props":4227,"children":4228},{},[4229],{"type":611,"value":4230},"Comments:",{"type":606,"tag":1377,"props":4232,"children":4233},{},[4234,4239,4244,4249],{"type":606,"tag":1381,"props":4235,"children":4236},{},[4237],{"type":611,"value":4238},"Explain why, not what",{"type":606,"tag":1381,"props":4240,"children":4241},{},[4242],{"type":611,"value":4243},"Document business logic and complex algorithms",{"type":606,"tag":1381,"props":4245,"children":4246},{},[4247],{"type":611,"value":4248},"Keep comments up-to-date with code changes",{"type":606,"tag":1381,"props":4250,"children":4251},{},[4252],{"type":611,"value":4253},"Use docstrings for function documentation",{"type":606,"tag":614,"props":4255,"children":4256},{},[4257],{"type":606,"tag":1371,"props":4258,"children":4259},{},[4260],{"type":611,"value":4261},"Style:",{"type":606,"tag":1377,"props":4263,"children":4264},{},[4265,4270,4274,4279],{"type":606,"tag":1381,"props":4266,"children":4267},{},[4268],{"type":611,"value":4269},"Use consistent indentation and spacing",{"type":606,"tag":1381,"props":4271,"children":4272},{},[4273],{"type":611,"value":1457},{"type":606,"tag":1381,"props":4275,"children":4276},{},[4277],{"type":611,"value":4278},"Remove dead code and unused imports",{"type":606,"tag":1381,"props":4280,"children":4281},{},[4282],{"type":611,"value":4283},"Follow Python naming conventions (PEP 8)",{"type":606,"tag":614,"props":4285,"children":4286},{},[4287,4292],{"type":606,"tag":1371,"props":4288,"children":4289},{},[4290],{"type":611,"value":4291},"Remember:",{"type":611,"value":4293}," Code is read far more often than it's written!",{"type":606,"tag":1349,"props":4295,"children":4297},{"id":4296},"whats-next",[4298],{"type":611,"value":4299},"🚀 What's Next?",{"type":606,"tag":614,"props":4301,"children":4302},{},[4303],{"type":611,"value":4304},"Learn how to optimize your Python code for better performance and efficiency.",{"type":606,"tag":614,"props":4306,"children":4307},{},[4308,4313,4314],{"type":606,"tag":1371,"props":4309,"children":4310},{},[4311],{"type":611,"value":4312},"Continue to",{"type":611,"value":2944},{"type":606,"tag":4315,"props":4316,"children":4317},"a",{"href":558},[4318],{"type":611,"value":559},{"type":606,"tag":4320,"props":4321,"children":4322},"style",{},[4323],{"type":611,"value":4324},"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":4326},[4327,4331,4332,4333],{"id":1351,"depth":27,"text":1354,"children":4328},[4329,4330],{"id":1466,"depth":36,"text":1469},{"id":2772,"depth":36,"text":2775},{"id":3884,"depth":27,"text":3887},{"id":4152,"depth":27,"text":4155},{"id":4296,"depth":27,"text":4299},1782373764208]