[{"data":1,"prerenderedAt":1940},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/sort-lists":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",[86],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":81,"body":602,"_type":15,"_id":91,"_source":17,"_file":92,"_stem":93,"_extension":20},{"type":603,"children":604,"toc":1933},"root",[605,614,620,766,773,778,885,892,1342,1348,1361,1776,1782,1927],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"sorting-lists",[611],{"type":612,"value":613},"text","🔄 Sorting Lists",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618],{"type":612,"value":619},"Python provides multiple ways to sort lists, from simple ascending order to complex custom sorting. Understanding these methods is essential for data organization and manipulation.",{"type":606,"tag":621,"props":622,"children":623},"code-try",{},[624],{"type":606,"tag":625,"props":626,"children":630},"pre",{"className":627,"code":628,"language":629,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Basic list sorting\nnumbers = [3, 1, 4, 1, 5, 9, 2, 6]\nnumbers.sort()\nprint(numbers)  # [1, 1, 2, 3, 4, 5, 6, 9]\n","python",[631],{"type":606,"tag":632,"props":633,"children":634},"code",{"__ignoreMap":8},[635,646,740,748],{"type":606,"tag":636,"props":637,"children":639},"span",{"class":638,"line":12},"line",[640],{"type":606,"tag":636,"props":641,"children":643},{"style":642},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[644],{"type":612,"value":645},"# Basic list sorting\n",{"type":606,"tag":636,"props":647,"children":648},{"class":638,"line":27},[649,655,661,666,672,677,682,686,691,695,699,703,708,712,717,721,726,730,735],{"type":606,"tag":636,"props":650,"children":652},{"style":651},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[653],{"type":612,"value":654},"numbers ",{"type":606,"tag":636,"props":656,"children":658},{"style":657},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[659],{"type":612,"value":660},"=",{"type":606,"tag":636,"props":662,"children":663},{"style":651},[664],{"type":612,"value":665}," [",{"type":606,"tag":636,"props":667,"children":669},{"style":668},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[670],{"type":612,"value":671},"3",{"type":606,"tag":636,"props":673,"children":674},{"style":651},[675],{"type":612,"value":676},", ",{"type":606,"tag":636,"props":678,"children":679},{"style":668},[680],{"type":612,"value":681},"1",{"type":606,"tag":636,"props":683,"children":684},{"style":651},[685],{"type":612,"value":676},{"type":606,"tag":636,"props":687,"children":688},{"style":668},[689],{"type":612,"value":690},"4",{"type":606,"tag":636,"props":692,"children":693},{"style":651},[694],{"type":612,"value":676},{"type":606,"tag":636,"props":696,"children":697},{"style":668},[698],{"type":612,"value":681},{"type":606,"tag":636,"props":700,"children":701},{"style":651},[702],{"type":612,"value":676},{"type":606,"tag":636,"props":704,"children":705},{"style":668},[706],{"type":612,"value":707},"5",{"type":606,"tag":636,"props":709,"children":710},{"style":651},[711],{"type":612,"value":676},{"type":606,"tag":636,"props":713,"children":714},{"style":668},[715],{"type":612,"value":716},"9",{"type":606,"tag":636,"props":718,"children":719},{"style":651},[720],{"type":612,"value":676},{"type":606,"tag":636,"props":722,"children":723},{"style":668},[724],{"type":612,"value":725},"2",{"type":606,"tag":636,"props":727,"children":728},{"style":651},[729],{"type":612,"value":676},{"type":606,"tag":636,"props":731,"children":732},{"style":668},[733],{"type":612,"value":734},"6",{"type":606,"tag":636,"props":736,"children":737},{"style":651},[738],{"type":612,"value":739},"]\n",{"type":606,"tag":636,"props":741,"children":742},{"class":638,"line":36},[743],{"type":606,"tag":636,"props":744,"children":745},{"style":651},[746],{"type":612,"value":747},"numbers.sort()\n",{"type":606,"tag":636,"props":749,"children":750},{"class":638,"line":45},[751,756,761],{"type":606,"tag":636,"props":752,"children":753},{"style":668},[754],{"type":612,"value":755},"print",{"type":606,"tag":636,"props":757,"children":758},{"style":651},[759],{"type":612,"value":760},"(numbers)  ",{"type":606,"tag":636,"props":762,"children":763},{"style":642},[764],{"type":612,"value":765},"# [1, 1, 2, 3, 4, 5, 6, 9]\n",{"type":606,"tag":767,"props":768,"children":770},"h2",{"id":769},"sorting-methods",[771],{"type":612,"value":772},"🎯 Sorting Methods",{"type":606,"tag":615,"props":774,"children":775},{},[776],{"type":612,"value":777},"Python offers two main approaches to sorting lists.",{"type":606,"tag":779,"props":780,"children":784},"info-box",{"emoji":781,"title":782,"type":783},"📝","Sorting Methods","info",[785,794,821,829,854,862],{"type":606,"tag":615,"props":786,"children":787},{},[788],{"type":606,"tag":789,"props":790,"children":791},"strong",{},[792],{"type":612,"value":793},"In-place Sorting:",{"type":606,"tag":795,"props":796,"children":797},"ul",{},[798,810],{"type":606,"tag":799,"props":800,"children":801},"li",{},[802,808],{"type":606,"tag":632,"props":803,"children":805},{"className":804},[],[806],{"type":612,"value":807},".sort()",{"type":612,"value":809},": Modifies the original list",{"type":606,"tag":799,"props":811,"children":812},{},[813,819],{"type":606,"tag":632,"props":814,"children":816},{"className":815},[],[817],{"type":612,"value":818},".sort(reverse=True)",{"type":612,"value":820},": Sorts in descending order",{"type":606,"tag":615,"props":822,"children":823},{},[824],{"type":606,"tag":789,"props":825,"children":826},{},[827],{"type":612,"value":828},"New List Sorting:",{"type":606,"tag":795,"props":830,"children":831},{},[832,843],{"type":606,"tag":799,"props":833,"children":834},{},[835,841],{"type":606,"tag":632,"props":836,"children":838},{"className":837},[],[839],{"type":612,"value":840},"sorted()",{"type":612,"value":842},": Returns a new sorted list",{"type":606,"tag":799,"props":844,"children":845},{},[846,852],{"type":606,"tag":632,"props":847,"children":849},{"className":848},[],[850],{"type":612,"value":851},"sorted(reverse=True)",{"type":612,"value":853},": Returns new list in descending order",{"type":606,"tag":615,"props":855,"children":856},{},[857],{"type":606,"tag":789,"props":858,"children":859},{},[860],{"type":612,"value":861},"Key Difference:",{"type":606,"tag":795,"props":863,"children":864},{},[865,875],{"type":606,"tag":799,"props":866,"children":867},{},[868,873],{"type":606,"tag":632,"props":869,"children":871},{"className":870},[],[872],{"type":612,"value":807},{"type":612,"value":874}," modifies the original list",{"type":606,"tag":799,"props":876,"children":877},{},[878,883],{"type":606,"tag":632,"props":879,"children":881},{"className":880},[],[882],{"type":612,"value":840},{"type":612,"value":884}," creates a new list",{"type":606,"tag":886,"props":887,"children":889},"h3",{"id":888},"basic-examples",[890],{"type":612,"value":891},"Basic Examples",{"type":606,"tag":621,"props":893,"children":894},{},[895],{"type":606,"tag":625,"props":896,"children":898},{"className":627,"code":897,"language":629,"meta":8,"style":8},"# Different ways to sort lists\nnumbers = [3, 1, 4, 1, 5, 9, 2, 6]\n\n# In-place sorting\nnumbers.sort()\nprint(f\"Sorted in-place: {numbers}\")\n\n# Create new sorted list\noriginal = [3, 1, 4, 1, 5, 9, 2, 6]\nsorted_numbers = sorted(original)\nprint(f\"Original: {original}\")\nprint(f\"New sorted list: {sorted_numbers}\")\n\n# Descending order\nnumbers.sort(reverse=True)\nprint(f\"Descending order: {numbers}\")\n",[899],{"type":606,"tag":632,"props":900,"children":901},{"__ignoreMap":8},[902,910,989,997,1005,1012,1060,1067,1075,1156,1178,1219,1260,1267,1275,1302],{"type":606,"tag":636,"props":903,"children":904},{"class":638,"line":12},[905],{"type":606,"tag":636,"props":906,"children":907},{"style":642},[908],{"type":612,"value":909},"# Different ways to sort lists\n",{"type":606,"tag":636,"props":911,"children":912},{"class":638,"line":27},[913,917,921,925,929,933,937,941,945,949,953,957,961,965,969,973,977,981,985],{"type":606,"tag":636,"props":914,"children":915},{"style":651},[916],{"type":612,"value":654},{"type":606,"tag":636,"props":918,"children":919},{"style":657},[920],{"type":612,"value":660},{"type":606,"tag":636,"props":922,"children":923},{"style":651},[924],{"type":612,"value":665},{"type":606,"tag":636,"props":926,"children":927},{"style":668},[928],{"type":612,"value":671},{"type":606,"tag":636,"props":930,"children":931},{"style":651},[932],{"type":612,"value":676},{"type":606,"tag":636,"props":934,"children":935},{"style":668},[936],{"type":612,"value":681},{"type":606,"tag":636,"props":938,"children":939},{"style":651},[940],{"type":612,"value":676},{"type":606,"tag":636,"props":942,"children":943},{"style":668},[944],{"type":612,"value":690},{"type":606,"tag":636,"props":946,"children":947},{"style":651},[948],{"type":612,"value":676},{"type":606,"tag":636,"props":950,"children":951},{"style":668},[952],{"type":612,"value":681},{"type":606,"tag":636,"props":954,"children":955},{"style":651},[956],{"type":612,"value":676},{"type":606,"tag":636,"props":958,"children":959},{"style":668},[960],{"type":612,"value":707},{"type":606,"tag":636,"props":962,"children":963},{"style":651},[964],{"type":612,"value":676},{"type":606,"tag":636,"props":966,"children":967},{"style":668},[968],{"type":612,"value":716},{"type":606,"tag":636,"props":970,"children":971},{"style":651},[972],{"type":612,"value":676},{"type":606,"tag":636,"props":974,"children":975},{"style":668},[976],{"type":612,"value":725},{"type":606,"tag":636,"props":978,"children":979},{"style":651},[980],{"type":612,"value":676},{"type":606,"tag":636,"props":982,"children":983},{"style":668},[984],{"type":612,"value":734},{"type":606,"tag":636,"props":986,"children":987},{"style":651},[988],{"type":612,"value":739},{"type":606,"tag":636,"props":990,"children":991},{"class":638,"line":36},[992],{"type":606,"tag":636,"props":993,"children":994},{"emptyLinePlaceholder":13},[995],{"type":612,"value":996},"\n",{"type":606,"tag":636,"props":998,"children":999},{"class":638,"line":45},[1000],{"type":606,"tag":636,"props":1001,"children":1002},{"style":642},[1003],{"type":612,"value":1004},"# In-place sorting\n",{"type":606,"tag":636,"props":1006,"children":1007},{"class":638,"line":54},[1008],{"type":606,"tag":636,"props":1009,"children":1010},{"style":651},[1011],{"type":612,"value":747},{"type":606,"tag":636,"props":1013,"children":1014},{"class":638,"line":63},[1015,1019,1024,1029,1035,1040,1045,1050,1055],{"type":606,"tag":636,"props":1016,"children":1017},{"style":668},[1018],{"type":612,"value":755},{"type":606,"tag":636,"props":1020,"children":1021},{"style":651},[1022],{"type":612,"value":1023},"(",{"type":606,"tag":636,"props":1025,"children":1026},{"style":657},[1027],{"type":612,"value":1028},"f",{"type":606,"tag":636,"props":1030,"children":1032},{"style":1031},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[1033],{"type":612,"value":1034},"\"Sorted in-place: ",{"type":606,"tag":636,"props":1036,"children":1037},{"style":668},[1038],{"type":612,"value":1039},"{",{"type":606,"tag":636,"props":1041,"children":1042},{"style":651},[1043],{"type":612,"value":1044},"numbers",{"type":606,"tag":636,"props":1046,"children":1047},{"style":668},[1048],{"type":612,"value":1049},"}",{"type":606,"tag":636,"props":1051,"children":1052},{"style":1031},[1053],{"type":612,"value":1054},"\"",{"type":606,"tag":636,"props":1056,"children":1057},{"style":651},[1058],{"type":612,"value":1059},")\n",{"type":606,"tag":636,"props":1061,"children":1062},{"class":638,"line":72},[1063],{"type":606,"tag":636,"props":1064,"children":1065},{"emptyLinePlaceholder":13},[1066],{"type":612,"value":996},{"type":606,"tag":636,"props":1068,"children":1069},{"class":638,"line":81},[1070],{"type":606,"tag":636,"props":1071,"children":1072},{"style":642},[1073],{"type":612,"value":1074},"# Create new sorted list\n",{"type":606,"tag":636,"props":1076,"children":1078},{"class":638,"line":1077},9,[1079,1084,1088,1092,1096,1100,1104,1108,1112,1116,1120,1124,1128,1132,1136,1140,1144,1148,1152],{"type":606,"tag":636,"props":1080,"children":1081},{"style":651},[1082],{"type":612,"value":1083},"original ",{"type":606,"tag":636,"props":1085,"children":1086},{"style":657},[1087],{"type":612,"value":660},{"type":606,"tag":636,"props":1089,"children":1090},{"style":651},[1091],{"type":612,"value":665},{"type":606,"tag":636,"props":1093,"children":1094},{"style":668},[1095],{"type":612,"value":671},{"type":606,"tag":636,"props":1097,"children":1098},{"style":651},[1099],{"type":612,"value":676},{"type":606,"tag":636,"props":1101,"children":1102},{"style":668},[1103],{"type":612,"value":681},{"type":606,"tag":636,"props":1105,"children":1106},{"style":651},[1107],{"type":612,"value":676},{"type":606,"tag":636,"props":1109,"children":1110},{"style":668},[1111],{"type":612,"value":690},{"type":606,"tag":636,"props":1113,"children":1114},{"style":651},[1115],{"type":612,"value":676},{"type":606,"tag":636,"props":1117,"children":1118},{"style":668},[1119],{"type":612,"value":681},{"type":606,"tag":636,"props":1121,"children":1122},{"style":651},[1123],{"type":612,"value":676},{"type":606,"tag":636,"props":1125,"children":1126},{"style":668},[1127],{"type":612,"value":707},{"type":606,"tag":636,"props":1129,"children":1130},{"style":651},[1131],{"type":612,"value":676},{"type":606,"tag":636,"props":1133,"children":1134},{"style":668},[1135],{"type":612,"value":716},{"type":606,"tag":636,"props":1137,"children":1138},{"style":651},[1139],{"type":612,"value":676},{"type":606,"tag":636,"props":1141,"children":1142},{"style":668},[1143],{"type":612,"value":725},{"type":606,"tag":636,"props":1145,"children":1146},{"style":651},[1147],{"type":612,"value":676},{"type":606,"tag":636,"props":1149,"children":1150},{"style":668},[1151],{"type":612,"value":734},{"type":606,"tag":636,"props":1153,"children":1154},{"style":651},[1155],{"type":612,"value":739},{"type":606,"tag":636,"props":1157,"children":1158},{"class":638,"line":99},[1159,1164,1168,1173],{"type":606,"tag":636,"props":1160,"children":1161},{"style":651},[1162],{"type":612,"value":1163},"sorted_numbers ",{"type":606,"tag":636,"props":1165,"children":1166},{"style":657},[1167],{"type":612,"value":660},{"type":606,"tag":636,"props":1169,"children":1170},{"style":668},[1171],{"type":612,"value":1172}," sorted",{"type":606,"tag":636,"props":1174,"children":1175},{"style":651},[1176],{"type":612,"value":1177},"(original)\n",{"type":606,"tag":636,"props":1179,"children":1180},{"class":638,"line":108},[1181,1185,1189,1193,1198,1202,1207,1211,1215],{"type":606,"tag":636,"props":1182,"children":1183},{"style":668},[1184],{"type":612,"value":755},{"type":606,"tag":636,"props":1186,"children":1187},{"style":651},[1188],{"type":612,"value":1023},{"type":606,"tag":636,"props":1190,"children":1191},{"style":657},[1192],{"type":612,"value":1028},{"type":606,"tag":636,"props":1194,"children":1195},{"style":1031},[1196],{"type":612,"value":1197},"\"Original: ",{"type":606,"tag":636,"props":1199,"children":1200},{"style":668},[1201],{"type":612,"value":1039},{"type":606,"tag":636,"props":1203,"children":1204},{"style":651},[1205],{"type":612,"value":1206},"original",{"type":606,"tag":636,"props":1208,"children":1209},{"style":668},[1210],{"type":612,"value":1049},{"type":606,"tag":636,"props":1212,"children":1213},{"style":1031},[1214],{"type":612,"value":1054},{"type":606,"tag":636,"props":1216,"children":1217},{"style":651},[1218],{"type":612,"value":1059},{"type":606,"tag":636,"props":1220,"children":1221},{"class":638,"line":117},[1222,1226,1230,1234,1239,1243,1248,1252,1256],{"type":606,"tag":636,"props":1223,"children":1224},{"style":668},[1225],{"type":612,"value":755},{"type":606,"tag":636,"props":1227,"children":1228},{"style":651},[1229],{"type":612,"value":1023},{"type":606,"tag":636,"props":1231,"children":1232},{"style":657},[1233],{"type":612,"value":1028},{"type":606,"tag":636,"props":1235,"children":1236},{"style":1031},[1237],{"type":612,"value":1238},"\"New sorted list: ",{"type":606,"tag":636,"props":1240,"children":1241},{"style":668},[1242],{"type":612,"value":1039},{"type":606,"tag":636,"props":1244,"children":1245},{"style":651},[1246],{"type":612,"value":1247},"sorted_numbers",{"type":606,"tag":636,"props":1249,"children":1250},{"style":668},[1251],{"type":612,"value":1049},{"type":606,"tag":636,"props":1253,"children":1254},{"style":1031},[1255],{"type":612,"value":1054},{"type":606,"tag":636,"props":1257,"children":1258},{"style":651},[1259],{"type":612,"value":1059},{"type":606,"tag":636,"props":1261,"children":1262},{"class":638,"line":126},[1263],{"type":606,"tag":636,"props":1264,"children":1265},{"emptyLinePlaceholder":13},[1266],{"type":612,"value":996},{"type":606,"tag":636,"props":1268,"children":1269},{"class":638,"line":135},[1270],{"type":606,"tag":636,"props":1271,"children":1272},{"style":642},[1273],{"type":612,"value":1274},"# Descending order\n",{"type":606,"tag":636,"props":1276,"children":1277},{"class":638,"line":144},[1278,1283,1289,1293,1298],{"type":606,"tag":636,"props":1279,"children":1280},{"style":651},[1281],{"type":612,"value":1282},"numbers.sort(",{"type":606,"tag":636,"props":1284,"children":1286},{"style":1285},"--shiki-default:#E36209;--shiki-app-dark-mode:#FFAB70",[1287],{"type":612,"value":1288},"reverse",{"type":606,"tag":636,"props":1290,"children":1291},{"style":657},[1292],{"type":612,"value":660},{"type":606,"tag":636,"props":1294,"children":1295},{"style":668},[1296],{"type":612,"value":1297},"True",{"type":606,"tag":636,"props":1299,"children":1300},{"style":651},[1301],{"type":612,"value":1059},{"type":606,"tag":636,"props":1303,"children":1304},{"class":638,"line":153},[1305,1309,1313,1317,1322,1326,1330,1334,1338],{"type":606,"tag":636,"props":1306,"children":1307},{"style":668},[1308],{"type":612,"value":755},{"type":606,"tag":636,"props":1310,"children":1311},{"style":651},[1312],{"type":612,"value":1023},{"type":606,"tag":636,"props":1314,"children":1315},{"style":657},[1316],{"type":612,"value":1028},{"type":606,"tag":636,"props":1318,"children":1319},{"style":1031},[1320],{"type":612,"value":1321},"\"Descending order: ",{"type":606,"tag":636,"props":1323,"children":1324},{"style":668},[1325],{"type":612,"value":1039},{"type":606,"tag":636,"props":1327,"children":1328},{"style":651},[1329],{"type":612,"value":1044},{"type":606,"tag":636,"props":1331,"children":1332},{"style":668},[1333],{"type":612,"value":1049},{"type":606,"tag":636,"props":1335,"children":1336},{"style":1031},[1337],{"type":612,"value":1054},{"type":606,"tag":636,"props":1339,"children":1340},{"style":651},[1341],{"type":612,"value":1059},{"type":606,"tag":767,"props":1343,"children":1345},{"id":1344},"custom-sorting",[1346],{"type":612,"value":1347},"🔍 Custom Sorting",{"type":606,"tag":615,"props":1349,"children":1350},{},[1351,1353,1359],{"type":612,"value":1352},"Python allows custom sorting using the ",{"type":606,"tag":632,"props":1354,"children":1356},{"className":1355},[],[1357],{"type":612,"value":1358},"key",{"type":612,"value":1360}," parameter.",{"type":606,"tag":621,"props":1362,"children":1363},{},[1364],{"type":606,"tag":625,"props":1365,"children":1367},{"className":627,"code":1366,"language":629,"meta":8,"style":8},"# Custom sorting examples\n# Sort by length\nwords = [\"cat\", \"mouse\", \"elephant\"]\nwords.sort(key=len)\nprint(f\"Sorted by length: {words}\")\n\n# Sort by second element\npairs = [(1, 5), (2, 3), (3, 8)]\npairs.sort(key=lambda x: x[1])\nprint(f\"Sorted by second element: {pairs}\")\n\n# Case-insensitive sorting\nnames = [\"Alice\", \"bob\", \"Charlie\"]\nnames.sort(key=str.lower)\nprint(f\"Case-insensitive sort: {names}\")\n",[1368],{"type":606,"tag":632,"props":1369,"children":1370},{"__ignoreMap":8},[1371,1379,1387,1430,1455,1496,1503,1511,1579,1610,1651,1658,1666,1709,1735],{"type":606,"tag":636,"props":1372,"children":1373},{"class":638,"line":12},[1374],{"type":606,"tag":636,"props":1375,"children":1376},{"style":642},[1377],{"type":612,"value":1378},"# Custom sorting examples\n",{"type":606,"tag":636,"props":1380,"children":1381},{"class":638,"line":27},[1382],{"type":606,"tag":636,"props":1383,"children":1384},{"style":642},[1385],{"type":612,"value":1386},"# Sort by length\n",{"type":606,"tag":636,"props":1388,"children":1389},{"class":638,"line":36},[1390,1395,1399,1403,1408,1412,1417,1421,1426],{"type":606,"tag":636,"props":1391,"children":1392},{"style":651},[1393],{"type":612,"value":1394},"words ",{"type":606,"tag":636,"props":1396,"children":1397},{"style":657},[1398],{"type":612,"value":660},{"type":606,"tag":636,"props":1400,"children":1401},{"style":651},[1402],{"type":612,"value":665},{"type":606,"tag":636,"props":1404,"children":1405},{"style":1031},[1406],{"type":612,"value":1407},"\"cat\"",{"type":606,"tag":636,"props":1409,"children":1410},{"style":651},[1411],{"type":612,"value":676},{"type":606,"tag":636,"props":1413,"children":1414},{"style":1031},[1415],{"type":612,"value":1416},"\"mouse\"",{"type":606,"tag":636,"props":1418,"children":1419},{"style":651},[1420],{"type":612,"value":676},{"type":606,"tag":636,"props":1422,"children":1423},{"style":1031},[1424],{"type":612,"value":1425},"\"elephant\"",{"type":606,"tag":636,"props":1427,"children":1428},{"style":651},[1429],{"type":612,"value":739},{"type":606,"tag":636,"props":1431,"children":1432},{"class":638,"line":45},[1433,1438,1442,1446,1451],{"type":606,"tag":636,"props":1434,"children":1435},{"style":651},[1436],{"type":612,"value":1437},"words.sort(",{"type":606,"tag":636,"props":1439,"children":1440},{"style":1285},[1441],{"type":612,"value":1358},{"type":606,"tag":636,"props":1443,"children":1444},{"style":657},[1445],{"type":612,"value":660},{"type":606,"tag":636,"props":1447,"children":1448},{"style":668},[1449],{"type":612,"value":1450},"len",{"type":606,"tag":636,"props":1452,"children":1453},{"style":651},[1454],{"type":612,"value":1059},{"type":606,"tag":636,"props":1456,"children":1457},{"class":638,"line":54},[1458,1462,1466,1470,1475,1479,1484,1488,1492],{"type":606,"tag":636,"props":1459,"children":1460},{"style":668},[1461],{"type":612,"value":755},{"type":606,"tag":636,"props":1463,"children":1464},{"style":651},[1465],{"type":612,"value":1023},{"type":606,"tag":636,"props":1467,"children":1468},{"style":657},[1469],{"type":612,"value":1028},{"type":606,"tag":636,"props":1471,"children":1472},{"style":1031},[1473],{"type":612,"value":1474},"\"Sorted by length: ",{"type":606,"tag":636,"props":1476,"children":1477},{"style":668},[1478],{"type":612,"value":1039},{"type":606,"tag":636,"props":1480,"children":1481},{"style":651},[1482],{"type":612,"value":1483},"words",{"type":606,"tag":636,"props":1485,"children":1486},{"style":668},[1487],{"type":612,"value":1049},{"type":606,"tag":636,"props":1489,"children":1490},{"style":1031},[1491],{"type":612,"value":1054},{"type":606,"tag":636,"props":1493,"children":1494},{"style":651},[1495],{"type":612,"value":1059},{"type":606,"tag":636,"props":1497,"children":1498},{"class":638,"line":63},[1499],{"type":606,"tag":636,"props":1500,"children":1501},{"emptyLinePlaceholder":13},[1502],{"type":612,"value":996},{"type":606,"tag":636,"props":1504,"children":1505},{"class":638,"line":72},[1506],{"type":606,"tag":636,"props":1507,"children":1508},{"style":642},[1509],{"type":612,"value":1510},"# Sort by second element\n",{"type":606,"tag":636,"props":1512,"children":1513},{"class":638,"line":81},[1514,1519,1523,1528,1532,1536,1540,1545,1549,1553,1557,1561,1565,1569,1574],{"type":606,"tag":636,"props":1515,"children":1516},{"style":651},[1517],{"type":612,"value":1518},"pairs ",{"type":606,"tag":636,"props":1520,"children":1521},{"style":657},[1522],{"type":612,"value":660},{"type":606,"tag":636,"props":1524,"children":1525},{"style":651},[1526],{"type":612,"value":1527}," [(",{"type":606,"tag":636,"props":1529,"children":1530},{"style":668},[1531],{"type":612,"value":681},{"type":606,"tag":636,"props":1533,"children":1534},{"style":651},[1535],{"type":612,"value":676},{"type":606,"tag":636,"props":1537,"children":1538},{"style":668},[1539],{"type":612,"value":707},{"type":606,"tag":636,"props":1541,"children":1542},{"style":651},[1543],{"type":612,"value":1544},"), (",{"type":606,"tag":636,"props":1546,"children":1547},{"style":668},[1548],{"type":612,"value":725},{"type":606,"tag":636,"props":1550,"children":1551},{"style":651},[1552],{"type":612,"value":676},{"type":606,"tag":636,"props":1554,"children":1555},{"style":668},[1556],{"type":612,"value":671},{"type":606,"tag":636,"props":1558,"children":1559},{"style":651},[1560],{"type":612,"value":1544},{"type":606,"tag":636,"props":1562,"children":1563},{"style":668},[1564],{"type":612,"value":671},{"type":606,"tag":636,"props":1566,"children":1567},{"style":651},[1568],{"type":612,"value":676},{"type":606,"tag":636,"props":1570,"children":1571},{"style":668},[1572],{"type":612,"value":1573},"8",{"type":606,"tag":636,"props":1575,"children":1576},{"style":651},[1577],{"type":612,"value":1578},")]\n",{"type":606,"tag":636,"props":1580,"children":1581},{"class":638,"line":1077},[1582,1587,1591,1596,1601,1605],{"type":606,"tag":636,"props":1583,"children":1584},{"style":651},[1585],{"type":612,"value":1586},"pairs.sort(",{"type":606,"tag":636,"props":1588,"children":1589},{"style":1285},[1590],{"type":612,"value":1358},{"type":606,"tag":636,"props":1592,"children":1593},{"style":657},[1594],{"type":612,"value":1595},"=lambda",{"type":606,"tag":636,"props":1597,"children":1598},{"style":651},[1599],{"type":612,"value":1600}," x: x[",{"type":606,"tag":636,"props":1602,"children":1603},{"style":668},[1604],{"type":612,"value":681},{"type":606,"tag":636,"props":1606,"children":1607},{"style":651},[1608],{"type":612,"value":1609},"])\n",{"type":606,"tag":636,"props":1611,"children":1612},{"class":638,"line":99},[1613,1617,1621,1625,1630,1634,1639,1643,1647],{"type":606,"tag":636,"props":1614,"children":1615},{"style":668},[1616],{"type":612,"value":755},{"type":606,"tag":636,"props":1618,"children":1619},{"style":651},[1620],{"type":612,"value":1023},{"type":606,"tag":636,"props":1622,"children":1623},{"style":657},[1624],{"type":612,"value":1028},{"type":606,"tag":636,"props":1626,"children":1627},{"style":1031},[1628],{"type":612,"value":1629},"\"Sorted by second element: ",{"type":606,"tag":636,"props":1631,"children":1632},{"style":668},[1633],{"type":612,"value":1039},{"type":606,"tag":636,"props":1635,"children":1636},{"style":651},[1637],{"type":612,"value":1638},"pairs",{"type":606,"tag":636,"props":1640,"children":1641},{"style":668},[1642],{"type":612,"value":1049},{"type":606,"tag":636,"props":1644,"children":1645},{"style":1031},[1646],{"type":612,"value":1054},{"type":606,"tag":636,"props":1648,"children":1649},{"style":651},[1650],{"type":612,"value":1059},{"type":606,"tag":636,"props":1652,"children":1653},{"class":638,"line":108},[1654],{"type":606,"tag":636,"props":1655,"children":1656},{"emptyLinePlaceholder":13},[1657],{"type":612,"value":996},{"type":606,"tag":636,"props":1659,"children":1660},{"class":638,"line":117},[1661],{"type":606,"tag":636,"props":1662,"children":1663},{"style":642},[1664],{"type":612,"value":1665},"# Case-insensitive sorting\n",{"type":606,"tag":636,"props":1667,"children":1668},{"class":638,"line":126},[1669,1674,1678,1682,1687,1691,1696,1700,1705],{"type":606,"tag":636,"props":1670,"children":1671},{"style":651},[1672],{"type":612,"value":1673},"names ",{"type":606,"tag":636,"props":1675,"children":1676},{"style":657},[1677],{"type":612,"value":660},{"type":606,"tag":636,"props":1679,"children":1680},{"style":651},[1681],{"type":612,"value":665},{"type":606,"tag":636,"props":1683,"children":1684},{"style":1031},[1685],{"type":612,"value":1686},"\"Alice\"",{"type":606,"tag":636,"props":1688,"children":1689},{"style":651},[1690],{"type":612,"value":676},{"type":606,"tag":636,"props":1692,"children":1693},{"style":1031},[1694],{"type":612,"value":1695},"\"bob\"",{"type":606,"tag":636,"props":1697,"children":1698},{"style":651},[1699],{"type":612,"value":676},{"type":606,"tag":636,"props":1701,"children":1702},{"style":1031},[1703],{"type":612,"value":1704},"\"Charlie\"",{"type":606,"tag":636,"props":1706,"children":1707},{"style":651},[1708],{"type":612,"value":739},{"type":606,"tag":636,"props":1710,"children":1711},{"class":638,"line":135},[1712,1717,1721,1725,1730],{"type":606,"tag":636,"props":1713,"children":1714},{"style":651},[1715],{"type":612,"value":1716},"names.sort(",{"type":606,"tag":636,"props":1718,"children":1719},{"style":1285},[1720],{"type":612,"value":1358},{"type":606,"tag":636,"props":1722,"children":1723},{"style":657},[1724],{"type":612,"value":660},{"type":606,"tag":636,"props":1726,"children":1727},{"style":668},[1728],{"type":612,"value":1729},"str",{"type":606,"tag":636,"props":1731,"children":1732},{"style":651},[1733],{"type":612,"value":1734},".lower)\n",{"type":606,"tag":636,"props":1736,"children":1737},{"class":638,"line":144},[1738,1742,1746,1750,1755,1759,1764,1768,1772],{"type":606,"tag":636,"props":1739,"children":1740},{"style":668},[1741],{"type":612,"value":755},{"type":606,"tag":636,"props":1743,"children":1744},{"style":651},[1745],{"type":612,"value":1023},{"type":606,"tag":636,"props":1747,"children":1748},{"style":657},[1749],{"type":612,"value":1028},{"type":606,"tag":636,"props":1751,"children":1752},{"style":1031},[1753],{"type":612,"value":1754},"\"Case-insensitive sort: ",{"type":606,"tag":636,"props":1756,"children":1757},{"style":668},[1758],{"type":612,"value":1039},{"type":606,"tag":636,"props":1760,"children":1761},{"style":651},[1762],{"type":612,"value":1763},"names",{"type":606,"tag":636,"props":1765,"children":1766},{"style":668},[1767],{"type":612,"value":1049},{"type":606,"tag":636,"props":1769,"children":1770},{"style":1031},[1771],{"type":612,"value":1054},{"type":606,"tag":636,"props":1773,"children":1774},{"style":651},[1775],{"type":612,"value":1059},{"type":606,"tag":767,"props":1777,"children":1779},{"id":1778},"key-takeaways",[1780],{"type":612,"value":1781},"🎯 Key Takeaways",{"type":606,"tag":779,"props":1783,"children":1787},{"emoji":1784,"title":1785,"type":1786},"📚","List Sorting Essentials","success",[1788,1796,1830,1838,1867,1875,1917],{"type":606,"tag":615,"props":1789,"children":1790},{},[1791],{"type":606,"tag":789,"props":1792,"children":1793},{},[1794],{"type":612,"value":1795},"Basic Methods:",{"type":606,"tag":795,"props":1797,"children":1798},{},[1799,1809,1819],{"type":606,"tag":799,"props":1800,"children":1801},{},[1802,1807],{"type":606,"tag":632,"props":1803,"children":1805},{"className":1804},[],[1806],{"type":612,"value":807},{"type":612,"value":1808}," for in-place sorting",{"type":606,"tag":799,"props":1810,"children":1811},{},[1812,1817],{"type":606,"tag":632,"props":1813,"children":1815},{"className":1814},[],[1816],{"type":612,"value":840},{"type":612,"value":1818}," for new sorted list",{"type":606,"tag":799,"props":1820,"children":1821},{},[1822,1828],{"type":606,"tag":632,"props":1823,"children":1825},{"className":1824},[],[1826],{"type":612,"value":1827},"reverse=True",{"type":612,"value":1829}," for descending order",{"type":606,"tag":615,"props":1831,"children":1832},{},[1833],{"type":606,"tag":789,"props":1834,"children":1835},{},[1836],{"type":612,"value":1837},"Custom Sorting:",{"type":606,"tag":795,"props":1839,"children":1840},{},[1841,1851,1862],{"type":606,"tag":799,"props":1842,"children":1843},{},[1844,1849],{"type":606,"tag":632,"props":1845,"children":1847},{"className":1846},[],[1848],{"type":612,"value":1358},{"type":612,"value":1850}," parameter for custom criteria",{"type":606,"tag":799,"props":1852,"children":1853},{},[1854,1860],{"type":606,"tag":632,"props":1855,"children":1857},{"className":1856},[],[1858],{"type":612,"value":1859},"lambda",{"type":612,"value":1861}," functions for simple keys",{"type":606,"tag":799,"props":1863,"children":1864},{},[1865],{"type":612,"value":1866},"Multiple keys with tuples",{"type":606,"tag":615,"props":1868,"children":1869},{},[1870],{"type":606,"tag":789,"props":1871,"children":1872},{},[1873],{"type":612,"value":1874},"Best Practices:",{"type":606,"tag":795,"props":1876,"children":1877},{},[1878,1890,1901,1906],{"type":606,"tag":799,"props":1879,"children":1880},{},[1881,1883,1888],{"type":612,"value":1882},"Use ",{"type":606,"tag":632,"props":1884,"children":1886},{"className":1885},[],[1887],{"type":612,"value":840},{"type":612,"value":1889}," when you need the original list",{"type":606,"tag":799,"props":1891,"children":1892},{},[1893,1894,1899],{"type":612,"value":1882},{"type":606,"tag":632,"props":1895,"children":1897},{"className":1896},[],[1898],{"type":612,"value":807},{"type":612,"value":1900}," for memory efficiency",{"type":606,"tag":799,"props":1902,"children":1903},{},[1904],{"type":612,"value":1905},"Consider stability for complex sorts",{"type":606,"tag":799,"props":1907,"children":1908},{},[1909,1910,1915],{"type":612,"value":1882},{"type":606,"tag":632,"props":1911,"children":1913},{"className":1912},[],[1914],{"type":612,"value":1358},{"type":612,"value":1916}," for non-standard sorting",{"type":606,"tag":615,"props":1918,"children":1919},{},[1920,1925],{"type":606,"tag":789,"props":1921,"children":1922},{},[1923],{"type":612,"value":1924},"Remember:",{"type":612,"value":1926}," Python's sort is stable - equal elements maintain their relative order!",{"type":606,"tag":1928,"props":1929,"children":1930},"style",{},[1931],{"type":612,"value":1932},"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":1934},[1935,1938,1939],{"id":769,"depth":27,"text":772,"children":1936},[1937],{"id":888,"depth":36,"text":891},{"id":1344,"depth":27,"text":1347},{"id":1778,"depth":27,"text":1781},1782373765730]