[{"data":1,"prerenderedAt":2904},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/list-comprehensions":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},"/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},"/python-how-to/dictionary-operations","Dictionary Operations","Learn essential operations for working with dictionaries in Python","dictionary-operations",16,"content:python-how-to:16.dictionary-operations.md","python-how-to/16.dictionary-operations.md","python-how-to/16.dictionary-operations",[158,167,176,185,194,203],{"_path":159,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":160,"description":161,"slug":162,"parentId":149,"order":163,"_type":15,"_id":164,"_source":17,"_file":165,"_stem":166,"_extension":20},"/python-how-to/merge-dictionaries","Merge Dictionaries","Learn different methods to merge dictionaries in Python","merge-dictionaries",17,"content:python-how-to:17.merge-dictionaries.md","python-how-to/17.merge-dictionaries.md","python-how-to/17.merge-dictionaries",{"_path":168,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":169,"description":170,"slug":171,"parentId":149,"order":172,"_type":15,"_id":173,"_source":17,"_file":174,"_stem":175,"_extension":20},"/python-how-to/sort-dictionaries","Sort Dictionaries","Learn how to sort dictionaries by keys or values in Python","sort-dictionaries",18,"content:python-how-to:18.sort-dictionaries.md","python-how-to/18.sort-dictionaries.md","python-how-to/18.sort-dictionaries",{"_path":177,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":178,"description":179,"slug":180,"parentId":149,"order":181,"_type":15,"_id":182,"_source":17,"_file":183,"_stem":184,"_extension":20},"/python-how-to/filter-dictionaries","Filter Dictionaries","Learn how to filter dictionaries based on keys or values in Python","filter-dictionaries",19,"content:python-how-to:19.filter-dictionaries.md","python-how-to/19.filter-dictionaries.md","python-how-to/19.filter-dictionaries",{"_path":186,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":187,"description":188,"slug":189,"parentId":149,"order":190,"_type":15,"_id":191,"_source":17,"_file":192,"_stem":193,"_extension":20},"/python-how-to/handle-missing-keys","Handle Missing Keys","Learn safe ways to access dictionary keys and handle missing values","handle-missing-keys",20,"content:python-how-to:20.handle-missing-keys.md","python-how-to/20.handle-missing-keys.md","python-how-to/20.handle-missing-keys",{"_path":195,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":196,"description":197,"slug":198,"parentId":149,"order":199,"_type":15,"_id":200,"_source":17,"_file":201,"_stem":202,"_extension":20},"/python-how-to/dictionary-comprehensions","Use Dictionary Comprehensions","Learn how to create dictionaries efficiently using comprehensions","dictionary-comprehensions",21,"content:python-how-to:21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions",{"_path":204,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":205,"description":206,"slug":207,"parentId":149,"order":208,"_type":15,"_id":209,"_source":17,"_file":210,"_stem":211,"_extension":20},"/python-how-to/convert-lists-dictionaries","Convert Between Lists and Dictionaries","Learn how to transform data between lists and dictionaries in Python","convert-lists-dictionaries",22,"content:python-how-to:22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries",{"_path":213,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":214,"description":215,"slug":216,"order":217,"isParent":13,"icon":14,"_type":15,"_id":218,"_source":17,"_file":219,"_stem":220,"_extension":20,"children":221},"/python-how-to/file-operations","File Operations","Learn essential file operations in Python for reading, writing, and managing files","file-operations",23,"content:python-how-to:23.file-operations.md","python-how-to/23.file-operations.md","python-how-to/23.file-operations",[222,231,240,249,258,267,276],{"_path":223,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":224,"description":225,"slug":226,"parentId":213,"order":227,"_type":15,"_id":228,"_source":17,"_file":229,"_stem":230,"_extension":20},"/python-how-to/read-text-files","Read Text Files","Learn how to read text files in Python using different methods","read-text-files",24,"content:python-how-to:24.read-text-files.md","python-how-to/24.read-text-files.md","python-how-to/24.read-text-files",{"_path":232,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":233,"description":234,"slug":235,"parentId":213,"order":236,"_type":15,"_id":237,"_source":17,"_file":238,"_stem":239,"_extension":20},"/python-how-to/write-to-files","Write to Files","Learn how to write and create files in Python using different methods","write-to-files",25,"content:python-how-to:25.write-to-files.md","python-how-to/25.write-to-files.md","python-how-to/25.write-to-files",{"_path":241,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":242,"description":243,"slug":244,"parentId":213,"order":245,"_type":15,"_id":246,"_source":17,"_file":247,"_stem":248,"_extension":20},"/python-how-to/work-csv-files","Work with CSV Files","Learn how to read and write CSV files in Python using the csv module","work-csv-files",26,"content:python-how-to:26.work-csv-files.md","python-how-to/26.work-csv-files.md","python-how-to/26.work-csv-files",{"_path":250,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":251,"description":252,"slug":253,"parentId":213,"order":254,"_type":15,"_id":255,"_source":17,"_file":256,"_stem":257,"_extension":20},"/python-how-to/handle-file-paths","Handle File Paths","Learn how to work with file and directory paths in Python using pathlib and os modules","handle-file-paths",27,"content:python-how-to:27.handle-file-paths.md","python-how-to/27.handle-file-paths.md","python-how-to/27.handle-file-paths",{"_path":259,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":260,"description":261,"slug":262,"parentId":213,"order":263,"_type":15,"_id":264,"_source":17,"_file":265,"_stem":266,"_extension":20},"/python-how-to/work-json-files","Work with JSON Files","Learn how to read and write JSON files in Python using the json module","work-json-files",28,"content:python-how-to:28.work-json-files.md","python-how-to/28.work-json-files.md","python-how-to/28.work-json-files",{"_path":268,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":269,"description":270,"slug":271,"parentId":213,"order":272,"_type":15,"_id":273,"_source":17,"_file":274,"_stem":275,"_extension":20},"/python-how-to/handle-binary-files","Handle Binary Files","Learn how to work with binary files in Python for images, data, and other non-text content","handle-binary-files",29,"content:python-how-to:29.handle-binary-files.md","python-how-to/29.handle-binary-files.md","python-how-to/29.handle-binary-files",{"_path":277,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":278,"description":279,"slug":280,"parentId":213,"order":281,"_type":15,"_id":282,"_source":17,"_file":283,"_stem":284,"_extension":20},"/python-how-to/use-context-managers","Use Context Managers","Learn how to use context managers for safe resource handling in Python","use-context-managers",30,"content:python-how-to:30.use-context-managers.md","python-how-to/30.use-context-managers.md","python-how-to/30.use-context-managers",{"_path":286,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":287,"description":288,"slug":289,"parentId":290,"order":291,"isParent":13,"icon":292,"_type":15,"_id":293,"_source":17,"_file":294,"_stem":295,"_extension":20,"children":296},"/python-how-to/date-and-time","Date and Time","Master Python's date and time handling with datetime, time zones, formatting, and calculations","date-and-time","/python-how-to",31,"pi pi-calendar","content:python-how-to:31.date-and-time.md","python-how-to/31.date-and-time.md","python-how-to/31.date-and-time",[297,306,315,324,333,342],{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":286,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python-how-to/get-current-datetime","Get Current Date/Time","Learn how to get current date, time, and timestamps using Python's datetime module","get-current-datetime",32,"content:python-how-to:32.get-current-datetime.md","python-how-to/32.get-current-datetime.md","python-how-to/32.get-current-datetime",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":286,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python-how-to/format-dates","Format Dates","Master date formatting with strftime, custom formats, and locale-aware formatting for user-friendly displays","format-dates",33,"content:python-how-to:33.format-dates.md","python-how-to/33.format-dates.md","python-how-to/33.format-dates",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python-how-to/calculate-date-differences","Calculate Date Differences","Learn to calculate time differences, durations, and intervals using Python's timedelta for scheduling and analytics","calculate-date-differences",34,"content:python-how-to:34.calculate-date-differences.md","python-how-to/34.calculate-date-differences.md","python-how-to/34.calculate-date-differences",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python-how-to/parse-date-strings","Parse Date Strings","Convert text dates into Python datetime objects using strptime, handle multiple formats, and validate date input","parse-date-strings",35,"content:python-how-to:35.parse-date-strings.md","python-how-to/35.parse-date-strings.md","python-how-to/35.parse-date-strings",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":286,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python-how-to/handle-timezones","Handle Timezones","Master timezone handling with zoneinfo, UTC conversions, and timezone-aware datetime objects for global applications","handle-timezones",36,"content:python-how-to:36.handle-timezones.md","python-how-to/36.handle-timezones.md","python-how-to/36.handle-timezones",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python-how-to/work-with-timestamps","Work with Timestamps","Master Unix timestamps in Python - convert between datetime objects and timestamps for APIs, databases, and system integration","work-with-timestamps",37,"content:python-how-to:37.work-with-timestamps.md","python-how-to/37.work-with-timestamps.md","python-how-to/37.work-with-timestamps",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":290,"order":356,"isParent":13,"icon":357,"_type":15,"_id":358,"_source":17,"_file":359,"_stem":360,"_extension":20,"children":361},"/python-how-to/error-handling","Error Handling","Learn Python's error handling with try/except, custom exceptions, debugging, logging, and retry logic for robust applications","error-handling",38,"pi pi-exclamation-triangle","content:python-how-to:38.error-handling.md","python-how-to/38.error-handling.md","python-how-to/38.error-handling",[362,371,380,389,398],{"_path":363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":364,"description":365,"slug":366,"parentId":352,"order":367,"_type":15,"_id":368,"_source":17,"_file":369,"_stem":370,"_extension":20},"/python-how-to/handle-exceptions","Handle Exceptions","Master try/except blocks, multiple exception handling, and finally clauses for robust error handling in Python","handle-exceptions",39,"content:python-how-to:39.handle-exceptions.md","python-how-to/39.handle-exceptions.md","python-how-to/39.handle-exceptions",{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},"/python-how-to/create-custom-exceptions","Create Custom Exceptions","Learn to create custom exception classes in Python for specific error handling and better code organization","create-custom-exceptions",40,"content:python-how-to:40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions",{"_path":381,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":382,"description":383,"slug":384,"parentId":352,"order":385,"_type":15,"_id":386,"_source":17,"_file":387,"_stem":388,"_extension":20},"/python-how-to/debug-code","Debug Code","Learn Python debugging techniques using print statements, the debugger, and tools to find and fix code issues","debug-code",41,"content:python-how-to:41.debug-code.md","python-how-to/41.debug-code.md","python-how-to/41.debug-code",{"_path":390,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":391,"description":392,"slug":393,"parentId":352,"order":394,"_type":15,"_id":395,"_source":17,"_file":396,"_stem":397,"_extension":20},"/python-how-to/use-logging","Use Logging","Learn Python's logging module for tracking application behavior, errors, and debugging information","use-logging",42,"content:python-how-to:42.use-logging.md","python-how-to/42.use-logging.md","python-how-to/42.use-logging",{"_path":399,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":400,"description":401,"slug":402,"parentId":352,"order":403,"_type":15,"_id":404,"_source":17,"_file":405,"_stem":406,"_extension":20},"/python-how-to/implement-retry-logic","Implement Retry Logic","Learn to implement retry mechanisms in Python for handling temporary failures and building resilient applications","implement-retry-logic",43,"content:python-how-to:43.implement-retry-logic.md","python-how-to/43.implement-retry-logic.md","python-how-to/43.implement-retry-logic",{"_path":408,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":409,"description":410,"slug":411,"parentId":290,"order":412,"isParent":13,"icon":413,"_type":15,"_id":414,"_source":17,"_file":415,"_stem":416,"_extension":20,"children":417},"/python-how-to/functions-and-modules","Functions and Modules","Learn Python functions, modules, and code organization for building reusable, maintainable applications","functions-and-modules",44,"pi pi-box","content:python-how-to:44.functions-and-modules.md","python-how-to/44.functions-and-modules.md","python-how-to/44.functions-and-modules",[418,427,436,445,454,463],{"_path":419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":420,"description":421,"slug":422,"parentId":408,"order":423,"_type":15,"_id":424,"_source":17,"_file":425,"_stem":426,"_extension":20},"/python-how-to/write-functions","Write Functions","Learn to create Python functions with parameters, return values, and documentation for reusable code","write-functions",45,"content:python-how-to:45.write-functions.md","python-how-to/45.write-functions.md","python-how-to/45.write-functions",{"_path":428,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":429,"description":430,"slug":431,"parentId":408,"order":432,"_type":15,"_id":433,"_source":17,"_file":434,"_stem":435,"_extension":20},"/python-how-to/use-args-kwargs","Use *args and **kwargs","Learn to use *args and **kwargs for flexible function arguments in Python","use-args-kwargs",46,"content:python-how-to:46.use-args-kwargs.md","python-how-to/46.use-args-kwargs.md","python-how-to/46.use-args-kwargs",{"_path":437,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":438,"description":439,"slug":440,"parentId":408,"order":441,"_type":15,"_id":442,"_source":17,"_file":443,"_stem":444,"_extension":20},"/python-how-to/create-decorators","Create Decorators","Learn to create and use Python decorators to enhance function behavior and add functionality","create-decorators",47,"content:python-how-to:47.create-decorators.md","python-how-to/47.create-decorators.md","python-how-to/47.create-decorators",{"_path":446,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":447,"description":448,"slug":449,"parentId":408,"order":450,"_type":15,"_id":451,"_source":17,"_file":452,"_stem":453,"_extension":20},"/python-how-to/use-generators","Use Generators","Learn to create memory-efficient generators with yield for processing large datasets and sequences","use-generators",48,"content:python-how-to:48.use-generators.md","python-how-to/48.use-generators.md","python-how-to/48.use-generators",{"_path":455,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":456,"description":457,"slug":458,"parentId":408,"order":459,"_type":15,"_id":460,"_source":17,"_file":461,"_stem":462,"_extension":20},"/python-how-to/work-modules-packages","Work with Modules and Packages","Learn to organize Python code with modules and packages, and use imports effectively","work-modules-packages",49,"content:python-how-to:49.work-modules-packages.md","python-how-to/49.work-modules-packages.md","python-how-to/49.work-modules-packages",{"_path":464,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":465,"description":466,"slug":467,"parentId":408,"order":468,"_type":15,"_id":469,"_source":17,"_file":470,"_stem":471,"_extension":20},"/python-how-to/create-virtual-environments","Create Virtual Environments","Learn to create and manage Python virtual environments for project dependency isolation","create-virtual-environments",50,"content:python-how-to:50.create-virtual-environments.md","python-how-to/50.create-virtual-environments.md","python-how-to/50.create-virtual-environments",{"_path":473,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":474,"description":475,"slug":476,"parentId":290,"order":477,"isParent":13,"icon":478,"_type":15,"_id":479,"_source":17,"_file":480,"_stem":481,"_extension":20,"children":482},"/python-how-to/data-processing","Data Processing","Learn Python data processing techniques including regex, APIs, databases, and large file handling","data-processing",51,"pi pi-database","content:python-how-to:51.data-processing.md","python-how-to/51.data-processing.md","python-how-to/51.data-processing",[483,492,501,510,519],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},"/python-how-to/work-regular-expressions","Work with Regular Expressions","Learn to use Python's re module for pattern matching, text extraction, and data validation","work-regular-expressions",52,"content:python-how-to:52.work-regular-expressions.md","python-how-to/52.work-regular-expressions.md","python-how-to/52.work-regular-expressions",{"_path":493,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":494,"description":495,"slug":496,"parentId":473,"order":497,"_type":15,"_id":498,"_source":17,"_file":499,"_stem":500,"_extension":20},"/python-how-to/parse-xml-html","Parse XML and HTML","Learn to extract data from XML and HTML documents using Python's built-in parsing tools","parse-xml-html",53,"content:python-how-to:53.parse-xml-html.md","python-how-to/53.parse-xml-html.md","python-how-to/53.parse-xml-html",{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},"/python-how-to/handle-api-requests","Handle API Requests","Learn to fetch and process data from web APIs using Python's urllib and external requests library","handle-api-requests",54,"content:python-how-to:54.handle-api-requests.md","python-how-to/54.handle-api-requests.md","python-how-to/54.handle-api-requests",{"_path":511,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":512,"description":513,"slug":514,"parentId":473,"order":515,"_type":15,"_id":516,"_source":17,"_file":517,"_stem":518,"_extension":20},"/python-how-to/work-databases","Work with Databases","Learn to connect to and query SQL databases using Python's sqlite3 and database techniques","work-databases",55,"content:python-how-to:55.work-databases.md","python-how-to/55.work-databases.md","python-how-to/55.work-databases",{"_path":520,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":521,"description":522,"slug":523,"parentId":473,"order":524,"_type":15,"_id":525,"_source":17,"_file":526,"_stem":527,"_extension":20},"/python-how-to/process-large-files","Process Large Files","Learn memory-efficient techniques for handling large files and datasets in Python","process-large-files",56,"content:python-how-to:56.process-large-files.md","python-how-to/56.process-large-files.md","python-how-to/56.process-large-files",{"_path":529,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":530,"description":531,"slug":532,"parentId":290,"order":533,"isParent":13,"icon":534,"_type":15,"_id":535,"_source":17,"_file":536,"_stem":537,"_extension":20,"children":538},"/python-how-to/best-practices","Best Practices","Learn Python best practices for writing clean, maintainable, and efficient code","best-practices",57,"pi pi-star","content:python-how-to:57.best-practices.md","python-how-to/57.best-practices.md","python-how-to/57.best-practices",[539,548,557,566,575,584],{"_path":540,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":541,"description":542,"slug":543,"parentId":529,"order":544,"_type":15,"_id":545,"_source":17,"_file":546,"_stem":547,"_extension":20},"/python-how-to/structure-code","Structure Your Code","Learn to organize Python code with proper module structure, functions, and classes","structure-code",58,"content:python-how-to:58.structure-code.md","python-how-to/58.structure-code.md","python-how-to/58.structure-code",{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},"/python-how-to/write-clean-code","Write Clean Code","Learn to write readable, maintainable Python code with proper naming, comments, and clear logic","write-clean-code",59,"content:python-how-to:59.write-clean-code.md","python-how-to/59.write-clean-code.md","python-how-to/59.write-clean-code",{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},"/python-how-to/optimize-performance","Optimize Performance","Learn to identify and fix performance bottlenecks in Python code for faster execution","optimize-performance",60,"content:python-how-to:60.optimize-performance.md","python-how-to/60.optimize-performance.md","python-how-to/60.optimize-performance",{"_path":567,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":568,"description":569,"slug":570,"parentId":529,"order":571,"_type":15,"_id":572,"_source":17,"_file":573,"_stem":574,"_extension":20},"/python-how-to/write-unit-tests","Write Unit Tests","Learn to create reliable unit tests to verify your Python code works correctly and catch bugs early","write-unit-tests",61,"content:python-how-to:61.write-unit-tests.md","python-how-to/61.write-unit-tests.md","python-how-to/61.write-unit-tests",{"_path":576,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":577,"description":578,"slug":579,"parentId":529,"order":580,"_type":15,"_id":581,"_source":17,"_file":582,"_stem":583,"_extension":20},"/python-how-to/document-code","Document Your Code","Learn to write clear documentation and helpful comments for your Python code","document-code",62,"content:python-how-to:62.document-code.md","python-how-to/62.document-code.md","python-how-to/62.document-code",{"_path":585,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":586,"description":587,"slug":588,"parentId":529,"order":589,"_type":15,"_id":590,"_source":17,"_file":591,"_stem":592,"_extension":20},"/python-how-to/use-type-hints","Use Type Hints","Learn to add type annotations to Python code for better clarity, tooling support, and error detection","use-type-hints",63,"content:python-how-to:63.use-type-hints.md","python-how-to/63.use-type-hints.md","python-how-to/63.use-type-hints",{"_path":290,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":594,"description":595,"slug":6,"order":596,"icon":14,"_type":15,"_id":597,"_source":17,"_file":598,"_stem":599,"_extension":20},"Python How-To Guide","Practical Python tutorials for common programming tasks. Learn step-by-step solutions for string manipulation, file operations, data processing, and more with real-world examples.",0,"content:python-how-to:index.md","python-how-to/index.md","python-how-to/index",[121],{"_path":122,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":123,"description":124,"slug":125,"parentId":77,"order":126,"body":602,"_type":15,"_id":127,"_source":17,"_file":128,"_stem":129,"_extension":20},{"type":603,"children":604,"toc":2891},"root",[605,613,619,857,864,883,976,983,1424,1430,1435,1500,1506,1979,1985,1990,2371,2377,2382,2550,2556,2807,2813,2885],{"type":606,"tag":607,"props":608,"children":609},"element","h1",{"id":125},[610],{"type":611,"value":612},"text","🎯 List Comprehensions",{"type":606,"tag":614,"props":615,"children":616},"p",{},[617],{"type":611,"value":618},"List comprehensions are a concise and elegant way to create lists in Python. They combine the power of loops and conditional statements into a single line, making your code more readable and efficient.",{"type":606,"tag":620,"props":621,"children":622},"code-try",{},[623],{"type":606,"tag":624,"props":625,"children":629},"pre",{"className":626,"code":627,"language":628,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Basic list comprehension\nnumbers = [1, 2, 3, 4, 5]\nsquares = [n * n for n in numbers]\n\nprint(f\"Numbers: {numbers}\")\nprint(f\"Squares: {squares}\")\n","python",[630],{"type":606,"tag":631,"props":632,"children":633},"code",{"__ignoreMap":8},[634,645,713,759,767,816],{"type":606,"tag":635,"props":636,"children":638},"span",{"class":637,"line":12},"line",[639],{"type":606,"tag":635,"props":640,"children":642},{"style":641},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[643],{"type":611,"value":644},"# Basic list comprehension\n",{"type":606,"tag":635,"props":646,"children":647},{"class":637,"line":27},[648,654,660,665,671,676,681,685,690,694,699,703,708],{"type":606,"tag":635,"props":649,"children":651},{"style":650},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[652],{"type":611,"value":653},"numbers ",{"type":606,"tag":635,"props":655,"children":657},{"style":656},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[658],{"type":611,"value":659},"=",{"type":606,"tag":635,"props":661,"children":662},{"style":650},[663],{"type":611,"value":664}," [",{"type":606,"tag":635,"props":666,"children":668},{"style":667},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[669],{"type":611,"value":670},"1",{"type":606,"tag":635,"props":672,"children":673},{"style":650},[674],{"type":611,"value":675},", ",{"type":606,"tag":635,"props":677,"children":678},{"style":667},[679],{"type":611,"value":680},"2",{"type":606,"tag":635,"props":682,"children":683},{"style":650},[684],{"type":611,"value":675},{"type":606,"tag":635,"props":686,"children":687},{"style":667},[688],{"type":611,"value":689},"3",{"type":606,"tag":635,"props":691,"children":692},{"style":650},[693],{"type":611,"value":675},{"type":606,"tag":635,"props":695,"children":696},{"style":667},[697],{"type":611,"value":698},"4",{"type":606,"tag":635,"props":700,"children":701},{"style":650},[702],{"type":611,"value":675},{"type":606,"tag":635,"props":704,"children":705},{"style":667},[706],{"type":611,"value":707},"5",{"type":606,"tag":635,"props":709,"children":710},{"style":650},[711],{"type":611,"value":712},"]\n",{"type":606,"tag":635,"props":714,"children":715},{"class":637,"line":36},[716,721,725,730,735,740,745,749,754],{"type":606,"tag":635,"props":717,"children":718},{"style":650},[719],{"type":611,"value":720},"squares ",{"type":606,"tag":635,"props":722,"children":723},{"style":656},[724],{"type":611,"value":659},{"type":606,"tag":635,"props":726,"children":727},{"style":650},[728],{"type":611,"value":729}," [n ",{"type":606,"tag":635,"props":731,"children":732},{"style":656},[733],{"type":611,"value":734},"*",{"type":606,"tag":635,"props":736,"children":737},{"style":650},[738],{"type":611,"value":739}," n ",{"type":606,"tag":635,"props":741,"children":742},{"style":656},[743],{"type":611,"value":744},"for",{"type":606,"tag":635,"props":746,"children":747},{"style":650},[748],{"type":611,"value":739},{"type":606,"tag":635,"props":750,"children":751},{"style":656},[752],{"type":611,"value":753},"in",{"type":606,"tag":635,"props":755,"children":756},{"style":650},[757],{"type":611,"value":758}," numbers]\n",{"type":606,"tag":635,"props":760,"children":761},{"class":637,"line":45},[762],{"type":606,"tag":635,"props":763,"children":764},{"emptyLinePlaceholder":13},[765],{"type":611,"value":766},"\n",{"type":606,"tag":635,"props":768,"children":769},{"class":637,"line":54},[770,775,780,785,791,796,801,806,811],{"type":606,"tag":635,"props":771,"children":772},{"style":667},[773],{"type":611,"value":774},"print",{"type":606,"tag":635,"props":776,"children":777},{"style":650},[778],{"type":611,"value":779},"(",{"type":606,"tag":635,"props":781,"children":782},{"style":656},[783],{"type":611,"value":784},"f",{"type":606,"tag":635,"props":786,"children":788},{"style":787},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[789],{"type":611,"value":790},"\"Numbers: ",{"type":606,"tag":635,"props":792,"children":793},{"style":667},[794],{"type":611,"value":795},"{",{"type":606,"tag":635,"props":797,"children":798},{"style":650},[799],{"type":611,"value":800},"numbers",{"type":606,"tag":635,"props":802,"children":803},{"style":667},[804],{"type":611,"value":805},"}",{"type":606,"tag":635,"props":807,"children":808},{"style":787},[809],{"type":611,"value":810},"\"",{"type":606,"tag":635,"props":812,"children":813},{"style":650},[814],{"type":611,"value":815},")\n",{"type":606,"tag":635,"props":817,"children":818},{"class":637,"line":63},[819,823,827,831,836,840,845,849,853],{"type":606,"tag":635,"props":820,"children":821},{"style":667},[822],{"type":611,"value":774},{"type":606,"tag":635,"props":824,"children":825},{"style":650},[826],{"type":611,"value":779},{"type":606,"tag":635,"props":828,"children":829},{"style":656},[830],{"type":611,"value":784},{"type":606,"tag":635,"props":832,"children":833},{"style":787},[834],{"type":611,"value":835},"\"Squares: ",{"type":606,"tag":635,"props":837,"children":838},{"style":667},[839],{"type":611,"value":795},{"type":606,"tag":635,"props":841,"children":842},{"style":650},[843],{"type":611,"value":844},"squares",{"type":606,"tag":635,"props":846,"children":847},{"style":667},[848],{"type":611,"value":805},{"type":606,"tag":635,"props":850,"children":851},{"style":787},[852],{"type":611,"value":810},{"type":606,"tag":635,"props":854,"children":855},{"style":650},[856],{"type":611,"value":815},{"type":606,"tag":858,"props":859,"children":861},"h2",{"id":860},"basic-list-comprehension",[862],{"type":611,"value":863},"🎨 Basic List Comprehension",{"type":606,"tag":614,"props":865,"children":866},{},[867,869,874,876,881],{"type":611,"value":868},"A list comprehension consists of an expression followed by a ",{"type":606,"tag":631,"props":870,"children":872},{"className":871},[],[873],{"type":611,"value":744},{"type":611,"value":875}," clause. It's like a compact ",{"type":606,"tag":631,"props":877,"children":879},{"className":878},[],[880],{"type":611,"value":744},{"type":611,"value":882}," loop that creates a new list.",{"type":606,"tag":884,"props":885,"children":889},"info-box",{"emoji":886,"title":887,"type":888},"📝","List Comprehension Syntax","info",[890,907,915,953],{"type":606,"tag":614,"props":891,"children":892},{},[893,899,901],{"type":606,"tag":894,"props":895,"children":896},"strong",{},[897],{"type":611,"value":898},"Basic Format:",{"type":611,"value":900}," ",{"type":606,"tag":631,"props":902,"children":904},{"className":903},[],[905],{"type":611,"value":906},"[expression for item in iterable]",{"type":606,"tag":614,"props":908,"children":909},{},[910],{"type":606,"tag":894,"props":911,"children":912},{},[913],{"type":611,"value":914},"Components:",{"type":606,"tag":916,"props":917,"children":918},"ul",{},[919,931,942],{"type":606,"tag":920,"props":921,"children":922},"li",{},[923,929],{"type":606,"tag":631,"props":924,"children":926},{"className":925},[],[927],{"type":611,"value":928},"expression",{"type":611,"value":930},": What to do with each item",{"type":606,"tag":920,"props":932,"children":933},{},[934,940],{"type":606,"tag":631,"props":935,"children":937},{"className":936},[],[938],{"type":611,"value":939},"item",{"type":611,"value":941},": Variable name for each element",{"type":606,"tag":920,"props":943,"children":944},{},[945,951],{"type":606,"tag":631,"props":946,"children":948},{"className":947},[],[949],{"type":611,"value":950},"iterable",{"type":611,"value":952},": List, string, or other sequence",{"type":606,"tag":614,"props":954,"children":955},{},[956,961,962,968,970],{"type":606,"tag":894,"props":957,"children":958},{},[959],{"type":611,"value":960},"Example:",{"type":611,"value":900},{"type":606,"tag":631,"props":963,"children":965},{"className":964},[],[966],{"type":611,"value":967},"[x * 2 for x in [1, 2, 3]]",{"type":611,"value":969}," → ",{"type":606,"tag":631,"props":971,"children":973},{"className":972},[],[974],{"type":611,"value":975},"[2, 4, 6]",{"type":606,"tag":977,"props":978,"children":980},"h3",{"id":979},"simple-examples",[981],{"type":611,"value":982},"Simple Examples",{"type":606,"tag":620,"props":984,"children":985},{},[986],{"type":606,"tag":624,"props":987,"children":989},{"className":626,"code":988,"language":628,"meta":8,"style":8},"# Different ways to use list comprehensions\n# 1. Double numbers\nnumbers = [1, 2, 3, 4, 5]\ndoubled = [n * 2 for n in numbers]\nprint(f\"Doubled: {doubled}\")\n\n# 2. Convert to uppercase\nwords = [\"python\", \"is\", \"fun\"]\nupper_words = [word.upper() for word in words]\nprint(f\"Uppercase: {upper_words}\")\n\n# 3. Get lengths\ntexts = [\"hello\", \"world\", \"python\"]\nlengths = [len(text) for text in texts]\nprint(f\"Lengths: {lengths}\")\n",[990],{"type":606,"tag":631,"props":991,"children":992},{"__ignoreMap":8},[993,1001,1009,1064,1106,1147,1154,1162,1205,1241,1282,1289,1297,1339,1383],{"type":606,"tag":635,"props":994,"children":995},{"class":637,"line":12},[996],{"type":606,"tag":635,"props":997,"children":998},{"style":641},[999],{"type":611,"value":1000},"# Different ways to use list comprehensions\n",{"type":606,"tag":635,"props":1002,"children":1003},{"class":637,"line":27},[1004],{"type":606,"tag":635,"props":1005,"children":1006},{"style":641},[1007],{"type":611,"value":1008},"# 1. Double numbers\n",{"type":606,"tag":635,"props":1010,"children":1011},{"class":637,"line":36},[1012,1016,1020,1024,1028,1032,1036,1040,1044,1048,1052,1056,1060],{"type":606,"tag":635,"props":1013,"children":1014},{"style":650},[1015],{"type":611,"value":653},{"type":606,"tag":635,"props":1017,"children":1018},{"style":656},[1019],{"type":611,"value":659},{"type":606,"tag":635,"props":1021,"children":1022},{"style":650},[1023],{"type":611,"value":664},{"type":606,"tag":635,"props":1025,"children":1026},{"style":667},[1027],{"type":611,"value":670},{"type":606,"tag":635,"props":1029,"children":1030},{"style":650},[1031],{"type":611,"value":675},{"type":606,"tag":635,"props":1033,"children":1034},{"style":667},[1035],{"type":611,"value":680},{"type":606,"tag":635,"props":1037,"children":1038},{"style":650},[1039],{"type":611,"value":675},{"type":606,"tag":635,"props":1041,"children":1042},{"style":667},[1043],{"type":611,"value":689},{"type":606,"tag":635,"props":1045,"children":1046},{"style":650},[1047],{"type":611,"value":675},{"type":606,"tag":635,"props":1049,"children":1050},{"style":667},[1051],{"type":611,"value":698},{"type":606,"tag":635,"props":1053,"children":1054},{"style":650},[1055],{"type":611,"value":675},{"type":606,"tag":635,"props":1057,"children":1058},{"style":667},[1059],{"type":611,"value":707},{"type":606,"tag":635,"props":1061,"children":1062},{"style":650},[1063],{"type":611,"value":712},{"type":606,"tag":635,"props":1065,"children":1066},{"class":637,"line":45},[1067,1072,1076,1080,1084,1089,1094,1098,1102],{"type":606,"tag":635,"props":1068,"children":1069},{"style":650},[1070],{"type":611,"value":1071},"doubled ",{"type":606,"tag":635,"props":1073,"children":1074},{"style":656},[1075],{"type":611,"value":659},{"type":606,"tag":635,"props":1077,"children":1078},{"style":650},[1079],{"type":611,"value":729},{"type":606,"tag":635,"props":1081,"children":1082},{"style":656},[1083],{"type":611,"value":734},{"type":606,"tag":635,"props":1085,"children":1086},{"style":667},[1087],{"type":611,"value":1088}," 2",{"type":606,"tag":635,"props":1090,"children":1091},{"style":656},[1092],{"type":611,"value":1093}," for",{"type":606,"tag":635,"props":1095,"children":1096},{"style":650},[1097],{"type":611,"value":739},{"type":606,"tag":635,"props":1099,"children":1100},{"style":656},[1101],{"type":611,"value":753},{"type":606,"tag":635,"props":1103,"children":1104},{"style":650},[1105],{"type":611,"value":758},{"type":606,"tag":635,"props":1107,"children":1108},{"class":637,"line":54},[1109,1113,1117,1121,1126,1130,1135,1139,1143],{"type":606,"tag":635,"props":1110,"children":1111},{"style":667},[1112],{"type":611,"value":774},{"type":606,"tag":635,"props":1114,"children":1115},{"style":650},[1116],{"type":611,"value":779},{"type":606,"tag":635,"props":1118,"children":1119},{"style":656},[1120],{"type":611,"value":784},{"type":606,"tag":635,"props":1122,"children":1123},{"style":787},[1124],{"type":611,"value":1125},"\"Doubled: ",{"type":606,"tag":635,"props":1127,"children":1128},{"style":667},[1129],{"type":611,"value":795},{"type":606,"tag":635,"props":1131,"children":1132},{"style":650},[1133],{"type":611,"value":1134},"doubled",{"type":606,"tag":635,"props":1136,"children":1137},{"style":667},[1138],{"type":611,"value":805},{"type":606,"tag":635,"props":1140,"children":1141},{"style":787},[1142],{"type":611,"value":810},{"type":606,"tag":635,"props":1144,"children":1145},{"style":650},[1146],{"type":611,"value":815},{"type":606,"tag":635,"props":1148,"children":1149},{"class":637,"line":63},[1150],{"type":606,"tag":635,"props":1151,"children":1152},{"emptyLinePlaceholder":13},[1153],{"type":611,"value":766},{"type":606,"tag":635,"props":1155,"children":1156},{"class":637,"line":72},[1157],{"type":606,"tag":635,"props":1158,"children":1159},{"style":641},[1160],{"type":611,"value":1161},"# 2. Convert to uppercase\n",{"type":606,"tag":635,"props":1163,"children":1164},{"class":637,"line":81},[1165,1170,1174,1178,1183,1187,1192,1196,1201],{"type":606,"tag":635,"props":1166,"children":1167},{"style":650},[1168],{"type":611,"value":1169},"words ",{"type":606,"tag":635,"props":1171,"children":1172},{"style":656},[1173],{"type":611,"value":659},{"type":606,"tag":635,"props":1175,"children":1176},{"style":650},[1177],{"type":611,"value":664},{"type":606,"tag":635,"props":1179,"children":1180},{"style":787},[1181],{"type":611,"value":1182},"\"python\"",{"type":606,"tag":635,"props":1184,"children":1185},{"style":650},[1186],{"type":611,"value":675},{"type":606,"tag":635,"props":1188,"children":1189},{"style":787},[1190],{"type":611,"value":1191},"\"is\"",{"type":606,"tag":635,"props":1193,"children":1194},{"style":650},[1195],{"type":611,"value":675},{"type":606,"tag":635,"props":1197,"children":1198},{"style":787},[1199],{"type":611,"value":1200},"\"fun\"",{"type":606,"tag":635,"props":1202,"children":1203},{"style":650},[1204],{"type":611,"value":712},{"type":606,"tag":635,"props":1206,"children":1208},{"class":637,"line":1207},9,[1209,1214,1218,1223,1227,1232,1236],{"type":606,"tag":635,"props":1210,"children":1211},{"style":650},[1212],{"type":611,"value":1213},"upper_words ",{"type":606,"tag":635,"props":1215,"children":1216},{"style":656},[1217],{"type":611,"value":659},{"type":606,"tag":635,"props":1219,"children":1220},{"style":650},[1221],{"type":611,"value":1222}," [word.upper() ",{"type":606,"tag":635,"props":1224,"children":1225},{"style":656},[1226],{"type":611,"value":744},{"type":606,"tag":635,"props":1228,"children":1229},{"style":650},[1230],{"type":611,"value":1231}," word ",{"type":606,"tag":635,"props":1233,"children":1234},{"style":656},[1235],{"type":611,"value":753},{"type":606,"tag":635,"props":1237,"children":1238},{"style":650},[1239],{"type":611,"value":1240}," words]\n",{"type":606,"tag":635,"props":1242,"children":1243},{"class":637,"line":99},[1244,1248,1252,1256,1261,1265,1270,1274,1278],{"type":606,"tag":635,"props":1245,"children":1246},{"style":667},[1247],{"type":611,"value":774},{"type":606,"tag":635,"props":1249,"children":1250},{"style":650},[1251],{"type":611,"value":779},{"type":606,"tag":635,"props":1253,"children":1254},{"style":656},[1255],{"type":611,"value":784},{"type":606,"tag":635,"props":1257,"children":1258},{"style":787},[1259],{"type":611,"value":1260},"\"Uppercase: ",{"type":606,"tag":635,"props":1262,"children":1263},{"style":667},[1264],{"type":611,"value":795},{"type":606,"tag":635,"props":1266,"children":1267},{"style":650},[1268],{"type":611,"value":1269},"upper_words",{"type":606,"tag":635,"props":1271,"children":1272},{"style":667},[1273],{"type":611,"value":805},{"type":606,"tag":635,"props":1275,"children":1276},{"style":787},[1277],{"type":611,"value":810},{"type":606,"tag":635,"props":1279,"children":1280},{"style":650},[1281],{"type":611,"value":815},{"type":606,"tag":635,"props":1283,"children":1284},{"class":637,"line":108},[1285],{"type":606,"tag":635,"props":1286,"children":1287},{"emptyLinePlaceholder":13},[1288],{"type":611,"value":766},{"type":606,"tag":635,"props":1290,"children":1291},{"class":637,"line":117},[1292],{"type":606,"tag":635,"props":1293,"children":1294},{"style":641},[1295],{"type":611,"value":1296},"# 3. Get lengths\n",{"type":606,"tag":635,"props":1298,"children":1299},{"class":637,"line":126},[1300,1305,1309,1313,1318,1322,1327,1331,1335],{"type":606,"tag":635,"props":1301,"children":1302},{"style":650},[1303],{"type":611,"value":1304},"texts ",{"type":606,"tag":635,"props":1306,"children":1307},{"style":656},[1308],{"type":611,"value":659},{"type":606,"tag":635,"props":1310,"children":1311},{"style":650},[1312],{"type":611,"value":664},{"type":606,"tag":635,"props":1314,"children":1315},{"style":787},[1316],{"type":611,"value":1317},"\"hello\"",{"type":606,"tag":635,"props":1319,"children":1320},{"style":650},[1321],{"type":611,"value":675},{"type":606,"tag":635,"props":1323,"children":1324},{"style":787},[1325],{"type":611,"value":1326},"\"world\"",{"type":606,"tag":635,"props":1328,"children":1329},{"style":650},[1330],{"type":611,"value":675},{"type":606,"tag":635,"props":1332,"children":1333},{"style":787},[1334],{"type":611,"value":1182},{"type":606,"tag":635,"props":1336,"children":1337},{"style":650},[1338],{"type":611,"value":712},{"type":606,"tag":635,"props":1340,"children":1341},{"class":637,"line":135},[1342,1347,1351,1355,1360,1365,1369,1374,1378],{"type":606,"tag":635,"props":1343,"children":1344},{"style":650},[1345],{"type":611,"value":1346},"lengths ",{"type":606,"tag":635,"props":1348,"children":1349},{"style":656},[1350],{"type":611,"value":659},{"type":606,"tag":635,"props":1352,"children":1353},{"style":650},[1354],{"type":611,"value":664},{"type":606,"tag":635,"props":1356,"children":1357},{"style":667},[1358],{"type":611,"value":1359},"len",{"type":606,"tag":635,"props":1361,"children":1362},{"style":650},[1363],{"type":611,"value":1364},"(text) ",{"type":606,"tag":635,"props":1366,"children":1367},{"style":656},[1368],{"type":611,"value":744},{"type":606,"tag":635,"props":1370,"children":1371},{"style":650},[1372],{"type":611,"value":1373}," text ",{"type":606,"tag":635,"props":1375,"children":1376},{"style":656},[1377],{"type":611,"value":753},{"type":606,"tag":635,"props":1379,"children":1380},{"style":650},[1381],{"type":611,"value":1382}," texts]\n",{"type":606,"tag":635,"props":1384,"children":1385},{"class":637,"line":144},[1386,1390,1394,1398,1403,1407,1412,1416,1420],{"type":606,"tag":635,"props":1387,"children":1388},{"style":667},[1389],{"type":611,"value":774},{"type":606,"tag":635,"props":1391,"children":1392},{"style":650},[1393],{"type":611,"value":779},{"type":606,"tag":635,"props":1395,"children":1396},{"style":656},[1397],{"type":611,"value":784},{"type":606,"tag":635,"props":1399,"children":1400},{"style":787},[1401],{"type":611,"value":1402},"\"Lengths: ",{"type":606,"tag":635,"props":1404,"children":1405},{"style":667},[1406],{"type":611,"value":795},{"type":606,"tag":635,"props":1408,"children":1409},{"style":650},[1410],{"type":611,"value":1411},"lengths",{"type":606,"tag":635,"props":1413,"children":1414},{"style":667},[1415],{"type":611,"value":805},{"type":606,"tag":635,"props":1417,"children":1418},{"style":787},[1419],{"type":611,"value":810},{"type":606,"tag":635,"props":1421,"children":1422},{"style":650},[1423],{"type":611,"value":815},{"type":606,"tag":858,"props":1425,"children":1427},{"id":1426},"conditional-list-comprehensions",[1428],{"type":611,"value":1429},"🔍 Conditional List Comprehensions",{"type":606,"tag":614,"props":1431,"children":1432},{},[1433],{"type":611,"value":1434},"You can add conditions to filter items or modify the expression based on certain criteria.",{"type":606,"tag":884,"props":1436,"children":1440},{"emoji":1437,"title":1438,"type":1439},"🎯","Conditional Syntax","success",[1441,1456,1464],{"type":606,"tag":614,"props":1442,"children":1443},{},[1444,1449,1450],{"type":606,"tag":894,"props":1445,"children":1446},{},[1447],{"type":611,"value":1448},"Format:",{"type":611,"value":900},{"type":606,"tag":631,"props":1451,"children":1453},{"className":1452},[],[1454],{"type":611,"value":1455},"[expression for item in iterable if condition]",{"type":606,"tag":614,"props":1457,"children":1458},{},[1459],{"type":606,"tag":894,"props":1460,"children":1461},{},[1462],{"type":611,"value":1463},"Common Uses:",{"type":606,"tag":916,"props":1465,"children":1466},{},[1467,1478,1489],{"type":606,"tag":920,"props":1468,"children":1469},{},[1470,1472],{"type":611,"value":1471},"Filter even numbers: ",{"type":606,"tag":631,"props":1473,"children":1475},{"className":1474},[],[1476],{"type":611,"value":1477},"[x for x in numbers if x % 2 == 0]",{"type":606,"tag":920,"props":1479,"children":1480},{},[1481,1483],{"type":611,"value":1482},"Filter by length: ",{"type":606,"tag":631,"props":1484,"children":1486},{"className":1485},[],[1487],{"type":611,"value":1488},"[word for word in words if len(word) > 3]",{"type":606,"tag":920,"props":1490,"children":1491},{},[1492,1494],{"type":611,"value":1493},"Filter by type: ",{"type":606,"tag":631,"props":1495,"children":1497},{"className":1496},[],[1498],{"type":611,"value":1499},"[x for x in items if isinstance(x, int)]",{"type":606,"tag":977,"props":1501,"children":1503},{"id":1502},"filtering-examples",[1504],{"type":611,"value":1505},"Filtering Examples",{"type":606,"tag":620,"props":1507,"children":1508},{},[1509],{"type":606,"tag":624,"props":1510,"children":1512},{"className":626,"code":1511,"language":628,"meta":8,"style":8},"# Filtering with list comprehensions\nnumbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n\n# Get even numbers\nevens = [n for n in numbers if n % 2 == 0]\nprint(f\"Even numbers: {evens}\")\n\n# Get numbers greater than 5\nbig_numbers = [n for n in numbers if n > 5]\nprint(f\"Numbers > 5: {big_numbers}\")\n\n# Get squares of even numbers\neven_squares = [n * n for n in numbers if n % 2 == 0]\nprint(f\"Squares of evens: {even_squares}\")\n",[1513],{"type":606,"tag":631,"props":1514,"children":1515},{"__ignoreMap":8},[1516,1524,1624,1631,1639,1704,1745,1752,1760,1814,1855,1862,1870,1938],{"type":606,"tag":635,"props":1517,"children":1518},{"class":637,"line":12},[1519],{"type":606,"tag":635,"props":1520,"children":1521},{"style":641},[1522],{"type":611,"value":1523},"# Filtering with list comprehensions\n",{"type":606,"tag":635,"props":1525,"children":1526},{"class":637,"line":27},[1527,1531,1535,1539,1543,1547,1551,1555,1559,1563,1567,1571,1575,1579,1584,1588,1593,1597,1602,1606,1611,1615,1620],{"type":606,"tag":635,"props":1528,"children":1529},{"style":650},[1530],{"type":611,"value":653},{"type":606,"tag":635,"props":1532,"children":1533},{"style":656},[1534],{"type":611,"value":659},{"type":606,"tag":635,"props":1536,"children":1537},{"style":650},[1538],{"type":611,"value":664},{"type":606,"tag":635,"props":1540,"children":1541},{"style":667},[1542],{"type":611,"value":670},{"type":606,"tag":635,"props":1544,"children":1545},{"style":650},[1546],{"type":611,"value":675},{"type":606,"tag":635,"props":1548,"children":1549},{"style":667},[1550],{"type":611,"value":680},{"type":606,"tag":635,"props":1552,"children":1553},{"style":650},[1554],{"type":611,"value":675},{"type":606,"tag":635,"props":1556,"children":1557},{"style":667},[1558],{"type":611,"value":689},{"type":606,"tag":635,"props":1560,"children":1561},{"style":650},[1562],{"type":611,"value":675},{"type":606,"tag":635,"props":1564,"children":1565},{"style":667},[1566],{"type":611,"value":698},{"type":606,"tag":635,"props":1568,"children":1569},{"style":650},[1570],{"type":611,"value":675},{"type":606,"tag":635,"props":1572,"children":1573},{"style":667},[1574],{"type":611,"value":707},{"type":606,"tag":635,"props":1576,"children":1577},{"style":650},[1578],{"type":611,"value":675},{"type":606,"tag":635,"props":1580,"children":1581},{"style":667},[1582],{"type":611,"value":1583},"6",{"type":606,"tag":635,"props":1585,"children":1586},{"style":650},[1587],{"type":611,"value":675},{"type":606,"tag":635,"props":1589,"children":1590},{"style":667},[1591],{"type":611,"value":1592},"7",{"type":606,"tag":635,"props":1594,"children":1595},{"style":650},[1596],{"type":611,"value":675},{"type":606,"tag":635,"props":1598,"children":1599},{"style":667},[1600],{"type":611,"value":1601},"8",{"type":606,"tag":635,"props":1603,"children":1604},{"style":650},[1605],{"type":611,"value":675},{"type":606,"tag":635,"props":1607,"children":1608},{"style":667},[1609],{"type":611,"value":1610},"9",{"type":606,"tag":635,"props":1612,"children":1613},{"style":650},[1614],{"type":611,"value":675},{"type":606,"tag":635,"props":1616,"children":1617},{"style":667},[1618],{"type":611,"value":1619},"10",{"type":606,"tag":635,"props":1621,"children":1622},{"style":650},[1623],{"type":611,"value":712},{"type":606,"tag":635,"props":1625,"children":1626},{"class":637,"line":36},[1627],{"type":606,"tag":635,"props":1628,"children":1629},{"emptyLinePlaceholder":13},[1630],{"type":611,"value":766},{"type":606,"tag":635,"props":1632,"children":1633},{"class":637,"line":45},[1634],{"type":606,"tag":635,"props":1635,"children":1636},{"style":641},[1637],{"type":611,"value":1638},"# Get even numbers\n",{"type":606,"tag":635,"props":1640,"children":1641},{"class":637,"line":54},[1642,1647,1651,1655,1659,1663,1667,1672,1677,1681,1686,1690,1695,1700],{"type":606,"tag":635,"props":1643,"children":1644},{"style":650},[1645],{"type":611,"value":1646},"evens ",{"type":606,"tag":635,"props":1648,"children":1649},{"style":656},[1650],{"type":611,"value":659},{"type":606,"tag":635,"props":1652,"children":1653},{"style":650},[1654],{"type":611,"value":729},{"type":606,"tag":635,"props":1656,"children":1657},{"style":656},[1658],{"type":611,"value":744},{"type":606,"tag":635,"props":1660,"children":1661},{"style":650},[1662],{"type":611,"value":739},{"type":606,"tag":635,"props":1664,"children":1665},{"style":656},[1666],{"type":611,"value":753},{"type":606,"tag":635,"props":1668,"children":1669},{"style":650},[1670],{"type":611,"value":1671}," numbers ",{"type":606,"tag":635,"props":1673,"children":1674},{"style":656},[1675],{"type":611,"value":1676},"if",{"type":606,"tag":635,"props":1678,"children":1679},{"style":650},[1680],{"type":611,"value":739},{"type":606,"tag":635,"props":1682,"children":1683},{"style":656},[1684],{"type":611,"value":1685},"%",{"type":606,"tag":635,"props":1687,"children":1688},{"style":667},[1689],{"type":611,"value":1088},{"type":606,"tag":635,"props":1691,"children":1692},{"style":656},[1693],{"type":611,"value":1694}," ==",{"type":606,"tag":635,"props":1696,"children":1697},{"style":667},[1698],{"type":611,"value":1699}," 0",{"type":606,"tag":635,"props":1701,"children":1702},{"style":650},[1703],{"type":611,"value":712},{"type":606,"tag":635,"props":1705,"children":1706},{"class":637,"line":63},[1707,1711,1715,1719,1724,1728,1733,1737,1741],{"type":606,"tag":635,"props":1708,"children":1709},{"style":667},[1710],{"type":611,"value":774},{"type":606,"tag":635,"props":1712,"children":1713},{"style":650},[1714],{"type":611,"value":779},{"type":606,"tag":635,"props":1716,"children":1717},{"style":656},[1718],{"type":611,"value":784},{"type":606,"tag":635,"props":1720,"children":1721},{"style":787},[1722],{"type":611,"value":1723},"\"Even numbers: ",{"type":606,"tag":635,"props":1725,"children":1726},{"style":667},[1727],{"type":611,"value":795},{"type":606,"tag":635,"props":1729,"children":1730},{"style":650},[1731],{"type":611,"value":1732},"evens",{"type":606,"tag":635,"props":1734,"children":1735},{"style":667},[1736],{"type":611,"value":805},{"type":606,"tag":635,"props":1738,"children":1739},{"style":787},[1740],{"type":611,"value":810},{"type":606,"tag":635,"props":1742,"children":1743},{"style":650},[1744],{"type":611,"value":815},{"type":606,"tag":635,"props":1746,"children":1747},{"class":637,"line":72},[1748],{"type":606,"tag":635,"props":1749,"children":1750},{"emptyLinePlaceholder":13},[1751],{"type":611,"value":766},{"type":606,"tag":635,"props":1753,"children":1754},{"class":637,"line":81},[1755],{"type":606,"tag":635,"props":1756,"children":1757},{"style":641},[1758],{"type":611,"value":1759},"# Get numbers greater than 5\n",{"type":606,"tag":635,"props":1761,"children":1762},{"class":637,"line":1207},[1763,1768,1772,1776,1780,1784,1788,1792,1796,1800,1805,1810],{"type":606,"tag":635,"props":1764,"children":1765},{"style":650},[1766],{"type":611,"value":1767},"big_numbers ",{"type":606,"tag":635,"props":1769,"children":1770},{"style":656},[1771],{"type":611,"value":659},{"type":606,"tag":635,"props":1773,"children":1774},{"style":650},[1775],{"type":611,"value":729},{"type":606,"tag":635,"props":1777,"children":1778},{"style":656},[1779],{"type":611,"value":744},{"type":606,"tag":635,"props":1781,"children":1782},{"style":650},[1783],{"type":611,"value":739},{"type":606,"tag":635,"props":1785,"children":1786},{"style":656},[1787],{"type":611,"value":753},{"type":606,"tag":635,"props":1789,"children":1790},{"style":650},[1791],{"type":611,"value":1671},{"type":606,"tag":635,"props":1793,"children":1794},{"style":656},[1795],{"type":611,"value":1676},{"type":606,"tag":635,"props":1797,"children":1798},{"style":650},[1799],{"type":611,"value":739},{"type":606,"tag":635,"props":1801,"children":1802},{"style":656},[1803],{"type":611,"value":1804},">",{"type":606,"tag":635,"props":1806,"children":1807},{"style":667},[1808],{"type":611,"value":1809}," 5",{"type":606,"tag":635,"props":1811,"children":1812},{"style":650},[1813],{"type":611,"value":712},{"type":606,"tag":635,"props":1815,"children":1816},{"class":637,"line":99},[1817,1821,1825,1829,1834,1838,1843,1847,1851],{"type":606,"tag":635,"props":1818,"children":1819},{"style":667},[1820],{"type":611,"value":774},{"type":606,"tag":635,"props":1822,"children":1823},{"style":650},[1824],{"type":611,"value":779},{"type":606,"tag":635,"props":1826,"children":1827},{"style":656},[1828],{"type":611,"value":784},{"type":606,"tag":635,"props":1830,"children":1831},{"style":787},[1832],{"type":611,"value":1833},"\"Numbers > 5: ",{"type":606,"tag":635,"props":1835,"children":1836},{"style":667},[1837],{"type":611,"value":795},{"type":606,"tag":635,"props":1839,"children":1840},{"style":650},[1841],{"type":611,"value":1842},"big_numbers",{"type":606,"tag":635,"props":1844,"children":1845},{"style":667},[1846],{"type":611,"value":805},{"type":606,"tag":635,"props":1848,"children":1849},{"style":787},[1850],{"type":611,"value":810},{"type":606,"tag":635,"props":1852,"children":1853},{"style":650},[1854],{"type":611,"value":815},{"type":606,"tag":635,"props":1856,"children":1857},{"class":637,"line":108},[1858],{"type":606,"tag":635,"props":1859,"children":1860},{"emptyLinePlaceholder":13},[1861],{"type":611,"value":766},{"type":606,"tag":635,"props":1863,"children":1864},{"class":637,"line":117},[1865],{"type":606,"tag":635,"props":1866,"children":1867},{"style":641},[1868],{"type":611,"value":1869},"# Get squares of even numbers\n",{"type":606,"tag":635,"props":1871,"children":1872},{"class":637,"line":126},[1873,1878,1882,1886,1890,1894,1898,1902,1906,1910,1914,1918,1922,1926,1930,1934],{"type":606,"tag":635,"props":1874,"children":1875},{"style":650},[1876],{"type":611,"value":1877},"even_squares ",{"type":606,"tag":635,"props":1879,"children":1880},{"style":656},[1881],{"type":611,"value":659},{"type":606,"tag":635,"props":1883,"children":1884},{"style":650},[1885],{"type":611,"value":729},{"type":606,"tag":635,"props":1887,"children":1888},{"style":656},[1889],{"type":611,"value":734},{"type":606,"tag":635,"props":1891,"children":1892},{"style":650},[1893],{"type":611,"value":739},{"type":606,"tag":635,"props":1895,"children":1896},{"style":656},[1897],{"type":611,"value":744},{"type":606,"tag":635,"props":1899,"children":1900},{"style":650},[1901],{"type":611,"value":739},{"type":606,"tag":635,"props":1903,"children":1904},{"style":656},[1905],{"type":611,"value":753},{"type":606,"tag":635,"props":1907,"children":1908},{"style":650},[1909],{"type":611,"value":1671},{"type":606,"tag":635,"props":1911,"children":1912},{"style":656},[1913],{"type":611,"value":1676},{"type":606,"tag":635,"props":1915,"children":1916},{"style":650},[1917],{"type":611,"value":739},{"type":606,"tag":635,"props":1919,"children":1920},{"style":656},[1921],{"type":611,"value":1685},{"type":606,"tag":635,"props":1923,"children":1924},{"style":667},[1925],{"type":611,"value":1088},{"type":606,"tag":635,"props":1927,"children":1928},{"style":656},[1929],{"type":611,"value":1694},{"type":606,"tag":635,"props":1931,"children":1932},{"style":667},[1933],{"type":611,"value":1699},{"type":606,"tag":635,"props":1935,"children":1936},{"style":650},[1937],{"type":611,"value":712},{"type":606,"tag":635,"props":1939,"children":1940},{"class":637,"line":135},[1941,1945,1949,1953,1958,1962,1967,1971,1975],{"type":606,"tag":635,"props":1942,"children":1943},{"style":667},[1944],{"type":611,"value":774},{"type":606,"tag":635,"props":1946,"children":1947},{"style":650},[1948],{"type":611,"value":779},{"type":606,"tag":635,"props":1950,"children":1951},{"style":656},[1952],{"type":611,"value":784},{"type":606,"tag":635,"props":1954,"children":1955},{"style":787},[1956],{"type":611,"value":1957},"\"Squares of evens: ",{"type":606,"tag":635,"props":1959,"children":1960},{"style":667},[1961],{"type":611,"value":795},{"type":606,"tag":635,"props":1963,"children":1964},{"style":650},[1965],{"type":611,"value":1966},"even_squares",{"type":606,"tag":635,"props":1968,"children":1969},{"style":667},[1970],{"type":611,"value":805},{"type":606,"tag":635,"props":1972,"children":1973},{"style":787},[1974],{"type":611,"value":810},{"type":606,"tag":635,"props":1976,"children":1977},{"style":650},[1978],{"type":611,"value":815},{"type":606,"tag":858,"props":1980,"children":1982},{"id":1981},"nested-list-comprehensions",[1983],{"type":611,"value":1984},"🎯 Nested List Comprehensions",{"type":606,"tag":614,"props":1986,"children":1987},{},[1988],{"type":611,"value":1989},"You can create more complex transformations using nested list comprehensions.",{"type":606,"tag":620,"props":1991,"children":1992},{},[1993],{"type":606,"tag":624,"props":1994,"children":1996},{"className":626,"code":1995,"language":628,"meta":8,"style":8},"# Nested list comprehensions\n# 1. Create a multiplication table\ntable = [[i * j for j in range(1, 4)] for i in range(1, 4)]\nprint(\"Multiplication table:\")\nfor row in table:\n    print(row)\n\n# 2. Flatten a nested list\nnested = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\nflat = [num for row in nested for num in row]\nprint(f\"Flattened: {flat}\")\n",[1997],{"type":606,"tag":631,"props":1998,"children":1999},{"__ignoreMap":8},[2000,2008,2016,2118,2138,2159,2172,2179,2187,2278,2330],{"type":606,"tag":635,"props":2001,"children":2002},{"class":637,"line":12},[2003],{"type":606,"tag":635,"props":2004,"children":2005},{"style":641},[2006],{"type":611,"value":2007},"# Nested list comprehensions\n",{"type":606,"tag":635,"props":2009,"children":2010},{"class":637,"line":27},[2011],{"type":606,"tag":635,"props":2012,"children":2013},{"style":641},[2014],{"type":611,"value":2015},"# 1. Create a multiplication table\n",{"type":606,"tag":635,"props":2017,"children":2018},{"class":637,"line":36},[2019,2024,2028,2033,2037,2042,2046,2050,2054,2059,2063,2067,2071,2075,2080,2084,2089,2093,2097,2101,2105,2109,2113],{"type":606,"tag":635,"props":2020,"children":2021},{"style":650},[2022],{"type":611,"value":2023},"table ",{"type":606,"tag":635,"props":2025,"children":2026},{"style":656},[2027],{"type":611,"value":659},{"type":606,"tag":635,"props":2029,"children":2030},{"style":650},[2031],{"type":611,"value":2032}," [[i ",{"type":606,"tag":635,"props":2034,"children":2035},{"style":656},[2036],{"type":611,"value":734},{"type":606,"tag":635,"props":2038,"children":2039},{"style":650},[2040],{"type":611,"value":2041}," j ",{"type":606,"tag":635,"props":2043,"children":2044},{"style":656},[2045],{"type":611,"value":744},{"type":606,"tag":635,"props":2047,"children":2048},{"style":650},[2049],{"type":611,"value":2041},{"type":606,"tag":635,"props":2051,"children":2052},{"style":656},[2053],{"type":611,"value":753},{"type":606,"tag":635,"props":2055,"children":2056},{"style":667},[2057],{"type":611,"value":2058}," range",{"type":606,"tag":635,"props":2060,"children":2061},{"style":650},[2062],{"type":611,"value":779},{"type":606,"tag":635,"props":2064,"children":2065},{"style":667},[2066],{"type":611,"value":670},{"type":606,"tag":635,"props":2068,"children":2069},{"style":650},[2070],{"type":611,"value":675},{"type":606,"tag":635,"props":2072,"children":2073},{"style":667},[2074],{"type":611,"value":698},{"type":606,"tag":635,"props":2076,"children":2077},{"style":650},[2078],{"type":611,"value":2079},")] ",{"type":606,"tag":635,"props":2081,"children":2082},{"style":656},[2083],{"type":611,"value":744},{"type":606,"tag":635,"props":2085,"children":2086},{"style":650},[2087],{"type":611,"value":2088}," i ",{"type":606,"tag":635,"props":2090,"children":2091},{"style":656},[2092],{"type":611,"value":753},{"type":606,"tag":635,"props":2094,"children":2095},{"style":667},[2096],{"type":611,"value":2058},{"type":606,"tag":635,"props":2098,"children":2099},{"style":650},[2100],{"type":611,"value":779},{"type":606,"tag":635,"props":2102,"children":2103},{"style":667},[2104],{"type":611,"value":670},{"type":606,"tag":635,"props":2106,"children":2107},{"style":650},[2108],{"type":611,"value":675},{"type":606,"tag":635,"props":2110,"children":2111},{"style":667},[2112],{"type":611,"value":698},{"type":606,"tag":635,"props":2114,"children":2115},{"style":650},[2116],{"type":611,"value":2117},")]\n",{"type":606,"tag":635,"props":2119,"children":2120},{"class":637,"line":45},[2121,2125,2129,2134],{"type":606,"tag":635,"props":2122,"children":2123},{"style":667},[2124],{"type":611,"value":774},{"type":606,"tag":635,"props":2126,"children":2127},{"style":650},[2128],{"type":611,"value":779},{"type":606,"tag":635,"props":2130,"children":2131},{"style":787},[2132],{"type":611,"value":2133},"\"Multiplication table:\"",{"type":606,"tag":635,"props":2135,"children":2136},{"style":650},[2137],{"type":611,"value":815},{"type":606,"tag":635,"props":2139,"children":2140},{"class":637,"line":54},[2141,2145,2150,2154],{"type":606,"tag":635,"props":2142,"children":2143},{"style":656},[2144],{"type":611,"value":744},{"type":606,"tag":635,"props":2146,"children":2147},{"style":650},[2148],{"type":611,"value":2149}," row ",{"type":606,"tag":635,"props":2151,"children":2152},{"style":656},[2153],{"type":611,"value":753},{"type":606,"tag":635,"props":2155,"children":2156},{"style":650},[2157],{"type":611,"value":2158}," table:\n",{"type":606,"tag":635,"props":2160,"children":2161},{"class":637,"line":63},[2162,2167],{"type":606,"tag":635,"props":2163,"children":2164},{"style":667},[2165],{"type":611,"value":2166},"    print",{"type":606,"tag":635,"props":2168,"children":2169},{"style":650},[2170],{"type":611,"value":2171},"(row)\n",{"type":606,"tag":635,"props":2173,"children":2174},{"class":637,"line":72},[2175],{"type":606,"tag":635,"props":2176,"children":2177},{"emptyLinePlaceholder":13},[2178],{"type":611,"value":766},{"type":606,"tag":635,"props":2180,"children":2181},{"class":637,"line":81},[2182],{"type":606,"tag":635,"props":2183,"children":2184},{"style":641},[2185],{"type":611,"value":2186},"# 2. Flatten a nested list\n",{"type":606,"tag":635,"props":2188,"children":2189},{"class":637,"line":1207},[2190,2195,2199,2204,2208,2212,2216,2220,2224,2229,2233,2237,2241,2245,2249,2253,2257,2261,2265,2269,2273],{"type":606,"tag":635,"props":2191,"children":2192},{"style":650},[2193],{"type":611,"value":2194},"nested ",{"type":606,"tag":635,"props":2196,"children":2197},{"style":656},[2198],{"type":611,"value":659},{"type":606,"tag":635,"props":2200,"children":2201},{"style":650},[2202],{"type":611,"value":2203}," [[",{"type":606,"tag":635,"props":2205,"children":2206},{"style":667},[2207],{"type":611,"value":670},{"type":606,"tag":635,"props":2209,"children":2210},{"style":650},[2211],{"type":611,"value":675},{"type":606,"tag":635,"props":2213,"children":2214},{"style":667},[2215],{"type":611,"value":680},{"type":606,"tag":635,"props":2217,"children":2218},{"style":650},[2219],{"type":611,"value":675},{"type":606,"tag":635,"props":2221,"children":2222},{"style":667},[2223],{"type":611,"value":689},{"type":606,"tag":635,"props":2225,"children":2226},{"style":650},[2227],{"type":611,"value":2228},"], [",{"type":606,"tag":635,"props":2230,"children":2231},{"style":667},[2232],{"type":611,"value":698},{"type":606,"tag":635,"props":2234,"children":2235},{"style":650},[2236],{"type":611,"value":675},{"type":606,"tag":635,"props":2238,"children":2239},{"style":667},[2240],{"type":611,"value":707},{"type":606,"tag":635,"props":2242,"children":2243},{"style":650},[2244],{"type":611,"value":675},{"type":606,"tag":635,"props":2246,"children":2247},{"style":667},[2248],{"type":611,"value":1583},{"type":606,"tag":635,"props":2250,"children":2251},{"style":650},[2252],{"type":611,"value":2228},{"type":606,"tag":635,"props":2254,"children":2255},{"style":667},[2256],{"type":611,"value":1592},{"type":606,"tag":635,"props":2258,"children":2259},{"style":650},[2260],{"type":611,"value":675},{"type":606,"tag":635,"props":2262,"children":2263},{"style":667},[2264],{"type":611,"value":1601},{"type":606,"tag":635,"props":2266,"children":2267},{"style":650},[2268],{"type":611,"value":675},{"type":606,"tag":635,"props":2270,"children":2271},{"style":667},[2272],{"type":611,"value":1610},{"type":606,"tag":635,"props":2274,"children":2275},{"style":650},[2276],{"type":611,"value":2277},"]]\n",{"type":606,"tag":635,"props":2279,"children":2280},{"class":637,"line":99},[2281,2286,2290,2295,2299,2303,2307,2312,2316,2321,2325],{"type":606,"tag":635,"props":2282,"children":2283},{"style":650},[2284],{"type":611,"value":2285},"flat ",{"type":606,"tag":635,"props":2287,"children":2288},{"style":656},[2289],{"type":611,"value":659},{"type":606,"tag":635,"props":2291,"children":2292},{"style":650},[2293],{"type":611,"value":2294}," [num ",{"type":606,"tag":635,"props":2296,"children":2297},{"style":656},[2298],{"type":611,"value":744},{"type":606,"tag":635,"props":2300,"children":2301},{"style":650},[2302],{"type":611,"value":2149},{"type":606,"tag":635,"props":2304,"children":2305},{"style":656},[2306],{"type":611,"value":753},{"type":606,"tag":635,"props":2308,"children":2309},{"style":650},[2310],{"type":611,"value":2311}," nested ",{"type":606,"tag":635,"props":2313,"children":2314},{"style":656},[2315],{"type":611,"value":744},{"type":606,"tag":635,"props":2317,"children":2318},{"style":650},[2319],{"type":611,"value":2320}," num ",{"type":606,"tag":635,"props":2322,"children":2323},{"style":656},[2324],{"type":611,"value":753},{"type":606,"tag":635,"props":2326,"children":2327},{"style":650},[2328],{"type":611,"value":2329}," row]\n",{"type":606,"tag":635,"props":2331,"children":2332},{"class":637,"line":108},[2333,2337,2341,2345,2350,2354,2359,2363,2367],{"type":606,"tag":635,"props":2334,"children":2335},{"style":667},[2336],{"type":611,"value":774},{"type":606,"tag":635,"props":2338,"children":2339},{"style":650},[2340],{"type":611,"value":779},{"type":606,"tag":635,"props":2342,"children":2343},{"style":656},[2344],{"type":611,"value":784},{"type":606,"tag":635,"props":2346,"children":2347},{"style":787},[2348],{"type":611,"value":2349},"\"Flattened: ",{"type":606,"tag":635,"props":2351,"children":2352},{"style":667},[2353],{"type":611,"value":795},{"type":606,"tag":635,"props":2355,"children":2356},{"style":650},[2357],{"type":611,"value":2358},"flat",{"type":606,"tag":635,"props":2360,"children":2361},{"style":667},[2362],{"type":611,"value":805},{"type":606,"tag":635,"props":2364,"children":2365},{"style":787},[2366],{"type":611,"value":810},{"type":606,"tag":635,"props":2368,"children":2369},{"style":650},[2370],{"type":611,"value":815},{"type":606,"tag":858,"props":2372,"children":2374},{"id":2373},"quick-practice",[2375],{"type":611,"value":2376},"📝 Quick Practice",{"type":606,"tag":614,"props":2378,"children":2379},{},[2380],{"type":611,"value":2381},"Let's practice using list comprehensions with a simple exercise!",{"type":606,"tag":2383,"props":2384,"children":2387},"exercise",{"hint":2385,"prompt":2386},"Use a list comprehension with a condition to filter even numbers!","Create a list of squared even numbers from 1 to 10.",[2388],{"type":606,"tag":624,"props":2389,"children":2391},{"className":626,"code":2390,"language":628,"meta":8,"style":8},"# List Comprehension Practice\nnumbers = range(1, 11)  # 1 to 10\n\n# TODO: Create a list of squared even numbers\n# 1. Filter even numbers\n# 2. Square each number\n# 3. Store in a list\n\n# Print the result\nprint(f\"Squared evens: {squared_evens}\")\n",[2392],{"type":606,"tag":631,"props":2393,"children":2394},{"__ignoreMap":8},[2395,2403,2445,2452,2470,2478,2486,2494,2501,2509],{"type":606,"tag":635,"props":2396,"children":2397},{"class":637,"line":12},[2398],{"type":606,"tag":635,"props":2399,"children":2400},{"style":641},[2401],{"type":611,"value":2402},"# List Comprehension Practice\n",{"type":606,"tag":635,"props":2404,"children":2405},{"class":637,"line":27},[2406,2410,2414,2418,2422,2426,2430,2435,2440],{"type":606,"tag":635,"props":2407,"children":2408},{"style":650},[2409],{"type":611,"value":653},{"type":606,"tag":635,"props":2411,"children":2412},{"style":656},[2413],{"type":611,"value":659},{"type":606,"tag":635,"props":2415,"children":2416},{"style":667},[2417],{"type":611,"value":2058},{"type":606,"tag":635,"props":2419,"children":2420},{"style":650},[2421],{"type":611,"value":779},{"type":606,"tag":635,"props":2423,"children":2424},{"style":667},[2425],{"type":611,"value":670},{"type":606,"tag":635,"props":2427,"children":2428},{"style":650},[2429],{"type":611,"value":675},{"type":606,"tag":635,"props":2431,"children":2432},{"style":667},[2433],{"type":611,"value":2434},"11",{"type":606,"tag":635,"props":2436,"children":2437},{"style":650},[2438],{"type":611,"value":2439},")  ",{"type":606,"tag":635,"props":2441,"children":2442},{"style":641},[2443],{"type":611,"value":2444},"# 1 to 10\n",{"type":606,"tag":635,"props":2446,"children":2447},{"class":637,"line":36},[2448],{"type":606,"tag":635,"props":2449,"children":2450},{"emptyLinePlaceholder":13},[2451],{"type":611,"value":766},{"type":606,"tag":635,"props":2453,"children":2454},{"class":637,"line":45},[2455,2460,2465],{"type":606,"tag":635,"props":2456,"children":2457},{"style":641},[2458],{"type":611,"value":2459},"# ",{"type":606,"tag":635,"props":2461,"children":2462},{"style":656},[2463],{"type":611,"value":2464},"TODO",{"type":606,"tag":635,"props":2466,"children":2467},{"style":641},[2468],{"type":611,"value":2469},": Create a list of squared even numbers\n",{"type":606,"tag":635,"props":2471,"children":2472},{"class":637,"line":54},[2473],{"type":606,"tag":635,"props":2474,"children":2475},{"style":641},[2476],{"type":611,"value":2477},"# 1. Filter even numbers\n",{"type":606,"tag":635,"props":2479,"children":2480},{"class":637,"line":63},[2481],{"type":606,"tag":635,"props":2482,"children":2483},{"style":641},[2484],{"type":611,"value":2485},"# 2. Square each number\n",{"type":606,"tag":635,"props":2487,"children":2488},{"class":637,"line":72},[2489],{"type":606,"tag":635,"props":2490,"children":2491},{"style":641},[2492],{"type":611,"value":2493},"# 3. Store in a list\n",{"type":606,"tag":635,"props":2495,"children":2496},{"class":637,"line":81},[2497],{"type":606,"tag":635,"props":2498,"children":2499},{"emptyLinePlaceholder":13},[2500],{"type":611,"value":766},{"type":606,"tag":635,"props":2502,"children":2503},{"class":637,"line":1207},[2504],{"type":606,"tag":635,"props":2505,"children":2506},{"style":641},[2507],{"type":611,"value":2508},"# Print the result\n",{"type":606,"tag":635,"props":2510,"children":2511},{"class":637,"line":99},[2512,2516,2520,2524,2529,2533,2538,2542,2546],{"type":606,"tag":635,"props":2513,"children":2514},{"style":667},[2515],{"type":611,"value":774},{"type":606,"tag":635,"props":2517,"children":2518},{"style":650},[2519],{"type":611,"value":779},{"type":606,"tag":635,"props":2521,"children":2522},{"style":656},[2523],{"type":611,"value":784},{"type":606,"tag":635,"props":2525,"children":2526},{"style":787},[2527],{"type":611,"value":2528},"\"Squared evens: ",{"type":606,"tag":635,"props":2530,"children":2531},{"style":667},[2532],{"type":611,"value":795},{"type":606,"tag":635,"props":2534,"children":2535},{"style":650},[2536],{"type":611,"value":2537},"squared_evens",{"type":606,"tag":635,"props":2539,"children":2540},{"style":667},[2541],{"type":611,"value":805},{"type":606,"tag":635,"props":2543,"children":2544},{"style":787},[2545],{"type":611,"value":810},{"type":606,"tag":635,"props":2547,"children":2548},{"style":650},[2549],{"type":611,"value":815},{"type":606,"tag":977,"props":2551,"children":2553},{"id":2552},"solution-and-explanation",[2554],{"type":611,"value":2555},"Solution and Explanation 💡",{"type":606,"tag":2557,"props":2558,"children":2559},"details",{},[2560,2568,2754,2762],{"type":606,"tag":2561,"props":2562,"children":2565},"summary",{"className":2563},[2564],"cursor-pointer",[2566],{"type":611,"value":2567},"Click to see the solution",{"type":606,"tag":620,"props":2569,"children":2570},{},[2571],{"type":606,"tag":624,"props":2572,"children":2574},{"className":626,"code":2573,"language":628,"meta":8,"style":8},"# List Comprehension Practice Solution\nnumbers = range(1, 11)  # 1 to 10\n\n# Create list of squared even numbers\nsquared_evens = [n * n for n in numbers if n % 2 == 0]\n\nprint(f\"Squared evens: {squared_evens}\")\n",[2575],{"type":606,"tag":631,"props":2576,"children":2577},{"__ignoreMap":8},[2578,2586,2625,2632,2640,2708,2715],{"type":606,"tag":635,"props":2579,"children":2580},{"class":637,"line":12},[2581],{"type":606,"tag":635,"props":2582,"children":2583},{"style":641},[2584],{"type":611,"value":2585},"# List Comprehension Practice Solution\n",{"type":606,"tag":635,"props":2587,"children":2588},{"class":637,"line":27},[2589,2593,2597,2601,2605,2609,2613,2617,2621],{"type":606,"tag":635,"props":2590,"children":2591},{"style":650},[2592],{"type":611,"value":653},{"type":606,"tag":635,"props":2594,"children":2595},{"style":656},[2596],{"type":611,"value":659},{"type":606,"tag":635,"props":2598,"children":2599},{"style":667},[2600],{"type":611,"value":2058},{"type":606,"tag":635,"props":2602,"children":2603},{"style":650},[2604],{"type":611,"value":779},{"type":606,"tag":635,"props":2606,"children":2607},{"style":667},[2608],{"type":611,"value":670},{"type":606,"tag":635,"props":2610,"children":2611},{"style":650},[2612],{"type":611,"value":675},{"type":606,"tag":635,"props":2614,"children":2615},{"style":667},[2616],{"type":611,"value":2434},{"type":606,"tag":635,"props":2618,"children":2619},{"style":650},[2620],{"type":611,"value":2439},{"type":606,"tag":635,"props":2622,"children":2623},{"style":641},[2624],{"type":611,"value":2444},{"type":606,"tag":635,"props":2626,"children":2627},{"class":637,"line":36},[2628],{"type":606,"tag":635,"props":2629,"children":2630},{"emptyLinePlaceholder":13},[2631],{"type":611,"value":766},{"type":606,"tag":635,"props":2633,"children":2634},{"class":637,"line":45},[2635],{"type":606,"tag":635,"props":2636,"children":2637},{"style":641},[2638],{"type":611,"value":2639},"# Create list of squared even numbers\n",{"type":606,"tag":635,"props":2641,"children":2642},{"class":637,"line":54},[2643,2648,2652,2656,2660,2664,2668,2672,2676,2680,2684,2688,2692,2696,2700,2704],{"type":606,"tag":635,"props":2644,"children":2645},{"style":650},[2646],{"type":611,"value":2647},"squared_evens ",{"type":606,"tag":635,"props":2649,"children":2650},{"style":656},[2651],{"type":611,"value":659},{"type":606,"tag":635,"props":2653,"children":2654},{"style":650},[2655],{"type":611,"value":729},{"type":606,"tag":635,"props":2657,"children":2658},{"style":656},[2659],{"type":611,"value":734},{"type":606,"tag":635,"props":2661,"children":2662},{"style":650},[2663],{"type":611,"value":739},{"type":606,"tag":635,"props":2665,"children":2666},{"style":656},[2667],{"type":611,"value":744},{"type":606,"tag":635,"props":2669,"children":2670},{"style":650},[2671],{"type":611,"value":739},{"type":606,"tag":635,"props":2673,"children":2674},{"style":656},[2675],{"type":611,"value":753},{"type":606,"tag":635,"props":2677,"children":2678},{"style":650},[2679],{"type":611,"value":1671},{"type":606,"tag":635,"props":2681,"children":2682},{"style":656},[2683],{"type":611,"value":1676},{"type":606,"tag":635,"props":2685,"children":2686},{"style":650},[2687],{"type":611,"value":739},{"type":606,"tag":635,"props":2689,"children":2690},{"style":656},[2691],{"type":611,"value":1685},{"type":606,"tag":635,"props":2693,"children":2694},{"style":667},[2695],{"type":611,"value":1088},{"type":606,"tag":635,"props":2697,"children":2698},{"style":656},[2699],{"type":611,"value":1694},{"type":606,"tag":635,"props":2701,"children":2702},{"style":667},[2703],{"type":611,"value":1699},{"type":606,"tag":635,"props":2705,"children":2706},{"style":650},[2707],{"type":611,"value":712},{"type":606,"tag":635,"props":2709,"children":2710},{"class":637,"line":63},[2711],{"type":606,"tag":635,"props":2712,"children":2713},{"emptyLinePlaceholder":13},[2714],{"type":611,"value":766},{"type":606,"tag":635,"props":2716,"children":2717},{"class":637,"line":72},[2718,2722,2726,2730,2734,2738,2742,2746,2750],{"type":606,"tag":635,"props":2719,"children":2720},{"style":667},[2721],{"type":611,"value":774},{"type":606,"tag":635,"props":2723,"children":2724},{"style":650},[2725],{"type":611,"value":779},{"type":606,"tag":635,"props":2727,"children":2728},{"style":656},[2729],{"type":611,"value":784},{"type":606,"tag":635,"props":2731,"children":2732},{"style":787},[2733],{"type":611,"value":2528},{"type":606,"tag":635,"props":2735,"children":2736},{"style":667},[2737],{"type":611,"value":795},{"type":606,"tag":635,"props":2739,"children":2740},{"style":650},[2741],{"type":611,"value":2537},{"type":606,"tag":635,"props":2743,"children":2744},{"style":667},[2745],{"type":611,"value":805},{"type":606,"tag":635,"props":2747,"children":2748},{"style":787},[2749],{"type":611,"value":810},{"type":606,"tag":635,"props":2751,"children":2752},{"style":650},[2753],{"type":611,"value":815},{"type":606,"tag":614,"props":2755,"children":2756},{},[2757],{"type":606,"tag":894,"props":2758,"children":2759},{},[2760],{"type":611,"value":2761},"Key Learning Points:",{"type":606,"tag":916,"props":2763,"children":2764},{},[2765,2778,2790,2802],{"type":606,"tag":920,"props":2766,"children":2767},{},[2768,2770,2776],{"type":611,"value":2769},"📌 Used ",{"type":606,"tag":631,"props":2771,"children":2773},{"className":2772},[],[2774],{"type":611,"value":2775},"range(1, 11)",{"type":611,"value":2777}," to generate numbers 1-10",{"type":606,"tag":920,"props":2779,"children":2780},{},[2781,2782,2788],{"type":611,"value":2769},{"type":606,"tag":631,"props":2783,"children":2785},{"className":2784},[],[2786],{"type":611,"value":2787},"if n % 2 == 0",{"type":611,"value":2789}," to filter even numbers",{"type":606,"tag":920,"props":2791,"children":2792},{},[2793,2794,2800],{"type":611,"value":2769},{"type":606,"tag":631,"props":2795,"children":2797},{"className":2796},[],[2798],{"type":611,"value":2799},"n * n",{"type":611,"value":2801}," to square each number",{"type":606,"tag":920,"props":2803,"children":2804},{},[2805],{"type":611,"value":2806},"📌 Combined everything in a single list comprehension",{"type":606,"tag":858,"props":2808,"children":2810},{"id":2809},"key-takeaways",[2811],{"type":611,"value":2812},"🎯 Key Takeaways",{"type":606,"tag":884,"props":2814,"children":2817},{"emoji":2815,"title":2816,"type":1439},"📚","List Comprehension Essentials",[2818,2826,2844,2852,2875],{"type":606,"tag":614,"props":2819,"children":2820},{},[2821],{"type":606,"tag":894,"props":2822,"children":2823},{},[2824],{"type":611,"value":2825},"Basic Usage:",{"type":606,"tag":916,"props":2827,"children":2828},{},[2829,2834,2839],{"type":606,"tag":920,"props":2830,"children":2831},{},[2832],{"type":611,"value":2833},"Create new lists from existing ones",{"type":606,"tag":920,"props":2835,"children":2836},{},[2837],{"type":611,"value":2838},"Transform data in one line",{"type":606,"tag":920,"props":2840,"children":2841},{},[2842],{"type":611,"value":2843},"More readable than traditional loops",{"type":606,"tag":614,"props":2845,"children":2846},{},[2847],{"type":606,"tag":894,"props":2848,"children":2849},{},[2850],{"type":611,"value":2851},"Advanced Features:",{"type":606,"tag":916,"props":2853,"children":2854},{},[2855,2865,2870],{"type":606,"tag":920,"props":2856,"children":2857},{},[2858,2860],{"type":611,"value":2859},"Add conditions with ",{"type":606,"tag":631,"props":2861,"children":2863},{"className":2862},[],[2864],{"type":611,"value":1676},{"type":606,"tag":920,"props":2866,"children":2867},{},[2868],{"type":611,"value":2869},"Use nested comprehensions",{"type":606,"tag":920,"props":2871,"children":2872},{},[2873],{"type":611,"value":2874},"Combine with other Python features",{"type":606,"tag":614,"props":2876,"children":2877},{},[2878,2883],{"type":606,"tag":894,"props":2879,"children":2880},{},[2881],{"type":611,"value":2882},"Remember:",{"type":611,"value":2884}," Keep comprehensions readable - if too complex, use a traditional loop!",{"type":606,"tag":2886,"props":2887,"children":2888},"style",{},[2889],{"type":611,"value":2890},"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":2892},[2893,2896,2899,2900,2903],{"id":860,"depth":27,"text":863,"children":2894},[2895],{"id":979,"depth":36,"text":982},{"id":1426,"depth":27,"text":1429,"children":2897},[2898],{"id":1502,"depth":36,"text":1505},{"id":1981,"depth":27,"text":1984},{"id":2373,"depth":27,"text":2376,"children":2901},[2902],{"id":2552,"depth":36,"text":2555},{"id":2809,"depth":27,"text":2812},1782373754285]