[{"data":1,"prerenderedAt":2310},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/remove-whitespace":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},"/python-how-to/date-and-time","Date and Time","Master Python's date and time handling with datetime, time zones, formatting, and calculations","date-and-time","/python-how-to",31,"pi pi-calendar","content:python-how-to:31.date-and-time.md","python-how-to/31.date-and-time.md","python-how-to/31.date-and-time",[297,306,315,324,333,342],{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":286,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python-how-to/get-current-datetime","Get Current Date/Time","Learn how to get current date, time, and timestamps using Python's datetime module","get-current-datetime",32,"content:python-how-to:32.get-current-datetime.md","python-how-to/32.get-current-datetime.md","python-how-to/32.get-current-datetime",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":286,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python-how-to/format-dates","Format Dates","Master date formatting with strftime, custom formats, and locale-aware formatting for user-friendly displays","format-dates",33,"content:python-how-to:33.format-dates.md","python-how-to/33.format-dates.md","python-how-to/33.format-dates",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python-how-to/calculate-date-differences","Calculate Date Differences","Learn to calculate time differences, durations, and intervals using Python's timedelta for scheduling and analytics","calculate-date-differences",34,"content:python-how-to:34.calculate-date-differences.md","python-how-to/34.calculate-date-differences.md","python-how-to/34.calculate-date-differences",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python-how-to/parse-date-strings","Parse Date Strings","Convert text dates into Python datetime objects using strptime, handle multiple formats, and validate date input","parse-date-strings",35,"content:python-how-to:35.parse-date-strings.md","python-how-to/35.parse-date-strings.md","python-how-to/35.parse-date-strings",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":286,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python-how-to/handle-timezones","Handle Timezones","Master timezone handling with zoneinfo, UTC conversions, and timezone-aware datetime objects for global applications","handle-timezones",36,"content:python-how-to:36.handle-timezones.md","python-how-to/36.handle-timezones.md","python-how-to/36.handle-timezones",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python-how-to/work-with-timestamps","Work with Timestamps","Master Unix timestamps in Python - convert between datetime objects and timestamps for APIs, databases, and system integration","work-with-timestamps",37,"content:python-how-to:37.work-with-timestamps.md","python-how-to/37.work-with-timestamps.md","python-how-to/37.work-with-timestamps",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":290,"order":356,"isParent":13,"icon":357,"_type":15,"_id":358,"_source":17,"_file":359,"_stem":360,"_extension":20,"children":361},"/python-how-to/error-handling","Error Handling","Learn Python's error handling with try/except, custom exceptions, debugging, logging, and retry logic for robust applications","error-handling",38,"pi pi-exclamation-triangle","content:python-how-to:38.error-handling.md","python-how-to/38.error-handling.md","python-how-to/38.error-handling",[362,371,380,389,398],{"_path":363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":364,"description":365,"slug":366,"parentId":352,"order":367,"_type":15,"_id":368,"_source":17,"_file":369,"_stem":370,"_extension":20},"/python-how-to/handle-exceptions","Handle Exceptions","Master try/except blocks, multiple exception handling, and finally clauses for robust error handling in Python","handle-exceptions",39,"content:python-how-to:39.handle-exceptions.md","python-how-to/39.handle-exceptions.md","python-how-to/39.handle-exceptions",{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},"/python-how-to/create-custom-exceptions","Create Custom Exceptions","Learn to create custom exception classes in Python for specific error handling and better code organization","create-custom-exceptions",40,"content:python-how-to:40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions",{"_path":381,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":382,"description":383,"slug":384,"parentId":352,"order":385,"_type":15,"_id":386,"_source":17,"_file":387,"_stem":388,"_extension":20},"/python-how-to/debug-code","Debug Code","Learn Python debugging techniques using print statements, the debugger, and tools to find and fix code issues","debug-code",41,"content:python-how-to:41.debug-code.md","python-how-to/41.debug-code.md","python-how-to/41.debug-code",{"_path":390,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":391,"description":392,"slug":393,"parentId":352,"order":394,"_type":15,"_id":395,"_source":17,"_file":396,"_stem":397,"_extension":20},"/python-how-to/use-logging","Use Logging","Learn Python's logging module for tracking application behavior, errors, and debugging information","use-logging",42,"content:python-how-to:42.use-logging.md","python-how-to/42.use-logging.md","python-how-to/42.use-logging",{"_path":399,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":400,"description":401,"slug":402,"parentId":352,"order":403,"_type":15,"_id":404,"_source":17,"_file":405,"_stem":406,"_extension":20},"/python-how-to/implement-retry-logic","Implement Retry Logic","Learn to implement retry mechanisms in Python for handling temporary failures and building resilient applications","implement-retry-logic",43,"content:python-how-to:43.implement-retry-logic.md","python-how-to/43.implement-retry-logic.md","python-how-to/43.implement-retry-logic",{"_path":408,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":409,"description":410,"slug":411,"parentId":290,"order":412,"isParent":13,"icon":413,"_type":15,"_id":414,"_source":17,"_file":415,"_stem":416,"_extension":20,"children":417},"/python-how-to/functions-and-modules","Functions and Modules","Learn Python functions, modules, and code organization for building reusable, maintainable applications","functions-and-modules",44,"pi pi-box","content:python-how-to:44.functions-and-modules.md","python-how-to/44.functions-and-modules.md","python-how-to/44.functions-and-modules",[418,427,436,445,454,463],{"_path":419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":420,"description":421,"slug":422,"parentId":408,"order":423,"_type":15,"_id":424,"_source":17,"_file":425,"_stem":426,"_extension":20},"/python-how-to/write-functions","Write Functions","Learn to create Python functions with parameters, return values, and documentation for reusable code","write-functions",45,"content:python-how-to:45.write-functions.md","python-how-to/45.write-functions.md","python-how-to/45.write-functions",{"_path":428,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":429,"description":430,"slug":431,"parentId":408,"order":432,"_type":15,"_id":433,"_source":17,"_file":434,"_stem":435,"_extension":20},"/python-how-to/use-args-kwargs","Use *args and **kwargs","Learn to use *args and **kwargs for flexible function arguments in Python","use-args-kwargs",46,"content:python-how-to:46.use-args-kwargs.md","python-how-to/46.use-args-kwargs.md","python-how-to/46.use-args-kwargs",{"_path":437,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":438,"description":439,"slug":440,"parentId":408,"order":441,"_type":15,"_id":442,"_source":17,"_file":443,"_stem":444,"_extension":20},"/python-how-to/create-decorators","Create Decorators","Learn to create and use Python decorators to enhance function behavior and add functionality","create-decorators",47,"content:python-how-to:47.create-decorators.md","python-how-to/47.create-decorators.md","python-how-to/47.create-decorators",{"_path":446,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":447,"description":448,"slug":449,"parentId":408,"order":450,"_type":15,"_id":451,"_source":17,"_file":452,"_stem":453,"_extension":20},"/python-how-to/use-generators","Use Generators","Learn to create memory-efficient generators with yield for processing large datasets and sequences","use-generators",48,"content:python-how-to:48.use-generators.md","python-how-to/48.use-generators.md","python-how-to/48.use-generators",{"_path":455,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":456,"description":457,"slug":458,"parentId":408,"order":459,"_type":15,"_id":460,"_source":17,"_file":461,"_stem":462,"_extension":20},"/python-how-to/work-modules-packages","Work with Modules and Packages","Learn to organize Python code with modules and packages, and use imports effectively","work-modules-packages",49,"content:python-how-to:49.work-modules-packages.md","python-how-to/49.work-modules-packages.md","python-how-to/49.work-modules-packages",{"_path":464,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":465,"description":466,"slug":467,"parentId":408,"order":468,"_type":15,"_id":469,"_source":17,"_file":470,"_stem":471,"_extension":20},"/python-how-to/create-virtual-environments","Create Virtual Environments","Learn to create and manage Python virtual environments for project dependency isolation","create-virtual-environments",50,"content:python-how-to:50.create-virtual-environments.md","python-how-to/50.create-virtual-environments.md","python-how-to/50.create-virtual-environments",{"_path":473,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":474,"description":475,"slug":476,"parentId":290,"order":477,"isParent":13,"icon":478,"_type":15,"_id":479,"_source":17,"_file":480,"_stem":481,"_extension":20,"children":482},"/python-how-to/data-processing","Data Processing","Learn Python data processing techniques including regex, APIs, databases, and large file handling","data-processing",51,"pi pi-database","content:python-how-to:51.data-processing.md","python-how-to/51.data-processing.md","python-how-to/51.data-processing",[483,492,501,510,519],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},"/python-how-to/work-regular-expressions","Work with Regular Expressions","Learn to use Python's re module for pattern matching, text extraction, and data validation","work-regular-expressions",52,"content:python-how-to:52.work-regular-expressions.md","python-how-to/52.work-regular-expressions.md","python-how-to/52.work-regular-expressions",{"_path":493,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":494,"description":495,"slug":496,"parentId":473,"order":497,"_type":15,"_id":498,"_source":17,"_file":499,"_stem":500,"_extension":20},"/python-how-to/parse-xml-html","Parse XML and HTML","Learn to extract data from XML and HTML documents using Python's built-in parsing tools","parse-xml-html",53,"content:python-how-to:53.parse-xml-html.md","python-how-to/53.parse-xml-html.md","python-how-to/53.parse-xml-html",{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},"/python-how-to/handle-api-requests","Handle API Requests","Learn to fetch and process data from web APIs using Python's urllib and external requests library","handle-api-requests",54,"content:python-how-to:54.handle-api-requests.md","python-how-to/54.handle-api-requests.md","python-how-to/54.handle-api-requests",{"_path":511,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":512,"description":513,"slug":514,"parentId":473,"order":515,"_type":15,"_id":516,"_source":17,"_file":517,"_stem":518,"_extension":20},"/python-how-to/work-databases","Work with Databases","Learn to connect to and query SQL databases using Python's sqlite3 and database techniques","work-databases",55,"content:python-how-to:55.work-databases.md","python-how-to/55.work-databases.md","python-how-to/55.work-databases",{"_path":520,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":521,"description":522,"slug":523,"parentId":473,"order":524,"_type":15,"_id":525,"_source":17,"_file":526,"_stem":527,"_extension":20},"/python-how-to/process-large-files","Process Large Files","Learn memory-efficient techniques for handling large files and datasets in Python","process-large-files",56,"content:python-how-to:56.process-large-files.md","python-how-to/56.process-large-files.md","python-how-to/56.process-large-files",{"_path":529,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":530,"description":531,"slug":532,"parentId":290,"order":533,"isParent":13,"icon":534,"_type":15,"_id":535,"_source":17,"_file":536,"_stem":537,"_extension":20,"children":538},"/python-how-to/best-practices","Best Practices","Learn Python best practices for writing clean, maintainable, and efficient code","best-practices",57,"pi pi-star","content:python-how-to:57.best-practices.md","python-how-to/57.best-practices.md","python-how-to/57.best-practices",[539,548,557,566,575,584],{"_path":540,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":541,"description":542,"slug":543,"parentId":529,"order":544,"_type":15,"_id":545,"_source":17,"_file":546,"_stem":547,"_extension":20},"/python-how-to/structure-code","Structure Your Code","Learn to organize Python code with proper module structure, functions, and classes","structure-code",58,"content:python-how-to:58.structure-code.md","python-how-to/58.structure-code.md","python-how-to/58.structure-code",{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},"/python-how-to/write-clean-code","Write Clean Code","Learn to write readable, maintainable Python code with proper naming, comments, and clear logic","write-clean-code",59,"content:python-how-to:59.write-clean-code.md","python-how-to/59.write-clean-code.md","python-how-to/59.write-clean-code",{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},"/python-how-to/optimize-performance","Optimize Performance","Learn to identify and fix performance bottlenecks in Python code for faster execution","optimize-performance",60,"content:python-how-to:60.optimize-performance.md","python-how-to/60.optimize-performance.md","python-how-to/60.optimize-performance",{"_path":567,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":568,"description":569,"slug":570,"parentId":529,"order":571,"_type":15,"_id":572,"_source":17,"_file":573,"_stem":574,"_extension":20},"/python-how-to/write-unit-tests","Write Unit Tests","Learn to create reliable unit tests to verify your Python code works correctly and catch bugs early","write-unit-tests",61,"content:python-how-to:61.write-unit-tests.md","python-how-to/61.write-unit-tests.md","python-how-to/61.write-unit-tests",{"_path":576,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":577,"description":578,"slug":579,"parentId":529,"order":580,"_type":15,"_id":581,"_source":17,"_file":582,"_stem":583,"_extension":20},"/python-how-to/document-code","Document Your Code","Learn to write clear documentation and helpful comments for your Python code","document-code",62,"content:python-how-to:62.document-code.md","python-how-to/62.document-code.md","python-how-to/62.document-code",{"_path":585,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":586,"description":587,"slug":588,"parentId":529,"order":589,"_type":15,"_id":590,"_source":17,"_file":591,"_stem":592,"_extension":20},"/python-how-to/use-type-hints","Use Type Hints","Learn to add type annotations to Python code for better clarity, tooling support, and error detection","use-type-hints",63,"content:python-how-to:63.use-type-hints.md","python-how-to/63.use-type-hints.md","python-how-to/63.use-type-hints",{"_path":290,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":594,"description":595,"slug":6,"order":596,"icon":14,"_type":15,"_id":597,"_source":17,"_file":598,"_stem":599,"_extension":20},"Python How-To Guide","Practical Python tutorials for common programming tasks. Learn step-by-step solutions for string manipulation, file operations, data processing, and more with real-world examples.",0,"content:python-how-to:index.md","python-how-to/index.md","python-how-to/index",[31],{"_path":32,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"body":602,"_type":15,"_id":37,"_source":17,"_file":38,"_stem":39,"_extension":20},{"type":603,"children":604,"toc":2299},"root",[605,614,620,773,780,785,894,901,1155,1161,1166,1436,1442,1447,1755,1761,1766,1941,1947,2199,2205,2293],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"removing-whitespace",[611],{"type":612,"value":613},"text","🧹 Removing Whitespace",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618],{"type":612,"value":619},"Whitespace characters (spaces, tabs, newlines) often need to be cleaned up in strings. Python provides several methods to handle this common task efficiently.",{"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 whitespace removal\ntext = \"  Hello World  \"\ncleaned = text.strip()\nprint(f\"Original: '{text}'\")\nprint(f\"Cleaned: '{cleaned}'\")\n","python",[631],{"type":606,"tag":632,"props":633,"children":634},"code",{"__ignoreMap":8},[635,646,667,684,732],{"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 whitespace removal\n",{"type":606,"tag":636,"props":647,"children":648},{"class":638,"line":27},[649,655,661],{"type":606,"tag":636,"props":650,"children":652},{"style":651},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[653],{"type":612,"value":654},"text ",{"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":664},{"style":663},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[665],{"type":612,"value":666}," \"  Hello World  \"\n",{"type":606,"tag":636,"props":668,"children":669},{"class":638,"line":36},[670,675,679],{"type":606,"tag":636,"props":671,"children":672},{"style":651},[673],{"type":612,"value":674},"cleaned ",{"type":606,"tag":636,"props":676,"children":677},{"style":657},[678],{"type":612,"value":660},{"type":606,"tag":636,"props":680,"children":681},{"style":651},[682],{"type":612,"value":683}," text.strip()\n",{"type":606,"tag":636,"props":685,"children":686},{"class":638,"line":45},[687,693,698,703,708,713,717,722,727],{"type":606,"tag":636,"props":688,"children":690},{"style":689},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[691],{"type":612,"value":692},"print",{"type":606,"tag":636,"props":694,"children":695},{"style":651},[696],{"type":612,"value":697},"(",{"type":606,"tag":636,"props":699,"children":700},{"style":657},[701],{"type":612,"value":702},"f",{"type":606,"tag":636,"props":704,"children":705},{"style":663},[706],{"type":612,"value":707},"\"Original: '",{"type":606,"tag":636,"props":709,"children":710},{"style":689},[711],{"type":612,"value":712},"{",{"type":606,"tag":636,"props":714,"children":715},{"style":651},[716],{"type":612,"value":612},{"type":606,"tag":636,"props":718,"children":719},{"style":689},[720],{"type":612,"value":721},"}",{"type":606,"tag":636,"props":723,"children":724},{"style":663},[725],{"type":612,"value":726},"'\"",{"type":606,"tag":636,"props":728,"children":729},{"style":651},[730],{"type":612,"value":731},")\n",{"type":606,"tag":636,"props":733,"children":734},{"class":638,"line":54},[735,739,743,747,752,756,761,765,769],{"type":606,"tag":636,"props":736,"children":737},{"style":689},[738],{"type":612,"value":692},{"type":606,"tag":636,"props":740,"children":741},{"style":651},[742],{"type":612,"value":697},{"type":606,"tag":636,"props":744,"children":745},{"style":657},[746],{"type":612,"value":702},{"type":606,"tag":636,"props":748,"children":749},{"style":663},[750],{"type":612,"value":751},"\"Cleaned: '",{"type":606,"tag":636,"props":753,"children":754},{"style":689},[755],{"type":612,"value":712},{"type":606,"tag":636,"props":757,"children":758},{"style":651},[759],{"type":612,"value":760},"cleaned",{"type":606,"tag":636,"props":762,"children":763},{"style":689},[764],{"type":612,"value":721},{"type":606,"tag":636,"props":766,"children":767},{"style":663},[768],{"type":612,"value":726},{"type":606,"tag":636,"props":770,"children":771},{"style":651},[772],{"type":612,"value":731},{"type":606,"tag":774,"props":775,"children":777},"h2",{"id":776},"whitespace-removal-methods",[778],{"type":612,"value":779},"🎯 Whitespace Removal Methods",{"type":606,"tag":615,"props":781,"children":782},{},[783],{"type":612,"value":784},"Python offers three main methods for whitespace removal, each with a specific purpose.",{"type":606,"tag":786,"props":787,"children":791},"info-box",{"emoji":788,"title":789,"type":790},"📝","Whitespace Methods","info",[792,801,839,847],{"type":606,"tag":615,"props":793,"children":794},{},[795],{"type":606,"tag":796,"props":797,"children":798},"strong",{},[799],{"type":612,"value":800},"Main Methods:",{"type":606,"tag":802,"props":803,"children":804},"ul",{},[805,817,828],{"type":606,"tag":806,"props":807,"children":808},"li",{},[809,815],{"type":606,"tag":632,"props":810,"children":812},{"className":811},[],[813],{"type":612,"value":814},".strip()",{"type":612,"value":816},": Remove from both ends",{"type":606,"tag":806,"props":818,"children":819},{},[820,826],{"type":606,"tag":632,"props":821,"children":823},{"className":822},[],[824],{"type":612,"value":825},".lstrip()",{"type":612,"value":827},": Remove from left side",{"type":606,"tag":806,"props":829,"children":830},{},[831,837],{"type":606,"tag":632,"props":832,"children":834},{"className":833},[],[835],{"type":612,"value":836},".rstrip()",{"type":612,"value":838},": Remove from right side",{"type":606,"tag":615,"props":840,"children":841},{},[842],{"type":606,"tag":796,"props":843,"children":844},{},[845],{"type":612,"value":846},"Whitespace Characters:",{"type":606,"tag":802,"props":848,"children":849},{},[850,861,872,883],{"type":606,"tag":806,"props":851,"children":852},{},[853,855],{"type":612,"value":854},"Space: ",{"type":606,"tag":632,"props":856,"children":858},{"className":857},[],[859],{"type":612,"value":860},"\" \"",{"type":606,"tag":806,"props":862,"children":863},{},[864,866],{"type":612,"value":865},"Tab: ",{"type":606,"tag":632,"props":867,"children":869},{"className":868},[],[870],{"type":612,"value":871},"\\t",{"type":606,"tag":806,"props":873,"children":874},{},[875,877],{"type":612,"value":876},"Newline: ",{"type":606,"tag":632,"props":878,"children":880},{"className":879},[],[881],{"type":612,"value":882},"\\n",{"type":606,"tag":806,"props":884,"children":885},{},[886,888],{"type":612,"value":887},"Carriage return: ",{"type":606,"tag":632,"props":889,"children":891},{"className":890},[],[892],{"type":612,"value":893},"\\r",{"type":606,"tag":895,"props":896,"children":898},"h3",{"id":897},"basic-examples",[899],{"type":612,"value":900},"Basic Examples",{"type":606,"tag":621,"props":902,"children":903},{},[904],{"type":606,"tag":625,"props":905,"children":907},{"className":627,"code":906,"language":629,"meta":8,"style":8},"# Different ways to remove whitespace\ntext = \"  Python is fun  \"\n\n# Remove from both sides\nboth_cleaned = text.strip()\nprint(f\"Both sides: '{both_cleaned}'\")\n\n# Remove from left only\nleft_cleaned = text.lstrip()\nprint(f\"Left side: '{left_cleaned}'\")\n\n# Remove from right only\nright_cleaned = text.rstrip()\nprint(f\"Right side: '{right_cleaned}'\")\n",[908],{"type":606,"tag":632,"props":909,"children":910},{"__ignoreMap":8},[911,919,935,943,951,967,1008,1015,1023,1041,1082,1089,1097,1114],{"type":606,"tag":636,"props":912,"children":913},{"class":638,"line":12},[914],{"type":606,"tag":636,"props":915,"children":916},{"style":642},[917],{"type":612,"value":918},"# Different ways to remove whitespace\n",{"type":606,"tag":636,"props":920,"children":921},{"class":638,"line":27},[922,926,930],{"type":606,"tag":636,"props":923,"children":924},{"style":651},[925],{"type":612,"value":654},{"type":606,"tag":636,"props":927,"children":928},{"style":657},[929],{"type":612,"value":660},{"type":606,"tag":636,"props":931,"children":932},{"style":663},[933],{"type":612,"value":934}," \"  Python is fun  \"\n",{"type":606,"tag":636,"props":936,"children":937},{"class":638,"line":36},[938],{"type":606,"tag":636,"props":939,"children":940},{"emptyLinePlaceholder":13},[941],{"type":612,"value":942},"\n",{"type":606,"tag":636,"props":944,"children":945},{"class":638,"line":45},[946],{"type":606,"tag":636,"props":947,"children":948},{"style":642},[949],{"type":612,"value":950},"# Remove from both sides\n",{"type":606,"tag":636,"props":952,"children":953},{"class":638,"line":54},[954,959,963],{"type":606,"tag":636,"props":955,"children":956},{"style":651},[957],{"type":612,"value":958},"both_cleaned ",{"type":606,"tag":636,"props":960,"children":961},{"style":657},[962],{"type":612,"value":660},{"type":606,"tag":636,"props":964,"children":965},{"style":651},[966],{"type":612,"value":683},{"type":606,"tag":636,"props":968,"children":969},{"class":638,"line":63},[970,974,978,982,987,991,996,1000,1004],{"type":606,"tag":636,"props":971,"children":972},{"style":689},[973],{"type":612,"value":692},{"type":606,"tag":636,"props":975,"children":976},{"style":651},[977],{"type":612,"value":697},{"type":606,"tag":636,"props":979,"children":980},{"style":657},[981],{"type":612,"value":702},{"type":606,"tag":636,"props":983,"children":984},{"style":663},[985],{"type":612,"value":986},"\"Both sides: '",{"type":606,"tag":636,"props":988,"children":989},{"style":689},[990],{"type":612,"value":712},{"type":606,"tag":636,"props":992,"children":993},{"style":651},[994],{"type":612,"value":995},"both_cleaned",{"type":606,"tag":636,"props":997,"children":998},{"style":689},[999],{"type":612,"value":721},{"type":606,"tag":636,"props":1001,"children":1002},{"style":663},[1003],{"type":612,"value":726},{"type":606,"tag":636,"props":1005,"children":1006},{"style":651},[1007],{"type":612,"value":731},{"type":606,"tag":636,"props":1009,"children":1010},{"class":638,"line":72},[1011],{"type":606,"tag":636,"props":1012,"children":1013},{"emptyLinePlaceholder":13},[1014],{"type":612,"value":942},{"type":606,"tag":636,"props":1016,"children":1017},{"class":638,"line":81},[1018],{"type":606,"tag":636,"props":1019,"children":1020},{"style":642},[1021],{"type":612,"value":1022},"# Remove from left only\n",{"type":606,"tag":636,"props":1024,"children":1026},{"class":638,"line":1025},9,[1027,1032,1036],{"type":606,"tag":636,"props":1028,"children":1029},{"style":651},[1030],{"type":612,"value":1031},"left_cleaned ",{"type":606,"tag":636,"props":1033,"children":1034},{"style":657},[1035],{"type":612,"value":660},{"type":606,"tag":636,"props":1037,"children":1038},{"style":651},[1039],{"type":612,"value":1040}," text.lstrip()\n",{"type":606,"tag":636,"props":1042,"children":1043},{"class":638,"line":99},[1044,1048,1052,1056,1061,1065,1070,1074,1078],{"type":606,"tag":636,"props":1045,"children":1046},{"style":689},[1047],{"type":612,"value":692},{"type":606,"tag":636,"props":1049,"children":1050},{"style":651},[1051],{"type":612,"value":697},{"type":606,"tag":636,"props":1053,"children":1054},{"style":657},[1055],{"type":612,"value":702},{"type":606,"tag":636,"props":1057,"children":1058},{"style":663},[1059],{"type":612,"value":1060},"\"Left side: '",{"type":606,"tag":636,"props":1062,"children":1063},{"style":689},[1064],{"type":612,"value":712},{"type":606,"tag":636,"props":1066,"children":1067},{"style":651},[1068],{"type":612,"value":1069},"left_cleaned",{"type":606,"tag":636,"props":1071,"children":1072},{"style":689},[1073],{"type":612,"value":721},{"type":606,"tag":636,"props":1075,"children":1076},{"style":663},[1077],{"type":612,"value":726},{"type":606,"tag":636,"props":1079,"children":1080},{"style":651},[1081],{"type":612,"value":731},{"type":606,"tag":636,"props":1083,"children":1084},{"class":638,"line":108},[1085],{"type":606,"tag":636,"props":1086,"children":1087},{"emptyLinePlaceholder":13},[1088],{"type":612,"value":942},{"type":606,"tag":636,"props":1090,"children":1091},{"class":638,"line":117},[1092],{"type":606,"tag":636,"props":1093,"children":1094},{"style":642},[1095],{"type":612,"value":1096},"# Remove from right only\n",{"type":606,"tag":636,"props":1098,"children":1099},{"class":638,"line":126},[1100,1105,1109],{"type":606,"tag":636,"props":1101,"children":1102},{"style":651},[1103],{"type":612,"value":1104},"right_cleaned ",{"type":606,"tag":636,"props":1106,"children":1107},{"style":657},[1108],{"type":612,"value":660},{"type":606,"tag":636,"props":1110,"children":1111},{"style":651},[1112],{"type":612,"value":1113}," text.rstrip()\n",{"type":606,"tag":636,"props":1115,"children":1116},{"class":638,"line":135},[1117,1121,1125,1129,1134,1138,1143,1147,1151],{"type":606,"tag":636,"props":1118,"children":1119},{"style":689},[1120],{"type":612,"value":692},{"type":606,"tag":636,"props":1122,"children":1123},{"style":651},[1124],{"type":612,"value":697},{"type":606,"tag":636,"props":1126,"children":1127},{"style":657},[1128],{"type":612,"value":702},{"type":606,"tag":636,"props":1130,"children":1131},{"style":663},[1132],{"type":612,"value":1133},"\"Right side: '",{"type":606,"tag":636,"props":1135,"children":1136},{"style":689},[1137],{"type":612,"value":712},{"type":606,"tag":636,"props":1139,"children":1140},{"style":651},[1141],{"type":612,"value":1142},"right_cleaned",{"type":606,"tag":636,"props":1144,"children":1145},{"style":689},[1146],{"type":612,"value":721},{"type":606,"tag":636,"props":1148,"children":1149},{"style":663},[1150],{"type":612,"value":726},{"type":606,"tag":636,"props":1152,"children":1153},{"style":651},[1154],{"type":612,"value":731},{"type":606,"tag":774,"props":1156,"children":1158},{"id":1157},"custom-character-removal",[1159],{"type":612,"value":1160},"🔍 Custom Character Removal",{"type":606,"tag":615,"props":1162,"children":1163},{},[1164],{"type":612,"value":1165},"You can also remove specific characters, not just whitespace.",{"type":606,"tag":621,"props":1167,"children":1168},{},[1169],{"type":606,"tag":625,"props":1170,"children":1172},{"className":627,"code":1171,"language":629,"meta":8,"style":8},"# Remove specific characters\ntext = \"...Hello World...\"\ncleaned = text.strip(\".\")\nprint(f\"Original: '{text}'\")\nprint(f\"Cleaned: '{cleaned}'\")\n\n# Remove multiple characters\ntext = \"***Python***\"\ncleaned = text.strip(\"*\")\nprint(f\"Original: '{text}'\")\nprint(f\"Cleaned: '{cleaned}'\")\n",[1173],{"type":606,"tag":632,"props":1174,"children":1175},{"__ignoreMap":8},[1176,1184,1200,1225,1264,1303,1310,1318,1334,1358,1397],{"type":606,"tag":636,"props":1177,"children":1178},{"class":638,"line":12},[1179],{"type":606,"tag":636,"props":1180,"children":1181},{"style":642},[1182],{"type":612,"value":1183},"# Remove specific characters\n",{"type":606,"tag":636,"props":1185,"children":1186},{"class":638,"line":27},[1187,1191,1195],{"type":606,"tag":636,"props":1188,"children":1189},{"style":651},[1190],{"type":612,"value":654},{"type":606,"tag":636,"props":1192,"children":1193},{"style":657},[1194],{"type":612,"value":660},{"type":606,"tag":636,"props":1196,"children":1197},{"style":663},[1198],{"type":612,"value":1199}," \"...Hello World...\"\n",{"type":606,"tag":636,"props":1201,"children":1202},{"class":638,"line":36},[1203,1207,1211,1216,1221],{"type":606,"tag":636,"props":1204,"children":1205},{"style":651},[1206],{"type":612,"value":674},{"type":606,"tag":636,"props":1208,"children":1209},{"style":657},[1210],{"type":612,"value":660},{"type":606,"tag":636,"props":1212,"children":1213},{"style":651},[1214],{"type":612,"value":1215}," text.strip(",{"type":606,"tag":636,"props":1217,"children":1218},{"style":663},[1219],{"type":612,"value":1220},"\".\"",{"type":606,"tag":636,"props":1222,"children":1223},{"style":651},[1224],{"type":612,"value":731},{"type":606,"tag":636,"props":1226,"children":1227},{"class":638,"line":45},[1228,1232,1236,1240,1244,1248,1252,1256,1260],{"type":606,"tag":636,"props":1229,"children":1230},{"style":689},[1231],{"type":612,"value":692},{"type":606,"tag":636,"props":1233,"children":1234},{"style":651},[1235],{"type":612,"value":697},{"type":606,"tag":636,"props":1237,"children":1238},{"style":657},[1239],{"type":612,"value":702},{"type":606,"tag":636,"props":1241,"children":1242},{"style":663},[1243],{"type":612,"value":707},{"type":606,"tag":636,"props":1245,"children":1246},{"style":689},[1247],{"type":612,"value":712},{"type":606,"tag":636,"props":1249,"children":1250},{"style":651},[1251],{"type":612,"value":612},{"type":606,"tag":636,"props":1253,"children":1254},{"style":689},[1255],{"type":612,"value":721},{"type":606,"tag":636,"props":1257,"children":1258},{"style":663},[1259],{"type":612,"value":726},{"type":606,"tag":636,"props":1261,"children":1262},{"style":651},[1263],{"type":612,"value":731},{"type":606,"tag":636,"props":1265,"children":1266},{"class":638,"line":54},[1267,1271,1275,1279,1283,1287,1291,1295,1299],{"type":606,"tag":636,"props":1268,"children":1269},{"style":689},[1270],{"type":612,"value":692},{"type":606,"tag":636,"props":1272,"children":1273},{"style":651},[1274],{"type":612,"value":697},{"type":606,"tag":636,"props":1276,"children":1277},{"style":657},[1278],{"type":612,"value":702},{"type":606,"tag":636,"props":1280,"children":1281},{"style":663},[1282],{"type":612,"value":751},{"type":606,"tag":636,"props":1284,"children":1285},{"style":689},[1286],{"type":612,"value":712},{"type":606,"tag":636,"props":1288,"children":1289},{"style":651},[1290],{"type":612,"value":760},{"type":606,"tag":636,"props":1292,"children":1293},{"style":689},[1294],{"type":612,"value":721},{"type":606,"tag":636,"props":1296,"children":1297},{"style":663},[1298],{"type":612,"value":726},{"type":606,"tag":636,"props":1300,"children":1301},{"style":651},[1302],{"type":612,"value":731},{"type":606,"tag":636,"props":1304,"children":1305},{"class":638,"line":63},[1306],{"type":606,"tag":636,"props":1307,"children":1308},{"emptyLinePlaceholder":13},[1309],{"type":612,"value":942},{"type":606,"tag":636,"props":1311,"children":1312},{"class":638,"line":72},[1313],{"type":606,"tag":636,"props":1314,"children":1315},{"style":642},[1316],{"type":612,"value":1317},"# Remove multiple characters\n",{"type":606,"tag":636,"props":1319,"children":1320},{"class":638,"line":81},[1321,1325,1329],{"type":606,"tag":636,"props":1322,"children":1323},{"style":651},[1324],{"type":612,"value":654},{"type":606,"tag":636,"props":1326,"children":1327},{"style":657},[1328],{"type":612,"value":660},{"type":606,"tag":636,"props":1330,"children":1331},{"style":663},[1332],{"type":612,"value":1333}," \"***Python***\"\n",{"type":606,"tag":636,"props":1335,"children":1336},{"class":638,"line":1025},[1337,1341,1345,1349,1354],{"type":606,"tag":636,"props":1338,"children":1339},{"style":651},[1340],{"type":612,"value":674},{"type":606,"tag":636,"props":1342,"children":1343},{"style":657},[1344],{"type":612,"value":660},{"type":606,"tag":636,"props":1346,"children":1347},{"style":651},[1348],{"type":612,"value":1215},{"type":606,"tag":636,"props":1350,"children":1351},{"style":663},[1352],{"type":612,"value":1353},"\"*\"",{"type":606,"tag":636,"props":1355,"children":1356},{"style":651},[1357],{"type":612,"value":731},{"type":606,"tag":636,"props":1359,"children":1360},{"class":638,"line":99},[1361,1365,1369,1373,1377,1381,1385,1389,1393],{"type":606,"tag":636,"props":1362,"children":1363},{"style":689},[1364],{"type":612,"value":692},{"type":606,"tag":636,"props":1366,"children":1367},{"style":651},[1368],{"type":612,"value":697},{"type":606,"tag":636,"props":1370,"children":1371},{"style":657},[1372],{"type":612,"value":702},{"type":606,"tag":636,"props":1374,"children":1375},{"style":663},[1376],{"type":612,"value":707},{"type":606,"tag":636,"props":1378,"children":1379},{"style":689},[1380],{"type":612,"value":712},{"type":606,"tag":636,"props":1382,"children":1383},{"style":651},[1384],{"type":612,"value":612},{"type":606,"tag":636,"props":1386,"children":1387},{"style":689},[1388],{"type":612,"value":721},{"type":606,"tag":636,"props":1390,"children":1391},{"style":663},[1392],{"type":612,"value":726},{"type":606,"tag":636,"props":1394,"children":1395},{"style":651},[1396],{"type":612,"value":731},{"type":606,"tag":636,"props":1398,"children":1399},{"class":638,"line":108},[1400,1404,1408,1412,1416,1420,1424,1428,1432],{"type":606,"tag":636,"props":1401,"children":1402},{"style":689},[1403],{"type":612,"value":692},{"type":606,"tag":636,"props":1405,"children":1406},{"style":651},[1407],{"type":612,"value":697},{"type":606,"tag":636,"props":1409,"children":1410},{"style":657},[1411],{"type":612,"value":702},{"type":606,"tag":636,"props":1413,"children":1414},{"style":663},[1415],{"type":612,"value":751},{"type":606,"tag":636,"props":1417,"children":1418},{"style":689},[1419],{"type":612,"value":712},{"type":606,"tag":636,"props":1421,"children":1422},{"style":651},[1423],{"type":612,"value":760},{"type":606,"tag":636,"props":1425,"children":1426},{"style":689},[1427],{"type":612,"value":721},{"type":606,"tag":636,"props":1429,"children":1430},{"style":663},[1431],{"type":612,"value":726},{"type":606,"tag":636,"props":1433,"children":1434},{"style":651},[1435],{"type":612,"value":731},{"type":606,"tag":774,"props":1437,"children":1439},{"id":1438},"common-use-cases",[1440],{"type":612,"value":1441},"🎨 Common Use Cases",{"type":606,"tag":615,"props":1443,"children":1444},{},[1445],{"type":612,"value":1446},"Here are some practical examples of whitespace removal in real-world scenarios.",{"type":606,"tag":621,"props":1448,"children":1449},{},[1450],{"type":606,"tag":625,"props":1451,"children":1453},{"className":627,"code":1452,"language":629,"meta":8,"style":8},"# 1. Cleaning user input\nuser_input = \"  john.doe@email.com  \"\nemail = user_input.strip()\nprint(f\"Cleaned email: '{email}'\")\n\n# 2. Processing file content\nfile_content = \"  First line  \\n  Second line  \\n\"\ncleaned_lines = [line.strip() for line in file_content.split(\"\\n\")]\nprint(\"Cleaned lines:\", cleaned_lines)\n\n# 3. Formatting text\ntext = \"  Python Programming  \"\nformatted = text.strip().title()\nprint(f\"Formatted: '{formatted}'\")\n",[1454],{"type":606,"tag":632,"props":1455,"children":1456},{"__ignoreMap":8},[1457,1465,1482,1499,1540,1547,1555,1590,1645,1666,1673,1681,1697,1714],{"type":606,"tag":636,"props":1458,"children":1459},{"class":638,"line":12},[1460],{"type":606,"tag":636,"props":1461,"children":1462},{"style":642},[1463],{"type":612,"value":1464},"# 1. Cleaning user input\n",{"type":606,"tag":636,"props":1466,"children":1467},{"class":638,"line":27},[1468,1473,1477],{"type":606,"tag":636,"props":1469,"children":1470},{"style":651},[1471],{"type":612,"value":1472},"user_input ",{"type":606,"tag":636,"props":1474,"children":1475},{"style":657},[1476],{"type":612,"value":660},{"type":606,"tag":636,"props":1478,"children":1479},{"style":663},[1480],{"type":612,"value":1481}," \"  john.doe@email.com  \"\n",{"type":606,"tag":636,"props":1483,"children":1484},{"class":638,"line":36},[1485,1490,1494],{"type":606,"tag":636,"props":1486,"children":1487},{"style":651},[1488],{"type":612,"value":1489},"email ",{"type":606,"tag":636,"props":1491,"children":1492},{"style":657},[1493],{"type":612,"value":660},{"type":606,"tag":636,"props":1495,"children":1496},{"style":651},[1497],{"type":612,"value":1498}," user_input.strip()\n",{"type":606,"tag":636,"props":1500,"children":1501},{"class":638,"line":45},[1502,1506,1510,1514,1519,1523,1528,1532,1536],{"type":606,"tag":636,"props":1503,"children":1504},{"style":689},[1505],{"type":612,"value":692},{"type":606,"tag":636,"props":1507,"children":1508},{"style":651},[1509],{"type":612,"value":697},{"type":606,"tag":636,"props":1511,"children":1512},{"style":657},[1513],{"type":612,"value":702},{"type":606,"tag":636,"props":1515,"children":1516},{"style":663},[1517],{"type":612,"value":1518},"\"Cleaned email: '",{"type":606,"tag":636,"props":1520,"children":1521},{"style":689},[1522],{"type":612,"value":712},{"type":606,"tag":636,"props":1524,"children":1525},{"style":651},[1526],{"type":612,"value":1527},"email",{"type":606,"tag":636,"props":1529,"children":1530},{"style":689},[1531],{"type":612,"value":721},{"type":606,"tag":636,"props":1533,"children":1534},{"style":663},[1535],{"type":612,"value":726},{"type":606,"tag":636,"props":1537,"children":1538},{"style":651},[1539],{"type":612,"value":731},{"type":606,"tag":636,"props":1541,"children":1542},{"class":638,"line":54},[1543],{"type":606,"tag":636,"props":1544,"children":1545},{"emptyLinePlaceholder":13},[1546],{"type":612,"value":942},{"type":606,"tag":636,"props":1548,"children":1549},{"class":638,"line":63},[1550],{"type":606,"tag":636,"props":1551,"children":1552},{"style":642},[1553],{"type":612,"value":1554},"# 2. Processing file content\n",{"type":606,"tag":636,"props":1556,"children":1557},{"class":638,"line":72},[1558,1563,1567,1572,1576,1581,1585],{"type":606,"tag":636,"props":1559,"children":1560},{"style":651},[1561],{"type":612,"value":1562},"file_content ",{"type":606,"tag":636,"props":1564,"children":1565},{"style":657},[1566],{"type":612,"value":660},{"type":606,"tag":636,"props":1568,"children":1569},{"style":663},[1570],{"type":612,"value":1571}," \"  First line  ",{"type":606,"tag":636,"props":1573,"children":1574},{"style":689},[1575],{"type":612,"value":882},{"type":606,"tag":636,"props":1577,"children":1578},{"style":663},[1579],{"type":612,"value":1580},"  Second line  ",{"type":606,"tag":636,"props":1582,"children":1583},{"style":689},[1584],{"type":612,"value":882},{"type":606,"tag":636,"props":1586,"children":1587},{"style":663},[1588],{"type":612,"value":1589},"\"\n",{"type":606,"tag":636,"props":1591,"children":1592},{"class":638,"line":81},[1593,1598,1602,1607,1612,1617,1622,1627,1632,1636,1640],{"type":606,"tag":636,"props":1594,"children":1595},{"style":651},[1596],{"type":612,"value":1597},"cleaned_lines ",{"type":606,"tag":636,"props":1599,"children":1600},{"style":657},[1601],{"type":612,"value":660},{"type":606,"tag":636,"props":1603,"children":1604},{"style":651},[1605],{"type":612,"value":1606}," [line.strip() ",{"type":606,"tag":636,"props":1608,"children":1609},{"style":657},[1610],{"type":612,"value":1611},"for",{"type":606,"tag":636,"props":1613,"children":1614},{"style":651},[1615],{"type":612,"value":1616}," line ",{"type":606,"tag":636,"props":1618,"children":1619},{"style":657},[1620],{"type":612,"value":1621},"in",{"type":606,"tag":636,"props":1623,"children":1624},{"style":651},[1625],{"type":612,"value":1626}," file_content.split(",{"type":606,"tag":636,"props":1628,"children":1629},{"style":663},[1630],{"type":612,"value":1631},"\"",{"type":606,"tag":636,"props":1633,"children":1634},{"style":689},[1635],{"type":612,"value":882},{"type":606,"tag":636,"props":1637,"children":1638},{"style":663},[1639],{"type":612,"value":1631},{"type":606,"tag":636,"props":1641,"children":1642},{"style":651},[1643],{"type":612,"value":1644},")]\n",{"type":606,"tag":636,"props":1646,"children":1647},{"class":638,"line":1025},[1648,1652,1656,1661],{"type":606,"tag":636,"props":1649,"children":1650},{"style":689},[1651],{"type":612,"value":692},{"type":606,"tag":636,"props":1653,"children":1654},{"style":651},[1655],{"type":612,"value":697},{"type":606,"tag":636,"props":1657,"children":1658},{"style":663},[1659],{"type":612,"value":1660},"\"Cleaned lines:\"",{"type":606,"tag":636,"props":1662,"children":1663},{"style":651},[1664],{"type":612,"value":1665},", cleaned_lines)\n",{"type":606,"tag":636,"props":1667,"children":1668},{"class":638,"line":99},[1669],{"type":606,"tag":636,"props":1670,"children":1671},{"emptyLinePlaceholder":13},[1672],{"type":612,"value":942},{"type":606,"tag":636,"props":1674,"children":1675},{"class":638,"line":108},[1676],{"type":606,"tag":636,"props":1677,"children":1678},{"style":642},[1679],{"type":612,"value":1680},"# 3. Formatting text\n",{"type":606,"tag":636,"props":1682,"children":1683},{"class":638,"line":117},[1684,1688,1692],{"type":606,"tag":636,"props":1685,"children":1686},{"style":651},[1687],{"type":612,"value":654},{"type":606,"tag":636,"props":1689,"children":1690},{"style":657},[1691],{"type":612,"value":660},{"type":606,"tag":636,"props":1693,"children":1694},{"style":663},[1695],{"type":612,"value":1696}," \"  Python Programming  \"\n",{"type":606,"tag":636,"props":1698,"children":1699},{"class":638,"line":126},[1700,1705,1709],{"type":606,"tag":636,"props":1701,"children":1702},{"style":651},[1703],{"type":612,"value":1704},"formatted ",{"type":606,"tag":636,"props":1706,"children":1707},{"style":657},[1708],{"type":612,"value":660},{"type":606,"tag":636,"props":1710,"children":1711},{"style":651},[1712],{"type":612,"value":1713}," text.strip().title()\n",{"type":606,"tag":636,"props":1715,"children":1716},{"class":638,"line":135},[1717,1721,1725,1729,1734,1738,1743,1747,1751],{"type":606,"tag":636,"props":1718,"children":1719},{"style":689},[1720],{"type":612,"value":692},{"type":606,"tag":636,"props":1722,"children":1723},{"style":651},[1724],{"type":612,"value":697},{"type":606,"tag":636,"props":1726,"children":1727},{"style":657},[1728],{"type":612,"value":702},{"type":606,"tag":636,"props":1730,"children":1731},{"style":663},[1732],{"type":612,"value":1733},"\"Formatted: '",{"type":606,"tag":636,"props":1735,"children":1736},{"style":689},[1737],{"type":612,"value":712},{"type":606,"tag":636,"props":1739,"children":1740},{"style":651},[1741],{"type":612,"value":1742},"formatted",{"type":606,"tag":636,"props":1744,"children":1745},{"style":689},[1746],{"type":612,"value":721},{"type":606,"tag":636,"props":1748,"children":1749},{"style":663},[1750],{"type":612,"value":726},{"type":606,"tag":636,"props":1752,"children":1753},{"style":651},[1754],{"type":612,"value":731},{"type":606,"tag":774,"props":1756,"children":1758},{"id":1757},"quick-practice",[1759],{"type":612,"value":1760},"📝 Quick Practice",{"type":606,"tag":615,"props":1762,"children":1763},{},[1764],{"type":612,"value":1765},"Let's practice cleaning up some messy text!",{"type":606,"tag":1767,"props":1768,"children":1771},"exercise",{"hint":1769,"prompt":1770},"Try using strip() and split() together!","Clean up a string containing extra spaces and newlines.",[1772],{"type":606,"tag":625,"props":1773,"children":1775},{"className":627,"code":1774,"language":629,"meta":8,"style":8},"# Whitespace Practice\nmessy_text = \"\"\"\n  Python is\n  a great language\n  for beginners\n\"\"\"\n\n# TODO: Clean up the text\n# 1. Remove extra spaces\n# 2. Remove newlines\n# 3. Make it a single line\n\n# Print the result\nprint(f\"Cleaned text: '{cleaned_text}'\")\n",[1776],{"type":606,"tag":632,"props":1777,"children":1778},{"__ignoreMap":8},[1779,1787,1804,1812,1820,1828,1836,1843,1861,1869,1877,1885,1892,1900],{"type":606,"tag":636,"props":1780,"children":1781},{"class":638,"line":12},[1782],{"type":606,"tag":636,"props":1783,"children":1784},{"style":642},[1785],{"type":612,"value":1786},"# Whitespace Practice\n",{"type":606,"tag":636,"props":1788,"children":1789},{"class":638,"line":27},[1790,1795,1799],{"type":606,"tag":636,"props":1791,"children":1792},{"style":651},[1793],{"type":612,"value":1794},"messy_text ",{"type":606,"tag":636,"props":1796,"children":1797},{"style":657},[1798],{"type":612,"value":660},{"type":606,"tag":636,"props":1800,"children":1801},{"style":663},[1802],{"type":612,"value":1803}," \"\"\"\n",{"type":606,"tag":636,"props":1805,"children":1806},{"class":638,"line":36},[1807],{"type":606,"tag":636,"props":1808,"children":1809},{"style":663},[1810],{"type":612,"value":1811},"  Python is\n",{"type":606,"tag":636,"props":1813,"children":1814},{"class":638,"line":45},[1815],{"type":606,"tag":636,"props":1816,"children":1817},{"style":663},[1818],{"type":612,"value":1819},"  a great language\n",{"type":606,"tag":636,"props":1821,"children":1822},{"class":638,"line":54},[1823],{"type":606,"tag":636,"props":1824,"children":1825},{"style":663},[1826],{"type":612,"value":1827},"  for beginners\n",{"type":606,"tag":636,"props":1829,"children":1830},{"class":638,"line":63},[1831],{"type":606,"tag":636,"props":1832,"children":1833},{"style":663},[1834],{"type":612,"value":1835},"\"\"\"\n",{"type":606,"tag":636,"props":1837,"children":1838},{"class":638,"line":72},[1839],{"type":606,"tag":636,"props":1840,"children":1841},{"emptyLinePlaceholder":13},[1842],{"type":612,"value":942},{"type":606,"tag":636,"props":1844,"children":1845},{"class":638,"line":81},[1846,1851,1856],{"type":606,"tag":636,"props":1847,"children":1848},{"style":642},[1849],{"type":612,"value":1850},"# ",{"type":606,"tag":636,"props":1852,"children":1853},{"style":657},[1854],{"type":612,"value":1855},"TODO",{"type":606,"tag":636,"props":1857,"children":1858},{"style":642},[1859],{"type":612,"value":1860},": Clean up the text\n",{"type":606,"tag":636,"props":1862,"children":1863},{"class":638,"line":1025},[1864],{"type":606,"tag":636,"props":1865,"children":1866},{"style":642},[1867],{"type":612,"value":1868},"# 1. Remove extra spaces\n",{"type":606,"tag":636,"props":1870,"children":1871},{"class":638,"line":99},[1872],{"type":606,"tag":636,"props":1873,"children":1874},{"style":642},[1875],{"type":612,"value":1876},"# 2. Remove newlines\n",{"type":606,"tag":636,"props":1878,"children":1879},{"class":638,"line":108},[1880],{"type":606,"tag":636,"props":1881,"children":1882},{"style":642},[1883],{"type":612,"value":1884},"# 3. Make it a single line\n",{"type":606,"tag":636,"props":1886,"children":1887},{"class":638,"line":117},[1888],{"type":606,"tag":636,"props":1889,"children":1890},{"emptyLinePlaceholder":13},[1891],{"type":612,"value":942},{"type":606,"tag":636,"props":1893,"children":1894},{"class":638,"line":126},[1895],{"type":606,"tag":636,"props":1896,"children":1897},{"style":642},[1898],{"type":612,"value":1899},"# Print the result\n",{"type":606,"tag":636,"props":1901,"children":1902},{"class":638,"line":135},[1903,1907,1911,1915,1920,1924,1929,1933,1937],{"type":606,"tag":636,"props":1904,"children":1905},{"style":689},[1906],{"type":612,"value":692},{"type":606,"tag":636,"props":1908,"children":1909},{"style":651},[1910],{"type":612,"value":697},{"type":606,"tag":636,"props":1912,"children":1913},{"style":657},[1914],{"type":612,"value":702},{"type":606,"tag":636,"props":1916,"children":1917},{"style":663},[1918],{"type":612,"value":1919},"\"Cleaned text: '",{"type":606,"tag":636,"props":1921,"children":1922},{"style":689},[1923],{"type":612,"value":712},{"type":606,"tag":636,"props":1925,"children":1926},{"style":651},[1927],{"type":612,"value":1928},"cleaned_text",{"type":606,"tag":636,"props":1930,"children":1931},{"style":689},[1932],{"type":612,"value":721},{"type":606,"tag":636,"props":1934,"children":1935},{"style":663},[1936],{"type":612,"value":726},{"type":606,"tag":636,"props":1938,"children":1939},{"style":651},[1940],{"type":612,"value":731},{"type":606,"tag":895,"props":1942,"children":1944},{"id":1943},"solution-and-explanation",[1945],{"type":612,"value":1946},"Solution and Explanation 💡",{"type":606,"tag":1948,"props":1949,"children":1950},"details",{},[1951,1959,2147,2155],{"type":606,"tag":1952,"props":1953,"children":1956},"summary",{"className":1954},[1955],"cursor-pointer",[1957],{"type":612,"value":1958},"Click to see the solution",{"type":606,"tag":621,"props":1960,"children":1961},{},[1962],{"type":606,"tag":625,"props":1963,"children":1965},{"className":627,"code":1964,"language":629,"meta":8,"style":8},"# Whitespace Practice Solution\nmessy_text = \"\"\"\n  Python is\n  a great language\n  for beginners\n\"\"\"\n\n# Clean up the text\ncleaned_text = \" \".join(line.strip() for line in messy_text.split(\"\\n\") if line.strip())\n\nprint(f\"Cleaned text: '{cleaned_text}'\")\n",[1966],{"type":606,"tag":632,"props":1967,"children":1968},{"__ignoreMap":8},[1969,1977,1992,1999,2006,2013,2020,2027,2035,2101,2108],{"type":606,"tag":636,"props":1970,"children":1971},{"class":638,"line":12},[1972],{"type":606,"tag":636,"props":1973,"children":1974},{"style":642},[1975],{"type":612,"value":1976},"# Whitespace Practice Solution\n",{"type":606,"tag":636,"props":1978,"children":1979},{"class":638,"line":27},[1980,1984,1988],{"type":606,"tag":636,"props":1981,"children":1982},{"style":651},[1983],{"type":612,"value":1794},{"type":606,"tag":636,"props":1985,"children":1986},{"style":657},[1987],{"type":612,"value":660},{"type":606,"tag":636,"props":1989,"children":1990},{"style":663},[1991],{"type":612,"value":1803},{"type":606,"tag":636,"props":1993,"children":1994},{"class":638,"line":36},[1995],{"type":606,"tag":636,"props":1996,"children":1997},{"style":663},[1998],{"type":612,"value":1811},{"type":606,"tag":636,"props":2000,"children":2001},{"class":638,"line":45},[2002],{"type":606,"tag":636,"props":2003,"children":2004},{"style":663},[2005],{"type":612,"value":1819},{"type":606,"tag":636,"props":2007,"children":2008},{"class":638,"line":54},[2009],{"type":606,"tag":636,"props":2010,"children":2011},{"style":663},[2012],{"type":612,"value":1827},{"type":606,"tag":636,"props":2014,"children":2015},{"class":638,"line":63},[2016],{"type":606,"tag":636,"props":2017,"children":2018},{"style":663},[2019],{"type":612,"value":1835},{"type":606,"tag":636,"props":2021,"children":2022},{"class":638,"line":72},[2023],{"type":606,"tag":636,"props":2024,"children":2025},{"emptyLinePlaceholder":13},[2026],{"type":612,"value":942},{"type":606,"tag":636,"props":2028,"children":2029},{"class":638,"line":81},[2030],{"type":606,"tag":636,"props":2031,"children":2032},{"style":642},[2033],{"type":612,"value":2034},"# Clean up the text\n",{"type":606,"tag":636,"props":2036,"children":2037},{"class":638,"line":1025},[2038,2043,2047,2052,2057,2061,2065,2069,2074,2078,2082,2086,2091,2096],{"type":606,"tag":636,"props":2039,"children":2040},{"style":651},[2041],{"type":612,"value":2042},"cleaned_text ",{"type":606,"tag":636,"props":2044,"children":2045},{"style":657},[2046],{"type":612,"value":660},{"type":606,"tag":636,"props":2048,"children":2049},{"style":663},[2050],{"type":612,"value":2051}," \" \"",{"type":606,"tag":636,"props":2053,"children":2054},{"style":651},[2055],{"type":612,"value":2056},".join(line.strip() ",{"type":606,"tag":636,"props":2058,"children":2059},{"style":657},[2060],{"type":612,"value":1611},{"type":606,"tag":636,"props":2062,"children":2063},{"style":651},[2064],{"type":612,"value":1616},{"type":606,"tag":636,"props":2066,"children":2067},{"style":657},[2068],{"type":612,"value":1621},{"type":606,"tag":636,"props":2070,"children":2071},{"style":651},[2072],{"type":612,"value":2073}," messy_text.split(",{"type":606,"tag":636,"props":2075,"children":2076},{"style":663},[2077],{"type":612,"value":1631},{"type":606,"tag":636,"props":2079,"children":2080},{"style":689},[2081],{"type":612,"value":882},{"type":606,"tag":636,"props":2083,"children":2084},{"style":663},[2085],{"type":612,"value":1631},{"type":606,"tag":636,"props":2087,"children":2088},{"style":651},[2089],{"type":612,"value":2090},") ",{"type":606,"tag":636,"props":2092,"children":2093},{"style":657},[2094],{"type":612,"value":2095},"if",{"type":606,"tag":636,"props":2097,"children":2098},{"style":651},[2099],{"type":612,"value":2100}," line.strip())\n",{"type":606,"tag":636,"props":2102,"children":2103},{"class":638,"line":99},[2104],{"type":606,"tag":636,"props":2105,"children":2106},{"emptyLinePlaceholder":13},[2107],{"type":612,"value":942},{"type":606,"tag":636,"props":2109,"children":2110},{"class":638,"line":108},[2111,2115,2119,2123,2127,2131,2135,2139,2143],{"type":606,"tag":636,"props":2112,"children":2113},{"style":689},[2114],{"type":612,"value":692},{"type":606,"tag":636,"props":2116,"children":2117},{"style":651},[2118],{"type":612,"value":697},{"type":606,"tag":636,"props":2120,"children":2121},{"style":657},[2122],{"type":612,"value":702},{"type":606,"tag":636,"props":2124,"children":2125},{"style":663},[2126],{"type":612,"value":1919},{"type":606,"tag":636,"props":2128,"children":2129},{"style":689},[2130],{"type":612,"value":712},{"type":606,"tag":636,"props":2132,"children":2133},{"style":651},[2134],{"type":612,"value":1928},{"type":606,"tag":636,"props":2136,"children":2137},{"style":689},[2138],{"type":612,"value":721},{"type":606,"tag":636,"props":2140,"children":2141},{"style":663},[2142],{"type":612,"value":726},{"type":606,"tag":636,"props":2144,"children":2145},{"style":651},[2146],{"type":612,"value":731},{"type":606,"tag":615,"props":2148,"children":2149},{},[2150],{"type":606,"tag":796,"props":2151,"children":2152},{},[2153],{"type":612,"value":2154},"Key Learning Points:",{"type":606,"tag":802,"props":2156,"children":2157},{},[2158,2171,2182,2187],{"type":606,"tag":806,"props":2159,"children":2160},{},[2161,2163,2169],{"type":612,"value":2162},"📌 Used ",{"type":606,"tag":632,"props":2164,"children":2166},{"className":2165},[],[2167],{"type":612,"value":2168},".split(\"\\n\")",{"type":612,"value":2170}," to break into lines",{"type":606,"tag":806,"props":2172,"children":2173},{},[2174,2175,2180],{"type":612,"value":2162},{"type":606,"tag":632,"props":2176,"children":2178},{"className":2177},[],[2179],{"type":612,"value":814},{"type":612,"value":2181}," to clean each line",{"type":606,"tag":806,"props":2183,"children":2184},{},[2185],{"type":612,"value":2186},"📌 Used list comprehension to filter empty lines",{"type":606,"tag":806,"props":2188,"children":2189},{},[2190,2191,2197],{"type":612,"value":2162},{"type":606,"tag":632,"props":2192,"children":2194},{"className":2193},[],[2195],{"type":612,"value":2196},"\" \".join()",{"type":612,"value":2198}," to combine into one line",{"type":606,"tag":774,"props":2200,"children":2202},{"id":2201},"key-takeaways",[2203],{"type":612,"value":2204},"🎯 Key Takeaways",{"type":606,"tag":786,"props":2206,"children":2210},{"emoji":2207,"title":2208,"type":2209},"📚","Whitespace Removal Essentials","success",[2211,2219,2252,2260,2283],{"type":606,"tag":615,"props":2212,"children":2213},{},[2214],{"type":606,"tag":796,"props":2215,"children":2216},{},[2217],{"type":612,"value":2218},"Basic Methods:",{"type":606,"tag":802,"props":2220,"children":2221},{},[2222,2232,2242],{"type":606,"tag":806,"props":2223,"children":2224},{},[2225,2230],{"type":606,"tag":632,"props":2226,"children":2228},{"className":2227},[],[2229],{"type":612,"value":814},{"type":612,"value":2231}," for both ends",{"type":606,"tag":806,"props":2233,"children":2234},{},[2235,2240],{"type":606,"tag":632,"props":2236,"children":2238},{"className":2237},[],[2239],{"type":612,"value":825},{"type":612,"value":2241}," for left side",{"type":606,"tag":806,"props":2243,"children":2244},{},[2245,2250],{"type":606,"tag":632,"props":2246,"children":2248},{"className":2247},[],[2249],{"type":612,"value":836},{"type":612,"value":2251}," for right side",{"type":606,"tag":615,"props":2253,"children":2254},{},[2255],{"type":606,"tag":796,"props":2256,"children":2257},{},[2258],{"type":612,"value":2259},"Best Practices:",{"type":606,"tag":802,"props":2261,"children":2262},{},[2263,2268,2273,2278],{"type":606,"tag":806,"props":2264,"children":2265},{},[2266],{"type":612,"value":2267},"Clean user input immediately",{"type":606,"tag":806,"props":2269,"children":2270},{},[2271],{"type":612,"value":2272},"Use appropriate method for your needs",{"type":606,"tag":806,"props":2274,"children":2275},{},[2276],{"type":612,"value":2277},"Combine with other string methods",{"type":606,"tag":806,"props":2279,"children":2280},{},[2281],{"type":612,"value":2282},"Consider using regex for complex cases",{"type":606,"tag":615,"props":2284,"children":2285},{},[2286,2291],{"type":606,"tag":796,"props":2287,"children":2288},{},[2289],{"type":612,"value":2290},"Remember:",{"type":612,"value":2292}," Whitespace removal is often the first step in text processing!",{"type":606,"tag":2294,"props":2295,"children":2296},"style",{},[2297],{"type":612,"value":2298},"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":2300},[2301,2304,2305,2306,2309],{"id":776,"depth":27,"text":779,"children":2302},[2303],{"id":897,"depth":36,"text":900},{"id":1157,"depth":27,"text":1160},{"id":1438,"depth":27,"text":1441},{"id":1757,"depth":27,"text":1760,"children":2307},[2308],{"id":1943,"depth":36,"text":1946},{"id":2201,"depth":27,"text":2204},1782373757528]