[{"data":1,"prerenderedAt":3139},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/find-replace-text":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},"/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,"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",[40],{"_path":41,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"body":602,"_type":15,"_id":46,"_source":17,"_file":47,"_stem":48,"_extension":20},{"type":603,"children":604,"toc":3128},"root",[605,614,620,792,799,804,880,887,1259,1265,1278,1600,1606,1611,1966,1972,1977,2143,2149,2997,3003,3122],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"finding-and-replacing-text",[611],{"type":612,"value":613},"text","🔍 Finding and Replacing Text",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618],{"type":612,"value":619},"Python provides powerful methods to search for and replace text within strings. These operations are essential for text processing and data cleaning.",{"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 find and replace\ntext = \"Hello World\"\nnew_text = text.replace(\"World\", \"Python\")\nprint(f\"Original: {text}\")\nprint(f\"Replaced: {new_text}\")\n","python",[631],{"type":606,"tag":632,"props":633,"children":634},"code",{"__ignoreMap":8},[635,646,667,704,751],{"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 find and replace\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,684,689,694,699],{"type":606,"tag":636,"props":671,"children":672},{"style":651},[673],{"type":612,"value":674},"new_text ",{"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.replace(",{"type":606,"tag":636,"props":685,"children":686},{"style":663},[687],{"type":612,"value":688},"\"World\"",{"type":606,"tag":636,"props":690,"children":691},{"style":651},[692],{"type":612,"value":693},", ",{"type":606,"tag":636,"props":695,"children":696},{"style":663},[697],{"type":612,"value":698},"\"Python\"",{"type":606,"tag":636,"props":700,"children":701},{"style":651},[702],{"type":612,"value":703},")\n",{"type":606,"tag":636,"props":705,"children":706},{"class":638,"line":45},[707,713,718,723,728,733,737,742,747],{"type":606,"tag":636,"props":708,"children":710},{"style":709},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[711],{"type":612,"value":712},"print",{"type":606,"tag":636,"props":714,"children":715},{"style":651},[716],{"type":612,"value":717},"(",{"type":606,"tag":636,"props":719,"children":720},{"style":657},[721],{"type":612,"value":722},"f",{"type":606,"tag":636,"props":724,"children":725},{"style":663},[726],{"type":612,"value":727},"\"Original: ",{"type":606,"tag":636,"props":729,"children":730},{"style":709},[731],{"type":612,"value":732},"{",{"type":606,"tag":636,"props":734,"children":735},{"style":651},[736],{"type":612,"value":612},{"type":606,"tag":636,"props":738,"children":739},{"style":709},[740],{"type":612,"value":741},"}",{"type":606,"tag":636,"props":743,"children":744},{"style":663},[745],{"type":612,"value":746},"\"",{"type":606,"tag":636,"props":748,"children":749},{"style":651},[750],{"type":612,"value":703},{"type":606,"tag":636,"props":752,"children":753},{"class":638,"line":54},[754,758,762,766,771,775,780,784,788],{"type":606,"tag":636,"props":755,"children":756},{"style":709},[757],{"type":612,"value":712},{"type":606,"tag":636,"props":759,"children":760},{"style":651},[761],{"type":612,"value":717},{"type":606,"tag":636,"props":763,"children":764},{"style":657},[765],{"type":612,"value":722},{"type":606,"tag":636,"props":767,"children":768},{"style":663},[769],{"type":612,"value":770},"\"Replaced: ",{"type":606,"tag":636,"props":772,"children":773},{"style":709},[774],{"type":612,"value":732},{"type":606,"tag":636,"props":776,"children":777},{"style":651},[778],{"type":612,"value":779},"new_text",{"type":606,"tag":636,"props":781,"children":782},{"style":709},[783],{"type":612,"value":741},{"type":606,"tag":636,"props":785,"children":786},{"style":663},[787],{"type":612,"value":746},{"type":606,"tag":636,"props":789,"children":790},{"style":651},[791],{"type":612,"value":703},{"type":606,"tag":793,"props":794,"children":796},"h2",{"id":795},"finding-text",[797],{"type":612,"value":798},"🎯 Finding Text",{"type":606,"tag":615,"props":800,"children":801},{},[802],{"type":612,"value":803},"Python offers several methods to locate text within strings.",{"type":606,"tag":805,"props":806,"children":810},"info-box",{"emoji":807,"title":808,"type":809},"📝","Finding Methods","info",[811,820],{"type":606,"tag":615,"props":812,"children":813},{},[814],{"type":606,"tag":815,"props":816,"children":817},"strong",{},[818],{"type":612,"value":819},"Main Methods:",{"type":606,"tag":821,"props":822,"children":823},"ul",{},[824,836,847,858,869],{"type":606,"tag":825,"props":826,"children":827},"li",{},[828,834],{"type":606,"tag":632,"props":829,"children":831},{"className":830},[],[832],{"type":612,"value":833},".find()",{"type":612,"value":835},": Returns first occurrence index",{"type":606,"tag":825,"props":837,"children":838},{},[839,845],{"type":606,"tag":632,"props":840,"children":842},{"className":841},[],[843],{"type":612,"value":844},".rfind()",{"type":612,"value":846},": Returns last occurrence index",{"type":606,"tag":825,"props":848,"children":849},{},[850,856],{"type":606,"tag":632,"props":851,"children":853},{"className":852},[],[854],{"type":612,"value":855},".index()",{"type":612,"value":857},": Like find but raises error if not found",{"type":606,"tag":825,"props":859,"children":860},{},[861,867],{"type":606,"tag":632,"props":862,"children":864},{"className":863},[],[865],{"type":612,"value":866},".rindex()",{"type":612,"value":868},": Like rfind but raises error if not found",{"type":606,"tag":825,"props":870,"children":871},{},[872,878],{"type":606,"tag":632,"props":873,"children":875},{"className":874},[],[876],{"type":612,"value":877},".count()",{"type":612,"value":879},": Counts occurrences",{"type":606,"tag":881,"props":882,"children":884},"h3",{"id":883},"basic-examples",[885],{"type":612,"value":886},"Basic Examples",{"type":606,"tag":621,"props":888,"children":889},{},[890],{"type":606,"tag":625,"props":891,"children":893},{"className":627,"code":892,"language":629,"meta":8,"style":8},"# Different ways to find text\ntext = \"Python is fun, Python is great\"\n\n# Find first occurrence\nfirst_pos = text.find(\"Python\")\nprint(f\"First 'Python' at: {first_pos}\")\n\n# Find last occurrence\nlast_pos = text.rfind(\"Python\")\nprint(f\"Last 'Python' at: {last_pos}\")\n\n# Count occurrences\ncount = text.count(\"Python\")\nprint(f\"'Python' appears {count} times\")\n\n# Using index (raises error if not found)\ntry:\n    pos = text.index(\"Java\")\nexcept ValueError:\n    print(\"'Java' not found!\")\n",[894],{"type":606,"tag":632,"props":895,"children":896},{"__ignoreMap":8},[897,905,921,929,937,962,1003,1010,1018,1044,1085,1092,1100,1125,1167,1174,1182,1195,1221,1238],{"type":606,"tag":636,"props":898,"children":899},{"class":638,"line":12},[900],{"type":606,"tag":636,"props":901,"children":902},{"style":642},[903],{"type":612,"value":904},"# Different ways to find text\n",{"type":606,"tag":636,"props":906,"children":907},{"class":638,"line":27},[908,912,916],{"type":606,"tag":636,"props":909,"children":910},{"style":651},[911],{"type":612,"value":654},{"type":606,"tag":636,"props":913,"children":914},{"style":657},[915],{"type":612,"value":660},{"type":606,"tag":636,"props":917,"children":918},{"style":663},[919],{"type":612,"value":920}," \"Python is fun, Python is great\"\n",{"type":606,"tag":636,"props":922,"children":923},{"class":638,"line":36},[924],{"type":606,"tag":636,"props":925,"children":926},{"emptyLinePlaceholder":13},[927],{"type":612,"value":928},"\n",{"type":606,"tag":636,"props":930,"children":931},{"class":638,"line":45},[932],{"type":606,"tag":636,"props":933,"children":934},{"style":642},[935],{"type":612,"value":936},"# Find first occurrence\n",{"type":606,"tag":636,"props":938,"children":939},{"class":638,"line":54},[940,945,949,954,958],{"type":606,"tag":636,"props":941,"children":942},{"style":651},[943],{"type":612,"value":944},"first_pos ",{"type":606,"tag":636,"props":946,"children":947},{"style":657},[948],{"type":612,"value":660},{"type":606,"tag":636,"props":950,"children":951},{"style":651},[952],{"type":612,"value":953}," text.find(",{"type":606,"tag":636,"props":955,"children":956},{"style":663},[957],{"type":612,"value":698},{"type":606,"tag":636,"props":959,"children":960},{"style":651},[961],{"type":612,"value":703},{"type":606,"tag":636,"props":963,"children":964},{"class":638,"line":63},[965,969,973,977,982,986,991,995,999],{"type":606,"tag":636,"props":966,"children":967},{"style":709},[968],{"type":612,"value":712},{"type":606,"tag":636,"props":970,"children":971},{"style":651},[972],{"type":612,"value":717},{"type":606,"tag":636,"props":974,"children":975},{"style":657},[976],{"type":612,"value":722},{"type":606,"tag":636,"props":978,"children":979},{"style":663},[980],{"type":612,"value":981},"\"First 'Python' at: ",{"type":606,"tag":636,"props":983,"children":984},{"style":709},[985],{"type":612,"value":732},{"type":606,"tag":636,"props":987,"children":988},{"style":651},[989],{"type":612,"value":990},"first_pos",{"type":606,"tag":636,"props":992,"children":993},{"style":709},[994],{"type":612,"value":741},{"type":606,"tag":636,"props":996,"children":997},{"style":663},[998],{"type":612,"value":746},{"type":606,"tag":636,"props":1000,"children":1001},{"style":651},[1002],{"type":612,"value":703},{"type":606,"tag":636,"props":1004,"children":1005},{"class":638,"line":72},[1006],{"type":606,"tag":636,"props":1007,"children":1008},{"emptyLinePlaceholder":13},[1009],{"type":612,"value":928},{"type":606,"tag":636,"props":1011,"children":1012},{"class":638,"line":81},[1013],{"type":606,"tag":636,"props":1014,"children":1015},{"style":642},[1016],{"type":612,"value":1017},"# Find last occurrence\n",{"type":606,"tag":636,"props":1019,"children":1021},{"class":638,"line":1020},9,[1022,1027,1031,1036,1040],{"type":606,"tag":636,"props":1023,"children":1024},{"style":651},[1025],{"type":612,"value":1026},"last_pos ",{"type":606,"tag":636,"props":1028,"children":1029},{"style":657},[1030],{"type":612,"value":660},{"type":606,"tag":636,"props":1032,"children":1033},{"style":651},[1034],{"type":612,"value":1035}," text.rfind(",{"type":606,"tag":636,"props":1037,"children":1038},{"style":663},[1039],{"type":612,"value":698},{"type":606,"tag":636,"props":1041,"children":1042},{"style":651},[1043],{"type":612,"value":703},{"type":606,"tag":636,"props":1045,"children":1046},{"class":638,"line":99},[1047,1051,1055,1059,1064,1068,1073,1077,1081],{"type":606,"tag":636,"props":1048,"children":1049},{"style":709},[1050],{"type":612,"value":712},{"type":606,"tag":636,"props":1052,"children":1053},{"style":651},[1054],{"type":612,"value":717},{"type":606,"tag":636,"props":1056,"children":1057},{"style":657},[1058],{"type":612,"value":722},{"type":606,"tag":636,"props":1060,"children":1061},{"style":663},[1062],{"type":612,"value":1063},"\"Last 'Python' at: ",{"type":606,"tag":636,"props":1065,"children":1066},{"style":709},[1067],{"type":612,"value":732},{"type":606,"tag":636,"props":1069,"children":1070},{"style":651},[1071],{"type":612,"value":1072},"last_pos",{"type":606,"tag":636,"props":1074,"children":1075},{"style":709},[1076],{"type":612,"value":741},{"type":606,"tag":636,"props":1078,"children":1079},{"style":663},[1080],{"type":612,"value":746},{"type":606,"tag":636,"props":1082,"children":1083},{"style":651},[1084],{"type":612,"value":703},{"type":606,"tag":636,"props":1086,"children":1087},{"class":638,"line":108},[1088],{"type":606,"tag":636,"props":1089,"children":1090},{"emptyLinePlaceholder":13},[1091],{"type":612,"value":928},{"type":606,"tag":636,"props":1093,"children":1094},{"class":638,"line":117},[1095],{"type":606,"tag":636,"props":1096,"children":1097},{"style":642},[1098],{"type":612,"value":1099},"# Count occurrences\n",{"type":606,"tag":636,"props":1101,"children":1102},{"class":638,"line":126},[1103,1108,1112,1117,1121],{"type":606,"tag":636,"props":1104,"children":1105},{"style":651},[1106],{"type":612,"value":1107},"count ",{"type":606,"tag":636,"props":1109,"children":1110},{"style":657},[1111],{"type":612,"value":660},{"type":606,"tag":636,"props":1113,"children":1114},{"style":651},[1115],{"type":612,"value":1116}," text.count(",{"type":606,"tag":636,"props":1118,"children":1119},{"style":663},[1120],{"type":612,"value":698},{"type":606,"tag":636,"props":1122,"children":1123},{"style":651},[1124],{"type":612,"value":703},{"type":606,"tag":636,"props":1126,"children":1127},{"class":638,"line":135},[1128,1132,1136,1140,1145,1149,1154,1158,1163],{"type":606,"tag":636,"props":1129,"children":1130},{"style":709},[1131],{"type":612,"value":712},{"type":606,"tag":636,"props":1133,"children":1134},{"style":651},[1135],{"type":612,"value":717},{"type":606,"tag":636,"props":1137,"children":1138},{"style":657},[1139],{"type":612,"value":722},{"type":606,"tag":636,"props":1141,"children":1142},{"style":663},[1143],{"type":612,"value":1144},"\"'Python' appears ",{"type":606,"tag":636,"props":1146,"children":1147},{"style":709},[1148],{"type":612,"value":732},{"type":606,"tag":636,"props":1150,"children":1151},{"style":651},[1152],{"type":612,"value":1153},"count",{"type":606,"tag":636,"props":1155,"children":1156},{"style":709},[1157],{"type":612,"value":741},{"type":606,"tag":636,"props":1159,"children":1160},{"style":663},[1161],{"type":612,"value":1162}," times\"",{"type":606,"tag":636,"props":1164,"children":1165},{"style":651},[1166],{"type":612,"value":703},{"type":606,"tag":636,"props":1168,"children":1169},{"class":638,"line":144},[1170],{"type":606,"tag":636,"props":1171,"children":1172},{"emptyLinePlaceholder":13},[1173],{"type":612,"value":928},{"type":606,"tag":636,"props":1175,"children":1176},{"class":638,"line":153},[1177],{"type":606,"tag":636,"props":1178,"children":1179},{"style":642},[1180],{"type":612,"value":1181},"# Using index (raises error if not found)\n",{"type":606,"tag":636,"props":1183,"children":1184},{"class":638,"line":163},[1185,1190],{"type":606,"tag":636,"props":1186,"children":1187},{"style":657},[1188],{"type":612,"value":1189},"try",{"type":606,"tag":636,"props":1191,"children":1192},{"style":651},[1193],{"type":612,"value":1194},":\n",{"type":606,"tag":636,"props":1196,"children":1197},{"class":638,"line":172},[1198,1203,1207,1212,1217],{"type":606,"tag":636,"props":1199,"children":1200},{"style":651},[1201],{"type":612,"value":1202},"    pos ",{"type":606,"tag":636,"props":1204,"children":1205},{"style":657},[1206],{"type":612,"value":660},{"type":606,"tag":636,"props":1208,"children":1209},{"style":651},[1210],{"type":612,"value":1211}," text.index(",{"type":606,"tag":636,"props":1213,"children":1214},{"style":663},[1215],{"type":612,"value":1216},"\"Java\"",{"type":606,"tag":636,"props":1218,"children":1219},{"style":651},[1220],{"type":612,"value":703},{"type":606,"tag":636,"props":1222,"children":1223},{"class":638,"line":181},[1224,1229,1234],{"type":606,"tag":636,"props":1225,"children":1226},{"style":657},[1227],{"type":612,"value":1228},"except",{"type":606,"tag":636,"props":1230,"children":1231},{"style":709},[1232],{"type":612,"value":1233}," ValueError",{"type":606,"tag":636,"props":1235,"children":1236},{"style":651},[1237],{"type":612,"value":1194},{"type":606,"tag":636,"props":1239,"children":1240},{"class":638,"line":190},[1241,1246,1250,1255],{"type":606,"tag":636,"props":1242,"children":1243},{"style":709},[1244],{"type":612,"value":1245},"    print",{"type":606,"tag":636,"props":1247,"children":1248},{"style":651},[1249],{"type":612,"value":717},{"type":606,"tag":636,"props":1251,"children":1252},{"style":663},[1253],{"type":612,"value":1254},"\"'Java' not found!\"",{"type":606,"tag":636,"props":1256,"children":1257},{"style":651},[1258],{"type":612,"value":703},{"type":606,"tag":793,"props":1260,"children":1262},{"id":1261},"replacing-text",[1263],{"type":612,"value":1264},"🔄 Replacing Text",{"type":606,"tag":615,"props":1266,"children":1267},{},[1268,1270,1276],{"type":612,"value":1269},"The ",{"type":606,"tag":632,"props":1271,"children":1273},{"className":1272},[],[1274],{"type":612,"value":1275},".replace()",{"type":612,"value":1277}," method is the primary tool for text replacement.",{"type":606,"tag":621,"props":1279,"children":1280},{},[1281],{"type":606,"tag":625,"props":1282,"children":1284},{"className":627,"code":1283,"language":629,"meta":8,"style":8},"# Basic replacement\ntext = \"Hello World\"\nnew_text = text.replace(\"World\", \"Python\")\nprint(f\"Replaced: {new_text}\")\n\n# Multiple replacements\ntext = \"cat, dog, cat, bird\"\nnew_text = text.replace(\"cat\", \"mouse\")\nprint(f\"Replaced: {new_text}\")\n\n# Limiting replacements\ntext = \"cat, dog, cat, bird\"\nnew_text = text.replace(\"cat\", \"mouse\", 1)  # Replace only first occurrence\nprint(f\"Limited replacement: {new_text}\")\n",[1285],{"type":606,"tag":632,"props":1286,"children":1287},{"__ignoreMap":8},[1288,1296,1311,1342,1381,1388,1396,1412,1445,1484,1491,1499,1514,1560],{"type":606,"tag":636,"props":1289,"children":1290},{"class":638,"line":12},[1291],{"type":606,"tag":636,"props":1292,"children":1293},{"style":642},[1294],{"type":612,"value":1295},"# Basic replacement\n",{"type":606,"tag":636,"props":1297,"children":1298},{"class":638,"line":27},[1299,1303,1307],{"type":606,"tag":636,"props":1300,"children":1301},{"style":651},[1302],{"type":612,"value":654},{"type":606,"tag":636,"props":1304,"children":1305},{"style":657},[1306],{"type":612,"value":660},{"type":606,"tag":636,"props":1308,"children":1309},{"style":663},[1310],{"type":612,"value":666},{"type":606,"tag":636,"props":1312,"children":1313},{"class":638,"line":36},[1314,1318,1322,1326,1330,1334,1338],{"type":606,"tag":636,"props":1315,"children":1316},{"style":651},[1317],{"type":612,"value":674},{"type":606,"tag":636,"props":1319,"children":1320},{"style":657},[1321],{"type":612,"value":660},{"type":606,"tag":636,"props":1323,"children":1324},{"style":651},[1325],{"type":612,"value":683},{"type":606,"tag":636,"props":1327,"children":1328},{"style":663},[1329],{"type":612,"value":688},{"type":606,"tag":636,"props":1331,"children":1332},{"style":651},[1333],{"type":612,"value":693},{"type":606,"tag":636,"props":1335,"children":1336},{"style":663},[1337],{"type":612,"value":698},{"type":606,"tag":636,"props":1339,"children":1340},{"style":651},[1341],{"type":612,"value":703},{"type":606,"tag":636,"props":1343,"children":1344},{"class":638,"line":45},[1345,1349,1353,1357,1361,1365,1369,1373,1377],{"type":606,"tag":636,"props":1346,"children":1347},{"style":709},[1348],{"type":612,"value":712},{"type":606,"tag":636,"props":1350,"children":1351},{"style":651},[1352],{"type":612,"value":717},{"type":606,"tag":636,"props":1354,"children":1355},{"style":657},[1356],{"type":612,"value":722},{"type":606,"tag":636,"props":1358,"children":1359},{"style":663},[1360],{"type":612,"value":770},{"type":606,"tag":636,"props":1362,"children":1363},{"style":709},[1364],{"type":612,"value":732},{"type":606,"tag":636,"props":1366,"children":1367},{"style":651},[1368],{"type":612,"value":779},{"type":606,"tag":636,"props":1370,"children":1371},{"style":709},[1372],{"type":612,"value":741},{"type":606,"tag":636,"props":1374,"children":1375},{"style":663},[1376],{"type":612,"value":746},{"type":606,"tag":636,"props":1378,"children":1379},{"style":651},[1380],{"type":612,"value":703},{"type":606,"tag":636,"props":1382,"children":1383},{"class":638,"line":54},[1384],{"type":606,"tag":636,"props":1385,"children":1386},{"emptyLinePlaceholder":13},[1387],{"type":612,"value":928},{"type":606,"tag":636,"props":1389,"children":1390},{"class":638,"line":63},[1391],{"type":606,"tag":636,"props":1392,"children":1393},{"style":642},[1394],{"type":612,"value":1395},"# Multiple replacements\n",{"type":606,"tag":636,"props":1397,"children":1398},{"class":638,"line":72},[1399,1403,1407],{"type":606,"tag":636,"props":1400,"children":1401},{"style":651},[1402],{"type":612,"value":654},{"type":606,"tag":636,"props":1404,"children":1405},{"style":657},[1406],{"type":612,"value":660},{"type":606,"tag":636,"props":1408,"children":1409},{"style":663},[1410],{"type":612,"value":1411}," \"cat, dog, cat, bird\"\n",{"type":606,"tag":636,"props":1413,"children":1414},{"class":638,"line":81},[1415,1419,1423,1427,1432,1436,1441],{"type":606,"tag":636,"props":1416,"children":1417},{"style":651},[1418],{"type":612,"value":674},{"type":606,"tag":636,"props":1420,"children":1421},{"style":657},[1422],{"type":612,"value":660},{"type":606,"tag":636,"props":1424,"children":1425},{"style":651},[1426],{"type":612,"value":683},{"type":606,"tag":636,"props":1428,"children":1429},{"style":663},[1430],{"type":612,"value":1431},"\"cat\"",{"type":606,"tag":636,"props":1433,"children":1434},{"style":651},[1435],{"type":612,"value":693},{"type":606,"tag":636,"props":1437,"children":1438},{"style":663},[1439],{"type":612,"value":1440},"\"mouse\"",{"type":606,"tag":636,"props":1442,"children":1443},{"style":651},[1444],{"type":612,"value":703},{"type":606,"tag":636,"props":1446,"children":1447},{"class":638,"line":1020},[1448,1452,1456,1460,1464,1468,1472,1476,1480],{"type":606,"tag":636,"props":1449,"children":1450},{"style":709},[1451],{"type":612,"value":712},{"type":606,"tag":636,"props":1453,"children":1454},{"style":651},[1455],{"type":612,"value":717},{"type":606,"tag":636,"props":1457,"children":1458},{"style":657},[1459],{"type":612,"value":722},{"type":606,"tag":636,"props":1461,"children":1462},{"style":663},[1463],{"type":612,"value":770},{"type":606,"tag":636,"props":1465,"children":1466},{"style":709},[1467],{"type":612,"value":732},{"type":606,"tag":636,"props":1469,"children":1470},{"style":651},[1471],{"type":612,"value":779},{"type":606,"tag":636,"props":1473,"children":1474},{"style":709},[1475],{"type":612,"value":741},{"type":606,"tag":636,"props":1477,"children":1478},{"style":663},[1479],{"type":612,"value":746},{"type":606,"tag":636,"props":1481,"children":1482},{"style":651},[1483],{"type":612,"value":703},{"type":606,"tag":636,"props":1485,"children":1486},{"class":638,"line":99},[1487],{"type":606,"tag":636,"props":1488,"children":1489},{"emptyLinePlaceholder":13},[1490],{"type":612,"value":928},{"type":606,"tag":636,"props":1492,"children":1493},{"class":638,"line":108},[1494],{"type":606,"tag":636,"props":1495,"children":1496},{"style":642},[1497],{"type":612,"value":1498},"# Limiting replacements\n",{"type":606,"tag":636,"props":1500,"children":1501},{"class":638,"line":117},[1502,1506,1510],{"type":606,"tag":636,"props":1503,"children":1504},{"style":651},[1505],{"type":612,"value":654},{"type":606,"tag":636,"props":1507,"children":1508},{"style":657},[1509],{"type":612,"value":660},{"type":606,"tag":636,"props":1511,"children":1512},{"style":663},[1513],{"type":612,"value":1411},{"type":606,"tag":636,"props":1515,"children":1516},{"class":638,"line":126},[1517,1521,1525,1529,1533,1537,1541,1545,1550,1555],{"type":606,"tag":636,"props":1518,"children":1519},{"style":651},[1520],{"type":612,"value":674},{"type":606,"tag":636,"props":1522,"children":1523},{"style":657},[1524],{"type":612,"value":660},{"type":606,"tag":636,"props":1526,"children":1527},{"style":651},[1528],{"type":612,"value":683},{"type":606,"tag":636,"props":1530,"children":1531},{"style":663},[1532],{"type":612,"value":1431},{"type":606,"tag":636,"props":1534,"children":1535},{"style":651},[1536],{"type":612,"value":693},{"type":606,"tag":636,"props":1538,"children":1539},{"style":663},[1540],{"type":612,"value":1440},{"type":606,"tag":636,"props":1542,"children":1543},{"style":651},[1544],{"type":612,"value":693},{"type":606,"tag":636,"props":1546,"children":1547},{"style":709},[1548],{"type":612,"value":1549},"1",{"type":606,"tag":636,"props":1551,"children":1552},{"style":651},[1553],{"type":612,"value":1554},")  ",{"type":606,"tag":636,"props":1556,"children":1557},{"style":642},[1558],{"type":612,"value":1559},"# Replace only first occurrence\n",{"type":606,"tag":636,"props":1561,"children":1562},{"class":638,"line":135},[1563,1567,1571,1575,1580,1584,1588,1592,1596],{"type":606,"tag":636,"props":1564,"children":1565},{"style":709},[1566],{"type":612,"value":712},{"type":606,"tag":636,"props":1568,"children":1569},{"style":651},[1570],{"type":612,"value":717},{"type":606,"tag":636,"props":1572,"children":1573},{"style":657},[1574],{"type":612,"value":722},{"type":606,"tag":636,"props":1576,"children":1577},{"style":663},[1578],{"type":612,"value":1579},"\"Limited replacement: ",{"type":606,"tag":636,"props":1581,"children":1582},{"style":709},[1583],{"type":612,"value":732},{"type":606,"tag":636,"props":1585,"children":1586},{"style":651},[1587],{"type":612,"value":779},{"type":606,"tag":636,"props":1589,"children":1590},{"style":709},[1591],{"type":612,"value":741},{"type":606,"tag":636,"props":1593,"children":1594},{"style":663},[1595],{"type":612,"value":746},{"type":606,"tag":636,"props":1597,"children":1598},{"style":651},[1599],{"type":612,"value":703},{"type":606,"tag":793,"props":1601,"children":1603},{"id":1602},"common-use-cases",[1604],{"type":612,"value":1605},"🎨 Common Use Cases",{"type":606,"tag":615,"props":1607,"children":1608},{},[1609],{"type":612,"value":1610},"Here are some practical examples of finding and replacing text.",{"type":606,"tag":621,"props":1612,"children":1613},{},[1614],{"type":606,"tag":625,"props":1615,"children":1617},{"className":627,"code":1616,"language":629,"meta":8,"style":8},"# 1. Cleaning data\ntext = \"User123@email.com\"\ncleaned = text.replace(\"@\", \" [at] \")\nprint(f\"Cleaned email: {cleaned}\")\n\n# 2. Formatting text\ntext = \"hello world\"\nformatted = text.replace(\"h\", \"H\").replace(\"w\", \"W\")\nprint(f\"Formatted: {formatted}\")\n\n# 3. Multiple replacements\ntext = \"The price is $100.00\"\ncleaned = text.replace(\"$\", \"\").replace(\".00\", \"\")\nprint(f\"Cleaned price: {cleaned}\")\n",[1618],{"type":606,"tag":632,"props":1619,"children":1620},{"__ignoreMap":8},[1621,1629,1645,1679,1720,1727,1735,1751,1804,1845,1852,1860,1876,1926],{"type":606,"tag":636,"props":1622,"children":1623},{"class":638,"line":12},[1624],{"type":606,"tag":636,"props":1625,"children":1626},{"style":642},[1627],{"type":612,"value":1628},"# 1. Cleaning data\n",{"type":606,"tag":636,"props":1630,"children":1631},{"class":638,"line":27},[1632,1636,1640],{"type":606,"tag":636,"props":1633,"children":1634},{"style":651},[1635],{"type":612,"value":654},{"type":606,"tag":636,"props":1637,"children":1638},{"style":657},[1639],{"type":612,"value":660},{"type":606,"tag":636,"props":1641,"children":1642},{"style":663},[1643],{"type":612,"value":1644}," \"User123@email.com\"\n",{"type":606,"tag":636,"props":1646,"children":1647},{"class":638,"line":36},[1648,1653,1657,1661,1666,1670,1675],{"type":606,"tag":636,"props":1649,"children":1650},{"style":651},[1651],{"type":612,"value":1652},"cleaned ",{"type":606,"tag":636,"props":1654,"children":1655},{"style":657},[1656],{"type":612,"value":660},{"type":606,"tag":636,"props":1658,"children":1659},{"style":651},[1660],{"type":612,"value":683},{"type":606,"tag":636,"props":1662,"children":1663},{"style":663},[1664],{"type":612,"value":1665},"\"@\"",{"type":606,"tag":636,"props":1667,"children":1668},{"style":651},[1669],{"type":612,"value":693},{"type":606,"tag":636,"props":1671,"children":1672},{"style":663},[1673],{"type":612,"value":1674},"\" [at] \"",{"type":606,"tag":636,"props":1676,"children":1677},{"style":651},[1678],{"type":612,"value":703},{"type":606,"tag":636,"props":1680,"children":1681},{"class":638,"line":45},[1682,1686,1690,1694,1699,1703,1708,1712,1716],{"type":606,"tag":636,"props":1683,"children":1684},{"style":709},[1685],{"type":612,"value":712},{"type":606,"tag":636,"props":1687,"children":1688},{"style":651},[1689],{"type":612,"value":717},{"type":606,"tag":636,"props":1691,"children":1692},{"style":657},[1693],{"type":612,"value":722},{"type":606,"tag":636,"props":1695,"children":1696},{"style":663},[1697],{"type":612,"value":1698},"\"Cleaned email: ",{"type":606,"tag":636,"props":1700,"children":1701},{"style":709},[1702],{"type":612,"value":732},{"type":606,"tag":636,"props":1704,"children":1705},{"style":651},[1706],{"type":612,"value":1707},"cleaned",{"type":606,"tag":636,"props":1709,"children":1710},{"style":709},[1711],{"type":612,"value":741},{"type":606,"tag":636,"props":1713,"children":1714},{"style":663},[1715],{"type":612,"value":746},{"type":606,"tag":636,"props":1717,"children":1718},{"style":651},[1719],{"type":612,"value":703},{"type":606,"tag":636,"props":1721,"children":1722},{"class":638,"line":54},[1723],{"type":606,"tag":636,"props":1724,"children":1725},{"emptyLinePlaceholder":13},[1726],{"type":612,"value":928},{"type":606,"tag":636,"props":1728,"children":1729},{"class":638,"line":63},[1730],{"type":606,"tag":636,"props":1731,"children":1732},{"style":642},[1733],{"type":612,"value":1734},"# 2. Formatting text\n",{"type":606,"tag":636,"props":1736,"children":1737},{"class":638,"line":72},[1738,1742,1746],{"type":606,"tag":636,"props":1739,"children":1740},{"style":651},[1741],{"type":612,"value":654},{"type":606,"tag":636,"props":1743,"children":1744},{"style":657},[1745],{"type":612,"value":660},{"type":606,"tag":636,"props":1747,"children":1748},{"style":663},[1749],{"type":612,"value":1750}," \"hello world\"\n",{"type":606,"tag":636,"props":1752,"children":1753},{"class":638,"line":81},[1754,1759,1763,1767,1772,1776,1781,1786,1791,1795,1800],{"type":606,"tag":636,"props":1755,"children":1756},{"style":651},[1757],{"type":612,"value":1758},"formatted ",{"type":606,"tag":636,"props":1760,"children":1761},{"style":657},[1762],{"type":612,"value":660},{"type":606,"tag":636,"props":1764,"children":1765},{"style":651},[1766],{"type":612,"value":683},{"type":606,"tag":636,"props":1768,"children":1769},{"style":663},[1770],{"type":612,"value":1771},"\"h\"",{"type":606,"tag":636,"props":1773,"children":1774},{"style":651},[1775],{"type":612,"value":693},{"type":606,"tag":636,"props":1777,"children":1778},{"style":663},[1779],{"type":612,"value":1780},"\"H\"",{"type":606,"tag":636,"props":1782,"children":1783},{"style":651},[1784],{"type":612,"value":1785},").replace(",{"type":606,"tag":636,"props":1787,"children":1788},{"style":663},[1789],{"type":612,"value":1790},"\"w\"",{"type":606,"tag":636,"props":1792,"children":1793},{"style":651},[1794],{"type":612,"value":693},{"type":606,"tag":636,"props":1796,"children":1797},{"style":663},[1798],{"type":612,"value":1799},"\"W\"",{"type":606,"tag":636,"props":1801,"children":1802},{"style":651},[1803],{"type":612,"value":703},{"type":606,"tag":636,"props":1805,"children":1806},{"class":638,"line":1020},[1807,1811,1815,1819,1824,1828,1833,1837,1841],{"type":606,"tag":636,"props":1808,"children":1809},{"style":709},[1810],{"type":612,"value":712},{"type":606,"tag":636,"props":1812,"children":1813},{"style":651},[1814],{"type":612,"value":717},{"type":606,"tag":636,"props":1816,"children":1817},{"style":657},[1818],{"type":612,"value":722},{"type":606,"tag":636,"props":1820,"children":1821},{"style":663},[1822],{"type":612,"value":1823},"\"Formatted: ",{"type":606,"tag":636,"props":1825,"children":1826},{"style":709},[1827],{"type":612,"value":732},{"type":606,"tag":636,"props":1829,"children":1830},{"style":651},[1831],{"type":612,"value":1832},"formatted",{"type":606,"tag":636,"props":1834,"children":1835},{"style":709},[1836],{"type":612,"value":741},{"type":606,"tag":636,"props":1838,"children":1839},{"style":663},[1840],{"type":612,"value":746},{"type":606,"tag":636,"props":1842,"children":1843},{"style":651},[1844],{"type":612,"value":703},{"type":606,"tag":636,"props":1846,"children":1847},{"class":638,"line":99},[1848],{"type":606,"tag":636,"props":1849,"children":1850},{"emptyLinePlaceholder":13},[1851],{"type":612,"value":928},{"type":606,"tag":636,"props":1853,"children":1854},{"class":638,"line":108},[1855],{"type":606,"tag":636,"props":1856,"children":1857},{"style":642},[1858],{"type":612,"value":1859},"# 3. Multiple replacements\n",{"type":606,"tag":636,"props":1861,"children":1862},{"class":638,"line":117},[1863,1867,1871],{"type":606,"tag":636,"props":1864,"children":1865},{"style":651},[1866],{"type":612,"value":654},{"type":606,"tag":636,"props":1868,"children":1869},{"style":657},[1870],{"type":612,"value":660},{"type":606,"tag":636,"props":1872,"children":1873},{"style":663},[1874],{"type":612,"value":1875}," \"The price is $100.00\"\n",{"type":606,"tag":636,"props":1877,"children":1878},{"class":638,"line":126},[1879,1883,1887,1891,1896,1900,1905,1909,1914,1918,1922],{"type":606,"tag":636,"props":1880,"children":1881},{"style":651},[1882],{"type":612,"value":1652},{"type":606,"tag":636,"props":1884,"children":1885},{"style":657},[1886],{"type":612,"value":660},{"type":606,"tag":636,"props":1888,"children":1889},{"style":651},[1890],{"type":612,"value":683},{"type":606,"tag":636,"props":1892,"children":1893},{"style":663},[1894],{"type":612,"value":1895},"\"$\"",{"type":606,"tag":636,"props":1897,"children":1898},{"style":651},[1899],{"type":612,"value":693},{"type":606,"tag":636,"props":1901,"children":1902},{"style":663},[1903],{"type":612,"value":1904},"\"\"",{"type":606,"tag":636,"props":1906,"children":1907},{"style":651},[1908],{"type":612,"value":1785},{"type":606,"tag":636,"props":1910,"children":1911},{"style":663},[1912],{"type":612,"value":1913},"\".00\"",{"type":606,"tag":636,"props":1915,"children":1916},{"style":651},[1917],{"type":612,"value":693},{"type":606,"tag":636,"props":1919,"children":1920},{"style":663},[1921],{"type":612,"value":1904},{"type":606,"tag":636,"props":1923,"children":1924},{"style":651},[1925],{"type":612,"value":703},{"type":606,"tag":636,"props":1927,"children":1928},{"class":638,"line":135},[1929,1933,1937,1941,1946,1950,1954,1958,1962],{"type":606,"tag":636,"props":1930,"children":1931},{"style":709},[1932],{"type":612,"value":712},{"type":606,"tag":636,"props":1934,"children":1935},{"style":651},[1936],{"type":612,"value":717},{"type":606,"tag":636,"props":1938,"children":1939},{"style":657},[1940],{"type":612,"value":722},{"type":606,"tag":636,"props":1942,"children":1943},{"style":663},[1944],{"type":612,"value":1945},"\"Cleaned price: ",{"type":606,"tag":636,"props":1947,"children":1948},{"style":709},[1949],{"type":612,"value":732},{"type":606,"tag":636,"props":1951,"children":1952},{"style":651},[1953],{"type":612,"value":1707},{"type":606,"tag":636,"props":1955,"children":1956},{"style":709},[1957],{"type":612,"value":741},{"type":606,"tag":636,"props":1959,"children":1960},{"style":663},[1961],{"type":612,"value":746},{"type":606,"tag":636,"props":1963,"children":1964},{"style":651},[1965],{"type":612,"value":703},{"type":606,"tag":793,"props":1967,"children":1969},{"id":1968},"quick-practice",[1970],{"type":612,"value":1971},"📝 Quick Practice",{"type":606,"tag":615,"props":1973,"children":1974},{},[1975],{"type":612,"value":1976},"Let's practice finding and replacing text in a real-world scenario!",{"type":606,"tag":1978,"props":1979,"children":1982},"exercise",{"hint":1980,"prompt":1981},"Try using multiple replace() calls!","Clean up a text containing sensitive information.",[1983],{"type":606,"tag":625,"props":1984,"children":1986},{"className":627,"code":1985,"language":629,"meta":8,"style":8},"# Text Cleaning Practice\nsensitive_text = \"\"\"\nUser: john.doe@company.com\nPhone: 555-123-4567\nID: 123-45-6789\n\"\"\"\n\n# TODO: Clean up the sensitive information\n# 1. Mask email addresses\n# 2. Mask phone numbers\n# 3. Mask social security numbers\n\n# Print the result\nprint(\"Cleaned text:\")\nprint(cleaned_text)\n",[1987],{"type":606,"tag":632,"props":1988,"children":1989},{"__ignoreMap":8},[1990,1998,2015,2023,2031,2039,2047,2054,2072,2080,2088,2096,2103,2111,2131],{"type":606,"tag":636,"props":1991,"children":1992},{"class":638,"line":12},[1993],{"type":606,"tag":636,"props":1994,"children":1995},{"style":642},[1996],{"type":612,"value":1997},"# Text Cleaning Practice\n",{"type":606,"tag":636,"props":1999,"children":2000},{"class":638,"line":27},[2001,2006,2010],{"type":606,"tag":636,"props":2002,"children":2003},{"style":651},[2004],{"type":612,"value":2005},"sensitive_text ",{"type":606,"tag":636,"props":2007,"children":2008},{"style":657},[2009],{"type":612,"value":660},{"type":606,"tag":636,"props":2011,"children":2012},{"style":663},[2013],{"type":612,"value":2014}," \"\"\"\n",{"type":606,"tag":636,"props":2016,"children":2017},{"class":638,"line":36},[2018],{"type":606,"tag":636,"props":2019,"children":2020},{"style":663},[2021],{"type":612,"value":2022},"User: john.doe@company.com\n",{"type":606,"tag":636,"props":2024,"children":2025},{"class":638,"line":45},[2026],{"type":606,"tag":636,"props":2027,"children":2028},{"style":663},[2029],{"type":612,"value":2030},"Phone: 555-123-4567\n",{"type":606,"tag":636,"props":2032,"children":2033},{"class":638,"line":54},[2034],{"type":606,"tag":636,"props":2035,"children":2036},{"style":663},[2037],{"type":612,"value":2038},"ID: 123-45-6789\n",{"type":606,"tag":636,"props":2040,"children":2041},{"class":638,"line":63},[2042],{"type":606,"tag":636,"props":2043,"children":2044},{"style":663},[2045],{"type":612,"value":2046},"\"\"\"\n",{"type":606,"tag":636,"props":2048,"children":2049},{"class":638,"line":72},[2050],{"type":606,"tag":636,"props":2051,"children":2052},{"emptyLinePlaceholder":13},[2053],{"type":612,"value":928},{"type":606,"tag":636,"props":2055,"children":2056},{"class":638,"line":81},[2057,2062,2067],{"type":606,"tag":636,"props":2058,"children":2059},{"style":642},[2060],{"type":612,"value":2061},"# ",{"type":606,"tag":636,"props":2063,"children":2064},{"style":657},[2065],{"type":612,"value":2066},"TODO",{"type":606,"tag":636,"props":2068,"children":2069},{"style":642},[2070],{"type":612,"value":2071},": Clean up the sensitive information\n",{"type":606,"tag":636,"props":2073,"children":2074},{"class":638,"line":1020},[2075],{"type":606,"tag":636,"props":2076,"children":2077},{"style":642},[2078],{"type":612,"value":2079},"# 1. Mask email addresses\n",{"type":606,"tag":636,"props":2081,"children":2082},{"class":638,"line":99},[2083],{"type":606,"tag":636,"props":2084,"children":2085},{"style":642},[2086],{"type":612,"value":2087},"# 2. Mask phone numbers\n",{"type":606,"tag":636,"props":2089,"children":2090},{"class":638,"line":108},[2091],{"type":606,"tag":636,"props":2092,"children":2093},{"style":642},[2094],{"type":612,"value":2095},"# 3. Mask social security numbers\n",{"type":606,"tag":636,"props":2097,"children":2098},{"class":638,"line":117},[2099],{"type":606,"tag":636,"props":2100,"children":2101},{"emptyLinePlaceholder":13},[2102],{"type":612,"value":928},{"type":606,"tag":636,"props":2104,"children":2105},{"class":638,"line":126},[2106],{"type":606,"tag":636,"props":2107,"children":2108},{"style":642},[2109],{"type":612,"value":2110},"# Print the result\n",{"type":606,"tag":636,"props":2112,"children":2113},{"class":638,"line":135},[2114,2118,2122,2127],{"type":606,"tag":636,"props":2115,"children":2116},{"style":709},[2117],{"type":612,"value":712},{"type":606,"tag":636,"props":2119,"children":2120},{"style":651},[2121],{"type":612,"value":717},{"type":606,"tag":636,"props":2123,"children":2124},{"style":663},[2125],{"type":612,"value":2126},"\"Cleaned text:\"",{"type":606,"tag":636,"props":2128,"children":2129},{"style":651},[2130],{"type":612,"value":703},{"type":606,"tag":636,"props":2132,"children":2133},{"class":638,"line":144},[2134,2138],{"type":606,"tag":636,"props":2135,"children":2136},{"style":709},[2137],{"type":612,"value":712},{"type":606,"tag":636,"props":2139,"children":2140},{"style":651},[2141],{"type":612,"value":2142},"(cleaned_text)\n",{"type":606,"tag":881,"props":2144,"children":2146},{"id":2145},"solution-and-explanation",[2147],{"type":612,"value":2148},"Solution and Explanation 💡",{"type":606,"tag":2150,"props":2151,"children":2152},"details",{},[2153,2161,2953,2961],{"type":606,"tag":2154,"props":2155,"children":2158},"summary",{"className":2156},[2157],"cursor-pointer",[2159],{"type":612,"value":2160},"Click to see the solution",{"type":606,"tag":621,"props":2162,"children":2163},{},[2164],{"type":606,"tag":625,"props":2165,"children":2167},{"className":627,"code":2166,"language":629,"meta":8,"style":8},"# Text Cleaning Practice Solution\nsensitive_text = \"\"\"\nUser: john.doe@company.com\nPhone: 555-123-4567\nID: 123-45-6789\n\"\"\"\n\n# Clean up the sensitive information\ncleaned_text = sensitive_text\n\n# Mask email\nemail_pos = cleaned_text.find(\"@\")\nif email_pos != -1:\n    username = cleaned_text[:email_pos].split(\": \")[1]\n    domain = cleaned_text[email_pos:].split(\"\\n\")[0]\n    masked_email = f\"User: {username[0]}***@{domain}\"\n    cleaned_text = cleaned_text.replace(cleaned_text.split(\"\\n\")[1], masked_email)\n\n# Mask phone\nphone_pos = cleaned_text.find(\"555-\")\nif phone_pos != -1:\n    phone = cleaned_text[phone_pos:].split(\"\\n\")[0]\n    masked_phone = f\"Phone: ***-***-{phone[-4:]}\"\n    cleaned_text = cleaned_text.replace(cleaned_text.split(\"\\n\")[2], masked_phone)\n\n# Mask SSN\nssn_pos = cleaned_text.find(\"123-45-\")\nif ssn_pos != -1:\n    ssn = cleaned_text[ssn_pos:].split(\"\\n\")[0]\n    masked_ssn = f\"ID: ***-**-{ssn[-4:]}\"\n    cleaned_text = cleaned_text.replace(cleaned_text.split(\"\\n\")[3], masked_ssn)\n\nprint(\"Cleaned text:\")\nprint(cleaned_text)\n",[2168],{"type":606,"tag":632,"props":2169,"children":2170},{"__ignoreMap":8},[2171,2179,2194,2201,2208,2215,2222,2229,2237,2254,2261,2269,2294,2325,2361,2404,2471,2513,2520,2528,2553,2581,2622,2675,2716,2723,2731,2756,2784,2825,2875,2916,2923,2942],{"type":606,"tag":636,"props":2172,"children":2173},{"class":638,"line":12},[2174],{"type":606,"tag":636,"props":2175,"children":2176},{"style":642},[2177],{"type":612,"value":2178},"# Text Cleaning Practice Solution\n",{"type":606,"tag":636,"props":2180,"children":2181},{"class":638,"line":27},[2182,2186,2190],{"type":606,"tag":636,"props":2183,"children":2184},{"style":651},[2185],{"type":612,"value":2005},{"type":606,"tag":636,"props":2187,"children":2188},{"style":657},[2189],{"type":612,"value":660},{"type":606,"tag":636,"props":2191,"children":2192},{"style":663},[2193],{"type":612,"value":2014},{"type":606,"tag":636,"props":2195,"children":2196},{"class":638,"line":36},[2197],{"type":606,"tag":636,"props":2198,"children":2199},{"style":663},[2200],{"type":612,"value":2022},{"type":606,"tag":636,"props":2202,"children":2203},{"class":638,"line":45},[2204],{"type":606,"tag":636,"props":2205,"children":2206},{"style":663},[2207],{"type":612,"value":2030},{"type":606,"tag":636,"props":2209,"children":2210},{"class":638,"line":54},[2211],{"type":606,"tag":636,"props":2212,"children":2213},{"style":663},[2214],{"type":612,"value":2038},{"type":606,"tag":636,"props":2216,"children":2217},{"class":638,"line":63},[2218],{"type":606,"tag":636,"props":2219,"children":2220},{"style":663},[2221],{"type":612,"value":2046},{"type":606,"tag":636,"props":2223,"children":2224},{"class":638,"line":72},[2225],{"type":606,"tag":636,"props":2226,"children":2227},{"emptyLinePlaceholder":13},[2228],{"type":612,"value":928},{"type":606,"tag":636,"props":2230,"children":2231},{"class":638,"line":81},[2232],{"type":606,"tag":636,"props":2233,"children":2234},{"style":642},[2235],{"type":612,"value":2236},"# Clean up the sensitive information\n",{"type":606,"tag":636,"props":2238,"children":2239},{"class":638,"line":1020},[2240,2245,2249],{"type":606,"tag":636,"props":2241,"children":2242},{"style":651},[2243],{"type":612,"value":2244},"cleaned_text ",{"type":606,"tag":636,"props":2246,"children":2247},{"style":657},[2248],{"type":612,"value":660},{"type":606,"tag":636,"props":2250,"children":2251},{"style":651},[2252],{"type":612,"value":2253}," sensitive_text\n",{"type":606,"tag":636,"props":2255,"children":2256},{"class":638,"line":99},[2257],{"type":606,"tag":636,"props":2258,"children":2259},{"emptyLinePlaceholder":13},[2260],{"type":612,"value":928},{"type":606,"tag":636,"props":2262,"children":2263},{"class":638,"line":108},[2264],{"type":606,"tag":636,"props":2265,"children":2266},{"style":642},[2267],{"type":612,"value":2268},"# Mask email\n",{"type":606,"tag":636,"props":2270,"children":2271},{"class":638,"line":117},[2272,2277,2281,2286,2290],{"type":606,"tag":636,"props":2273,"children":2274},{"style":651},[2275],{"type":612,"value":2276},"email_pos ",{"type":606,"tag":636,"props":2278,"children":2279},{"style":657},[2280],{"type":612,"value":660},{"type":606,"tag":636,"props":2282,"children":2283},{"style":651},[2284],{"type":612,"value":2285}," cleaned_text.find(",{"type":606,"tag":636,"props":2287,"children":2288},{"style":663},[2289],{"type":612,"value":1665},{"type":606,"tag":636,"props":2291,"children":2292},{"style":651},[2293],{"type":612,"value":703},{"type":606,"tag":636,"props":2295,"children":2296},{"class":638,"line":126},[2297,2302,2307,2312,2317,2321],{"type":606,"tag":636,"props":2298,"children":2299},{"style":657},[2300],{"type":612,"value":2301},"if",{"type":606,"tag":636,"props":2303,"children":2304},{"style":651},[2305],{"type":612,"value":2306}," email_pos ",{"type":606,"tag":636,"props":2308,"children":2309},{"style":657},[2310],{"type":612,"value":2311},"!=",{"type":606,"tag":636,"props":2313,"children":2314},{"style":657},[2315],{"type":612,"value":2316}," -",{"type":606,"tag":636,"props":2318,"children":2319},{"style":709},[2320],{"type":612,"value":1549},{"type":606,"tag":636,"props":2322,"children":2323},{"style":651},[2324],{"type":612,"value":1194},{"type":606,"tag":636,"props":2326,"children":2327},{"class":638,"line":135},[2328,2333,2337,2342,2347,2352,2356],{"type":606,"tag":636,"props":2329,"children":2330},{"style":651},[2331],{"type":612,"value":2332},"    username ",{"type":606,"tag":636,"props":2334,"children":2335},{"style":657},[2336],{"type":612,"value":660},{"type":606,"tag":636,"props":2338,"children":2339},{"style":651},[2340],{"type":612,"value":2341}," cleaned_text[:email_pos].split(",{"type":606,"tag":636,"props":2343,"children":2344},{"style":663},[2345],{"type":612,"value":2346},"\": \"",{"type":606,"tag":636,"props":2348,"children":2349},{"style":651},[2350],{"type":612,"value":2351},")[",{"type":606,"tag":636,"props":2353,"children":2354},{"style":709},[2355],{"type":612,"value":1549},{"type":606,"tag":636,"props":2357,"children":2358},{"style":651},[2359],{"type":612,"value":2360},"]\n",{"type":606,"tag":636,"props":2362,"children":2363},{"class":638,"line":144},[2364,2369,2373,2378,2382,2387,2391,2395,2400],{"type":606,"tag":636,"props":2365,"children":2366},{"style":651},[2367],{"type":612,"value":2368},"    domain ",{"type":606,"tag":636,"props":2370,"children":2371},{"style":657},[2372],{"type":612,"value":660},{"type":606,"tag":636,"props":2374,"children":2375},{"style":651},[2376],{"type":612,"value":2377}," cleaned_text[email_pos:].split(",{"type":606,"tag":636,"props":2379,"children":2380},{"style":663},[2381],{"type":612,"value":746},{"type":606,"tag":636,"props":2383,"children":2384},{"style":709},[2385],{"type":612,"value":2386},"\\n",{"type":606,"tag":636,"props":2388,"children":2389},{"style":663},[2390],{"type":612,"value":746},{"type":606,"tag":636,"props":2392,"children":2393},{"style":651},[2394],{"type":612,"value":2351},{"type":606,"tag":636,"props":2396,"children":2397},{"style":709},[2398],{"type":612,"value":2399},"0",{"type":606,"tag":636,"props":2401,"children":2402},{"style":651},[2403],{"type":612,"value":2360},{"type":606,"tag":636,"props":2405,"children":2406},{"class":638,"line":153},[2407,2412,2416,2421,2426,2430,2435,2439,2444,2448,2453,2457,2462,2466],{"type":606,"tag":636,"props":2408,"children":2409},{"style":651},[2410],{"type":612,"value":2411},"    masked_email ",{"type":606,"tag":636,"props":2413,"children":2414},{"style":657},[2415],{"type":612,"value":660},{"type":606,"tag":636,"props":2417,"children":2418},{"style":657},[2419],{"type":612,"value":2420}," f",{"type":606,"tag":636,"props":2422,"children":2423},{"style":663},[2424],{"type":612,"value":2425},"\"User: ",{"type":606,"tag":636,"props":2427,"children":2428},{"style":709},[2429],{"type":612,"value":732},{"type":606,"tag":636,"props":2431,"children":2432},{"style":651},[2433],{"type":612,"value":2434},"username[",{"type":606,"tag":636,"props":2436,"children":2437},{"style":709},[2438],{"type":612,"value":2399},{"type":606,"tag":636,"props":2440,"children":2441},{"style":651},[2442],{"type":612,"value":2443},"]",{"type":606,"tag":636,"props":2445,"children":2446},{"style":709},[2447],{"type":612,"value":741},{"type":606,"tag":636,"props":2449,"children":2450},{"style":663},[2451],{"type":612,"value":2452},"***@",{"type":606,"tag":636,"props":2454,"children":2455},{"style":709},[2456],{"type":612,"value":732},{"type":606,"tag":636,"props":2458,"children":2459},{"style":651},[2460],{"type":612,"value":2461},"domain",{"type":606,"tag":636,"props":2463,"children":2464},{"style":709},[2465],{"type":612,"value":741},{"type":606,"tag":636,"props":2467,"children":2468},{"style":663},[2469],{"type":612,"value":2470},"\"\n",{"type":606,"tag":636,"props":2472,"children":2473},{"class":638,"line":163},[2474,2479,2483,2488,2492,2496,2500,2504,2508],{"type":606,"tag":636,"props":2475,"children":2476},{"style":651},[2477],{"type":612,"value":2478},"    cleaned_text ",{"type":606,"tag":636,"props":2480,"children":2481},{"style":657},[2482],{"type":612,"value":660},{"type":606,"tag":636,"props":2484,"children":2485},{"style":651},[2486],{"type":612,"value":2487}," cleaned_text.replace(cleaned_text.split(",{"type":606,"tag":636,"props":2489,"children":2490},{"style":663},[2491],{"type":612,"value":746},{"type":606,"tag":636,"props":2493,"children":2494},{"style":709},[2495],{"type":612,"value":2386},{"type":606,"tag":636,"props":2497,"children":2498},{"style":663},[2499],{"type":612,"value":746},{"type":606,"tag":636,"props":2501,"children":2502},{"style":651},[2503],{"type":612,"value":2351},{"type":606,"tag":636,"props":2505,"children":2506},{"style":709},[2507],{"type":612,"value":1549},{"type":606,"tag":636,"props":2509,"children":2510},{"style":651},[2511],{"type":612,"value":2512},"], masked_email)\n",{"type":606,"tag":636,"props":2514,"children":2515},{"class":638,"line":172},[2516],{"type":606,"tag":636,"props":2517,"children":2518},{"emptyLinePlaceholder":13},[2519],{"type":612,"value":928},{"type":606,"tag":636,"props":2521,"children":2522},{"class":638,"line":181},[2523],{"type":606,"tag":636,"props":2524,"children":2525},{"style":642},[2526],{"type":612,"value":2527},"# Mask phone\n",{"type":606,"tag":636,"props":2529,"children":2530},{"class":638,"line":190},[2531,2536,2540,2544,2549],{"type":606,"tag":636,"props":2532,"children":2533},{"style":651},[2534],{"type":612,"value":2535},"phone_pos ",{"type":606,"tag":636,"props":2537,"children":2538},{"style":657},[2539],{"type":612,"value":660},{"type":606,"tag":636,"props":2541,"children":2542},{"style":651},[2543],{"type":612,"value":2285},{"type":606,"tag":636,"props":2545,"children":2546},{"style":663},[2547],{"type":612,"value":2548},"\"555-\"",{"type":606,"tag":636,"props":2550,"children":2551},{"style":651},[2552],{"type":612,"value":703},{"type":606,"tag":636,"props":2554,"children":2555},{"class":638,"line":199},[2556,2560,2565,2569,2573,2577],{"type":606,"tag":636,"props":2557,"children":2558},{"style":657},[2559],{"type":612,"value":2301},{"type":606,"tag":636,"props":2561,"children":2562},{"style":651},[2563],{"type":612,"value":2564}," phone_pos ",{"type":606,"tag":636,"props":2566,"children":2567},{"style":657},[2568],{"type":612,"value":2311},{"type":606,"tag":636,"props":2570,"children":2571},{"style":657},[2572],{"type":612,"value":2316},{"type":606,"tag":636,"props":2574,"children":2575},{"style":709},[2576],{"type":612,"value":1549},{"type":606,"tag":636,"props":2578,"children":2579},{"style":651},[2580],{"type":612,"value":1194},{"type":606,"tag":636,"props":2582,"children":2583},{"class":638,"line":208},[2584,2589,2593,2598,2602,2606,2610,2614,2618],{"type":606,"tag":636,"props":2585,"children":2586},{"style":651},[2587],{"type":612,"value":2588},"    phone ",{"type":606,"tag":636,"props":2590,"children":2591},{"style":657},[2592],{"type":612,"value":660},{"type":606,"tag":636,"props":2594,"children":2595},{"style":651},[2596],{"type":612,"value":2597}," cleaned_text[phone_pos:].split(",{"type":606,"tag":636,"props":2599,"children":2600},{"style":663},[2601],{"type":612,"value":746},{"type":606,"tag":636,"props":2603,"children":2604},{"style":709},[2605],{"type":612,"value":2386},{"type":606,"tag":636,"props":2607,"children":2608},{"style":663},[2609],{"type":612,"value":746},{"type":606,"tag":636,"props":2611,"children":2612},{"style":651},[2613],{"type":612,"value":2351},{"type":606,"tag":636,"props":2615,"children":2616},{"style":709},[2617],{"type":612,"value":2399},{"type":606,"tag":636,"props":2619,"children":2620},{"style":651},[2621],{"type":612,"value":2360},{"type":606,"tag":636,"props":2623,"children":2624},{"class":638,"line":217},[2625,2630,2634,2638,2643,2647,2652,2657,2662,2667,2671],{"type":606,"tag":636,"props":2626,"children":2627},{"style":651},[2628],{"type":612,"value":2629},"    masked_phone ",{"type":606,"tag":636,"props":2631,"children":2632},{"style":657},[2633],{"type":612,"value":660},{"type":606,"tag":636,"props":2635,"children":2636},{"style":657},[2637],{"type":612,"value":2420},{"type":606,"tag":636,"props":2639,"children":2640},{"style":663},[2641],{"type":612,"value":2642},"\"Phone: ***-***-",{"type":606,"tag":636,"props":2644,"children":2645},{"style":709},[2646],{"type":612,"value":732},{"type":606,"tag":636,"props":2648,"children":2649},{"style":651},[2650],{"type":612,"value":2651},"phone[",{"type":606,"tag":636,"props":2653,"children":2654},{"style":657},[2655],{"type":612,"value":2656},"-",{"type":606,"tag":636,"props":2658,"children":2659},{"style":709},[2660],{"type":612,"value":2661},"4",{"type":606,"tag":636,"props":2663,"children":2664},{"style":651},[2665],{"type":612,"value":2666},":]",{"type":606,"tag":636,"props":2668,"children":2669},{"style":709},[2670],{"type":612,"value":741},{"type":606,"tag":636,"props":2672,"children":2673},{"style":663},[2674],{"type":612,"value":2470},{"type":606,"tag":636,"props":2676,"children":2677},{"class":638,"line":227},[2678,2682,2686,2690,2694,2698,2702,2706,2711],{"type":606,"tag":636,"props":2679,"children":2680},{"style":651},[2681],{"type":612,"value":2478},{"type":606,"tag":636,"props":2683,"children":2684},{"style":657},[2685],{"type":612,"value":660},{"type":606,"tag":636,"props":2687,"children":2688},{"style":651},[2689],{"type":612,"value":2487},{"type":606,"tag":636,"props":2691,"children":2692},{"style":663},[2693],{"type":612,"value":746},{"type":606,"tag":636,"props":2695,"children":2696},{"style":709},[2697],{"type":612,"value":2386},{"type":606,"tag":636,"props":2699,"children":2700},{"style":663},[2701],{"type":612,"value":746},{"type":606,"tag":636,"props":2703,"children":2704},{"style":651},[2705],{"type":612,"value":2351},{"type":606,"tag":636,"props":2707,"children":2708},{"style":709},[2709],{"type":612,"value":2710},"2",{"type":606,"tag":636,"props":2712,"children":2713},{"style":651},[2714],{"type":612,"value":2715},"], masked_phone)\n",{"type":606,"tag":636,"props":2717,"children":2718},{"class":638,"line":236},[2719],{"type":606,"tag":636,"props":2720,"children":2721},{"emptyLinePlaceholder":13},[2722],{"type":612,"value":928},{"type":606,"tag":636,"props":2724,"children":2725},{"class":638,"line":245},[2726],{"type":606,"tag":636,"props":2727,"children":2728},{"style":642},[2729],{"type":612,"value":2730},"# Mask SSN\n",{"type":606,"tag":636,"props":2732,"children":2733},{"class":638,"line":254},[2734,2739,2743,2747,2752],{"type":606,"tag":636,"props":2735,"children":2736},{"style":651},[2737],{"type":612,"value":2738},"ssn_pos ",{"type":606,"tag":636,"props":2740,"children":2741},{"style":657},[2742],{"type":612,"value":660},{"type":606,"tag":636,"props":2744,"children":2745},{"style":651},[2746],{"type":612,"value":2285},{"type":606,"tag":636,"props":2748,"children":2749},{"style":663},[2750],{"type":612,"value":2751},"\"123-45-\"",{"type":606,"tag":636,"props":2753,"children":2754},{"style":651},[2755],{"type":612,"value":703},{"type":606,"tag":636,"props":2757,"children":2758},{"class":638,"line":263},[2759,2763,2768,2772,2776,2780],{"type":606,"tag":636,"props":2760,"children":2761},{"style":657},[2762],{"type":612,"value":2301},{"type":606,"tag":636,"props":2764,"children":2765},{"style":651},[2766],{"type":612,"value":2767}," ssn_pos ",{"type":606,"tag":636,"props":2769,"children":2770},{"style":657},[2771],{"type":612,"value":2311},{"type":606,"tag":636,"props":2773,"children":2774},{"style":657},[2775],{"type":612,"value":2316},{"type":606,"tag":636,"props":2777,"children":2778},{"style":709},[2779],{"type":612,"value":1549},{"type":606,"tag":636,"props":2781,"children":2782},{"style":651},[2783],{"type":612,"value":1194},{"type":606,"tag":636,"props":2785,"children":2786},{"class":638,"line":272},[2787,2792,2796,2801,2805,2809,2813,2817,2821],{"type":606,"tag":636,"props":2788,"children":2789},{"style":651},[2790],{"type":612,"value":2791},"    ssn ",{"type":606,"tag":636,"props":2793,"children":2794},{"style":657},[2795],{"type":612,"value":660},{"type":606,"tag":636,"props":2797,"children":2798},{"style":651},[2799],{"type":612,"value":2800}," cleaned_text[ssn_pos:].split(",{"type":606,"tag":636,"props":2802,"children":2803},{"style":663},[2804],{"type":612,"value":746},{"type":606,"tag":636,"props":2806,"children":2807},{"style":709},[2808],{"type":612,"value":2386},{"type":606,"tag":636,"props":2810,"children":2811},{"style":663},[2812],{"type":612,"value":746},{"type":606,"tag":636,"props":2814,"children":2815},{"style":651},[2816],{"type":612,"value":2351},{"type":606,"tag":636,"props":2818,"children":2819},{"style":709},[2820],{"type":612,"value":2399},{"type":606,"tag":636,"props":2822,"children":2823},{"style":651},[2824],{"type":612,"value":2360},{"type":606,"tag":636,"props":2826,"children":2827},{"class":638,"line":281},[2828,2833,2837,2841,2846,2850,2855,2859,2863,2867,2871],{"type":606,"tag":636,"props":2829,"children":2830},{"style":651},[2831],{"type":612,"value":2832},"    masked_ssn ",{"type":606,"tag":636,"props":2834,"children":2835},{"style":657},[2836],{"type":612,"value":660},{"type":606,"tag":636,"props":2838,"children":2839},{"style":657},[2840],{"type":612,"value":2420},{"type":606,"tag":636,"props":2842,"children":2843},{"style":663},[2844],{"type":612,"value":2845},"\"ID: ***-**-",{"type":606,"tag":636,"props":2847,"children":2848},{"style":709},[2849],{"type":612,"value":732},{"type":606,"tag":636,"props":2851,"children":2852},{"style":651},[2853],{"type":612,"value":2854},"ssn[",{"type":606,"tag":636,"props":2856,"children":2857},{"style":657},[2858],{"type":612,"value":2656},{"type":606,"tag":636,"props":2860,"children":2861},{"style":709},[2862],{"type":612,"value":2661},{"type":606,"tag":636,"props":2864,"children":2865},{"style":651},[2866],{"type":612,"value":2666},{"type":606,"tag":636,"props":2868,"children":2869},{"style":709},[2870],{"type":612,"value":741},{"type":606,"tag":636,"props":2872,"children":2873},{"style":663},[2874],{"type":612,"value":2470},{"type":606,"tag":636,"props":2876,"children":2877},{"class":638,"line":291},[2878,2882,2886,2890,2894,2898,2902,2906,2911],{"type":606,"tag":636,"props":2879,"children":2880},{"style":651},[2881],{"type":612,"value":2478},{"type":606,"tag":636,"props":2883,"children":2884},{"style":657},[2885],{"type":612,"value":660},{"type":606,"tag":636,"props":2887,"children":2888},{"style":651},[2889],{"type":612,"value":2487},{"type":606,"tag":636,"props":2891,"children":2892},{"style":663},[2893],{"type":612,"value":746},{"type":606,"tag":636,"props":2895,"children":2896},{"style":709},[2897],{"type":612,"value":2386},{"type":606,"tag":636,"props":2899,"children":2900},{"style":663},[2901],{"type":612,"value":746},{"type":606,"tag":636,"props":2903,"children":2904},{"style":651},[2905],{"type":612,"value":2351},{"type":606,"tag":636,"props":2907,"children":2908},{"style":709},[2909],{"type":612,"value":2910},"3",{"type":606,"tag":636,"props":2912,"children":2913},{"style":651},[2914],{"type":612,"value":2915},"], masked_ssn)\n",{"type":606,"tag":636,"props":2917,"children":2918},{"class":638,"line":302},[2919],{"type":606,"tag":636,"props":2920,"children":2921},{"emptyLinePlaceholder":13},[2922],{"type":612,"value":928},{"type":606,"tag":636,"props":2924,"children":2925},{"class":638,"line":311},[2926,2930,2934,2938],{"type":606,"tag":636,"props":2927,"children":2928},{"style":709},[2929],{"type":612,"value":712},{"type":606,"tag":636,"props":2931,"children":2932},{"style":651},[2933],{"type":612,"value":717},{"type":606,"tag":636,"props":2935,"children":2936},{"style":663},[2937],{"type":612,"value":2126},{"type":606,"tag":636,"props":2939,"children":2940},{"style":651},[2941],{"type":612,"value":703},{"type":606,"tag":636,"props":2943,"children":2944},{"class":638,"line":320},[2945,2949],{"type":606,"tag":636,"props":2946,"children":2947},{"style":709},[2948],{"type":612,"value":712},{"type":606,"tag":636,"props":2950,"children":2951},{"style":651},[2952],{"type":612,"value":2142},{"type":606,"tag":615,"props":2954,"children":2955},{},[2956],{"type":606,"tag":815,"props":2957,"children":2958},{},[2959],{"type":612,"value":2960},"Key Learning Points:",{"type":606,"tag":821,"props":2962,"children":2963},{},[2964,2976,2981,2992],{"type":606,"tag":825,"props":2965,"children":2966},{},[2967,2969,2974],{"type":612,"value":2968},"📌 Used ",{"type":606,"tag":632,"props":2970,"children":2972},{"className":2971},[],[2973],{"type":612,"value":833},{"type":612,"value":2975}," to locate sensitive information",{"type":606,"tag":825,"props":2977,"children":2978},{},[2979],{"type":612,"value":2980},"📌 Used string slicing to preserve parts of the data",{"type":606,"tag":825,"props":2982,"children":2983},{},[2984,2985,2990],{"type":612,"value":2968},{"type":606,"tag":632,"props":2986,"children":2988},{"className":2987},[],[2989],{"type":612,"value":1275},{"type":612,"value":2991}," to update the text",{"type":606,"tag":825,"props":2993,"children":2994},{},[2995],{"type":612,"value":2996},"📌 Handled multiple types of sensitive data",{"type":606,"tag":793,"props":2998,"children":3000},{"id":2999},"key-takeaways",[3001],{"type":612,"value":3002},"🎯 Key Takeaways",{"type":606,"tag":805,"props":3004,"children":3008},{"emoji":3005,"title":3006,"type":3007},"📚","Text Finding and Replacement Essentials","success",[3009,3017,3060,3068,3112],{"type":606,"tag":615,"props":3010,"children":3011},{},[3012],{"type":606,"tag":815,"props":3013,"children":3014},{},[3015],{"type":612,"value":3016},"Finding Methods:",{"type":606,"tag":821,"props":3018,"children":3019},{},[3020,3030,3040,3050],{"type":606,"tag":825,"props":3021,"children":3022},{},[3023,3028],{"type":606,"tag":632,"props":3024,"children":3026},{"className":3025},[],[3027],{"type":612,"value":833},{"type":612,"value":3029}," for first occurrence",{"type":606,"tag":825,"props":3031,"children":3032},{},[3033,3038],{"type":606,"tag":632,"props":3034,"children":3036},{"className":3035},[],[3037],{"type":612,"value":844},{"type":612,"value":3039}," for last occurrence",{"type":606,"tag":825,"props":3041,"children":3042},{},[3043,3048],{"type":606,"tag":632,"props":3044,"children":3046},{"className":3045},[],[3047],{"type":612,"value":877},{"type":612,"value":3049}," for counting occurrences",{"type":606,"tag":825,"props":3051,"children":3052},{},[3053,3058],{"type":606,"tag":632,"props":3054,"children":3056},{"className":3055},[],[3057],{"type":612,"value":855},{"type":612,"value":3059}," when you need errors for missing text",{"type":606,"tag":615,"props":3061,"children":3062},{},[3063],{"type":606,"tag":815,"props":3064,"children":3065},{},[3066],{"type":612,"value":3067},"Replacement Tips:",{"type":606,"tag":821,"props":3069,"children":3070},{},[3071,3083,3095,3107],{"type":606,"tag":825,"props":3072,"children":3073},{},[3074,3076,3081],{"type":612,"value":3075},"Use ",{"type":606,"tag":632,"props":3077,"children":3079},{"className":3078},[],[3080],{"type":612,"value":1275},{"type":612,"value":3082}," for simple replacements",{"type":606,"tag":825,"props":3084,"children":3085},{},[3086,3088,3093],{"type":612,"value":3087},"Chain multiple ",{"type":606,"tag":632,"props":3089,"children":3091},{"className":3090},[],[3092],{"type":612,"value":1275},{"type":612,"value":3094}," calls for complex changes",{"type":606,"tag":825,"props":3096,"children":3097},{},[3098,3100,3105],{"type":612,"value":3099},"Use the ",{"type":606,"tag":632,"props":3101,"children":3103},{"className":3102},[],[3104],{"type":612,"value":1153},{"type":612,"value":3106}," parameter to limit replacements",{"type":606,"tag":825,"props":3108,"children":3109},{},[3110],{"type":612,"value":3111},"Consider regex for complex patterns",{"type":606,"tag":615,"props":3113,"children":3114},{},[3115,3120],{"type":606,"tag":815,"props":3116,"children":3117},{},[3118],{"type":612,"value":3119},"Remember:",{"type":612,"value":3121}," Always handle cases where text isn't found!",{"type":606,"tag":3123,"props":3124,"children":3125},"style",{},[3126],{"type":612,"value":3127},"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":3129},[3130,3133,3134,3135,3138],{"id":795,"depth":27,"text":798,"children":3131},[3132],{"id":883,"depth":36,"text":886},{"id":1261,"depth":27,"text":1264},{"id":1602,"depth":27,"text":1605},{"id":1968,"depth":27,"text":1971,"children":3136},[3137],{"id":2145,"depth":36,"text":2148},{"id":2999,"depth":27,"text":3002},1782373759532]