{
  "source_file": "0930",
  "source_platform": "Medium",
  "author": "Federico Trotta",
  "title_listed": "Python Lists: The Definitive Guide for Working With Ordered Collections of Data",
  "keywords": "Python,列表,数据结构",
  "domain": "数据处理",
  "content_type": "深度技术解析",
  "is_paid_flag": "部分免费/会员墙",
  "url": "https://towardsdatascience.com/python-lists-the-definitive-guide-for-working-with-ordered-collections-of-data-53b06a194826/",
  "publish_date": "2023-07",
  "corpus_stage": "预训练/SFT",
  "notes": "",
  "id": "30b9b64214f0",
  "collected_at": "2026-10-02T00:40:12",
  "title": "Python Lists: The Definitive Guide for Working With Ordered Collections of Data | Towards Data Science",
  "body_markdown": "![Revisit consent button](https://cdn-cookieyes.com/assets/images/revisit.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](https://cdn-cookieyes.com/assets/images/close.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\n# Python Lists: The Definitive Guide for Working With Ordered Collections of Data\nA comprehensive guide on lists in Python\n[Federico Trotta](https://towardsdatascience.com/author/federicotrotta/)\nJuly 19, 202311 min read\n![](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/07/1ykoOnRpQPHq46AjbS5CNeg.jpeg)\nWhen programming, we always have to deal with data structures. What I mean is that we need to store information somewhere so that we can reuse it later.\nPython is a very flexible programming language and gives us the possibility to use different types of data structures.\nIn this article, we'll analyze Python lists. So, if you're a beginner in Python and are searching for a comprehensive guide on lists, then this article is definitely for you.\nHere's what you'll learn here:\ntext\n\n```\nTable of Contents:\n\nWhat is a list in Python?\nThe top 9 features in Python lists, with examples\n  How to create a list in Python\n  Accessing list elements\n  Modifying the elements of a list\n  Adding elements to a list\n  Removing elements from a list\n  Concatenating lists\n  Calculating the lenght of a list\n  Sorting the elements of a list\n  List comprehension\n```\n\n* * *\nLearn this step by step with the interactive [AI Engineer](https://roadmap.sh/ai-engineer), [AI and Data Scientist](https://roadmap.sh/ai-data-scientist) and [Computer Science](https://roadmap.sh/computer-science) roadmaps.\n## What is a list in Python?\nIn Python, a list is a built-in data structure that allows us to store and manipulate data in the form of text or numbers.\nLists store data in an ordered way, meaning that the elements of a list can be accessed by their position.\nLists are also a modifiable kind of data structure, as opposed to [tuples](https://towardsdatascience.com/lists-tuples-dictionaries-and-data-frames-in-python-the-complete-guide-7ab54d4819ee).\nFinally, lists can also store duplicated values without raising errors.\n## The top 9 features in Python lists, with examples\nThe best way to learn Python is by putting our fingers on the keyboard and, possibly, solving an actual problem.\nSo, now we'll show the 9 top features of Python lists with code examples because, as we'll see, theory doesn't have much sense in programming: we just need to code and solve problems.\n### How to create a list in Python\nTo create a list, we need to use square brackets:\ntext\n\n```\n# Create a simple list\nnumbers = [1,2,3,\"dog\",\"cat\"]\n\n# Show list\nprint(numbers)\n\n>>>\n\n[1, 2, 3, 'dog', 'cat']\n```\n\nAnother way to create a list is by using the built-in method `list`. For example, suppose we want to create a list of numbers ranging from 0 to 9. We can use the built-in method `range` to create the range, then we can pass it as an argument to the method `list` to create the list like so:\ntext\n\n```\n# Create a list in the range\nlist_range = list(range(10))\n\n# Show list\nprint(range_list)\n\n>>>\n\n[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n```\n\nAlso, we can create the so-called list of lists that are nothing more than nested lists. For example, suppose we want to store the data related to measured times, in seconds, of people running. If we need these data as a list we can create a list of lists like so:\ntext\n\n```\n# Create a list of lists\ntimes = [[\"Jhon\"], [23, 15, 18], [\"Karen\"], [17, 19, 15],\n        [\"Tom\"], [21, 19, 25]]\n\n# Print list\nprint(times)\n\n>>>\n\n[['Jhon'], [23, 15, 18], ['Karen'], [17, 19, 15], ['Tom'], [21, 19, 25]]\n```\n\n### Accessing list elements\nThe elements of a list can be accessed by their positions. What we need to remember is that in Python we start counting from 0. This means that the first element is accessed with a 0:\ntext\n\n```\n# Create a list of elements\nvalues = [1,2,3,\"dog\",\"cat\"]\n\n# Print elements by accessing them\nprint(f\"The first element is: {values[0]}\")\nprint(f\"The fourth element is: {values[3]}\")\n\n>>>\n\nThe first element is: 1\nThe fourth element is: dog\n```\n\nSo, we just need to take care to make the right counting.\nAccessing a list of lists is a little bit more complicated, but is not hard. We first need to access the position related to the external list, then we count in the internal one.\nAs we've said, practice is better than theory in Python. So, let's show this concept with an example:\ntext\n\n```\n# Create a list of lists\ntimes = [[\"Jhon\"], [23, 15, 18], [\"Karen\"], [17, 19, 15],\n        [\"Tom\"], [21, 19, 25]]\n\n# Print\nprint(f\"The first runner is:{times[0]}.nHis first registered time is:{times[1][0]}nThe min registered time is:{min(times[1])}\")\n\n>>>\n\nThe first runner is:['Jhon'].\nHis first registered time is:23\nThe min registered time is:15\n```\n\nJhon is the first registered runner, so we access it with `times[0]`.\nThen, we want to calculate his first registered time. To do so, we have to type `times[1][0]` because: `[1]` refers to the second position, with respect to the external list. Meaning that we've accessed the internal list `[23, 15, 18]`. Finally, the `[0]` accesses the first number of the internal list which, indeed, is 23.\n### Modifying the elements of a list\nAs we've said, lists are modifiable and to modify an element of a list we need to access it.\nSo, let's make an example:\ntext\n\n```\n# Create a list of numbers\nnumbers = [1, 2, 3, 4, 5]\n\n# Modify the third element\nnumbers[2] = 10\n\n# Print new list\nprint(numbers)\n\n>>>\n\n[1, 2, 10, 4, 5]\n```\n\nSo, in this case, we've modified the third element changing it from 3 to 10.\nBut we can also modify text. In particular, sentences. Let's see an example:\ntext\n\n```\n# Create a sentence in a list\nsentence = list(\"Hello, World!\")\n\n# Substitute \"world\" with \"Python\"\nsentence[7:] = list(\"Python!\")\n\n# Print sentence\nprint(''.join(sentence))\n\n>>>\n\n\"Hello, Python!\"\n```\n\nSo, here we've substituted all the letters in our list \"sentence\" from the seventh (make the count start from 0, as we've said before) element to the last one with `sentence[7:]`.\nWe've, then, used the method `''.join(sentence)` to print the sentence as a whole one. In fact, if we'd just used `print()` it would print the letters as single elements like so:\ntext\n\n```\nprint(sentence)\n\n>>>\n\n['H', 'e', 'l', 'l', 'o', ',', ' ', 'P', 'y', 't', 'h', 'o', 'n', '!']\n```\n\n### Adding elements to a list\nSince lists are mutable, we can add new elements to them, if we need it and we have a couple of methods to do so.\nThe first one is to use the `append()` method which is particularly suitable if we need to add just one element to a list. For example:\ntext\n\n```\n# Create a list with fruits\nfruits = ['apple', 'banana']\n\n# Append the element \"orange\" to the list\nfruits.append('orange')\n\n# Print list\nprint(fruits)\n\n>>>\n\n['apple', 'banana', 'orange']\n```\n\nAnother way to add elements to an existing list is by using the `extend()` method which is particularly suitable if we need to append more than one element at a time. For example, like so:\ntext\n\n```\n# Create a list of numbers\nnumbers = [1, 2, 3, 4, 5]\n\n# Extend the list with new numbers\nnumbers.extend([6, 7, 8])\n\n# Print list\nprint(numbers)\n\n>>>\n\n[1, 2, 3, 4, 5, 6, 7, 8]\n```\n\n### Removing elements from a list\nThanks to mutability, we can add elements to a list but we can even remove elements.\nAlso here, we have two ways to do so: we can use the slicing possibility or we can directly specify an element to delete.\nLet's see these with Python examples:\ntext\n\n```\n# Create a list with fruits\nfruits = ['apple', 'banana', 'orange']\n\n# Remove the element banana\nfruits.remove('banana')\n\n# Print list\nprint(fruits)\n\n>>>\n\n['apple', 'orange']\n```\n\nSo, the `remove()` method gives us the possibility to directly delete a specific element from a list by typing its value.\nThe other method we can use is to access the position of the element we want to remove like so:\ntext\n\n```\n# Create a list of numbers\nnumbers = [1, 2, 3, 4, 5]\n\n# Delete on element: slicing method\npopped_element = numbers.pop(2)\n\n# Print\nprint(numbers)  \nprint(f\"The deleted element is:{popped_element}\")  \n\n>>>\n\n[1, 2, 4, 5]\nThe deleted element is:3\n```\n\nSo, the `pop()` method removes an element from a list by accessing its index.\nWhich one to use? It depends on the situation. If we have a very long list, it's generally a good idea to use the `remove()` method so that we directly write the element we actually want to remove, and we don't make mistakes in counting the indexes.\n### Concatenating lists\nThe mutability of lists gives us the possibility to perform numerous tasks, like concatenating multiple lists together in one single list.\nThis operation is simple and is performed with a `+` like so:\ntext\n\n```\n# Create a list\nlist1 = [1, 2, 3]\n\n# Create a second list\nlist2 = [4, 5, 6]\n\n# Concatenate list\ncombined_list = list1 + list2\n\n# Print cncatenated lists\nprint(combined_list)\n\n>>>\n\n[1, 2, 3, 4, 5, 6]\n```\n\nThis feature can, of course, be performed even with strings:\ntext\n\n```\n# Create a list\nhello = [\"Hello\"]\n\n# Create another list\nworld = [\"world\"]\n\n# Concatenate\nsingle_list = hello + world\n\n# Print concatenated\nprint(single_list)\n\n>>>\n\n['Hello', 'world']\n```\n\nAnother way to concatenate lists is to flatten a list of lists. In other words, we can create a single \"straight\" list from a nested list like so:\ntext\n\n```\n# Create a nested list\nlists = [[1, 2], [3, 4], [5, 6]]\n\n# Create a unique list\nflattened_list = sum(lists, [])\n\n# Print unique list\nprint(flattened_list)\n\n>>>\n\n[1, 2, 3, 4, 5, 6]\n```\n\nSo, basically, we've used the `sum()` method to get all the elements of the list `lists` and appended them to an empty list with `[]`.\n### Calculating the length of a list\nIn the previous examples, we've created lists ourselves to make Python examples about how to manipulate lists.\nHowever, when working with Python, it often happens that we retrieve data from different sources, meaning someone created a list we actually don't know anything about.\nThe first thing we'd better do when we are in front of an unknown list is to calculate its length. We can do it like so:\ntext\n\n```\n# Create a list\nfruits = ['apple', 'banana', 'orange']\n\n# Print list lenght\nprint(f\"In this list there are {len(fruits)} elements\")\n\n>>>\n\n In this list there are 3 elements\n```\n\nSo, the method `len()` calculates how many elements are in a list, without worrying about their type. This means that the elements can be all numbers, all strings, or both of them: the `len()` methods will count them all.\n### Sorting the elements of a list\nAnother action we may perform when we don't know a list is to sort its elements.\nWe have different methods to do so.\nLet's start with the `sort()` method:\ntext\n\n```\n# Creaye a list of numbers \nnumbers = [5, 2, 1, 4, 3]\n\n# Sort the numbers\nnumbers.sort()\n\n# Print sorted list\nprint(numbers)\n\n>>>\n\n[1, 2, 3, 4, 5]\n```\n\nSo, we can just pass the list as the argument to the `sort()` method and it will sort the elements.\nBut what if we want to sort a list containing strings? For example, suppose we want to sort the elements of a list in alphabetical order. We can do it like so:\ntext\n\n```\n# Create a list of strings\nwords = ['cat', 'apple', 'dog', 'banana']\n\n# Sort in alphabeticla order\nsorted_words = sorted(words, key=lambda x: x[0])\n\n# Print sorted list\nprint(sorted_words)\n\n>>>\n\n['apple', 'banana', 'cat', 'dog']\n```\n\nSo, in this case, we use the `sorted()` method where we have to specify:\n  * The parameters regarding the list we want to sort. In this case, `words`.\n  * The `key`. Which means we need to specify a methodology. In this case, we've used a lambda function that gets the first letter of each element with `x[0]` by iterating through all the elements: this is the way we can select the first letter for each word.\n\n\nAnother way to sort strings is to sort them by the number of characters for each element. In other words, suppose we want to have the shorter words at the beginning and the longest at the end of our list. We can do it like so:\ntext\n\n```\n# Create a list of words\nwords = ['cat', 'apple', 'dog', 'banana']\n\n# Sort words by lenght\nwords.sort(key=len)\n\n# Print sorted list\nprint(words)\n\n>>>\n\n['cat', 'dog', 'apple', 'banana']\n```\n\nSo, even with the `sort()` method we can pass a parameter `key`. In this case, we've chosen `len` which counts the length of each word. So, the list is now ordered starting with the shortest words and ending with the longest ones.\n### List comprehension\nList comprehension is a fast and concise way to create a new list using the power of loops and statements with one line of code.\nLet's see an example. Suppose we want to take the numbers ranging from 1 to 6 and create a list with their squared values. We can do it like so:\ntext\n\n```\n# Create a list of squared numbers\nsquares = [x ** 2 for x in range(1, 6)]\n\n# Print list\nprint(squares) \n\n>>>\n\n[1, 4, 9, 16, 25]\n```\n\nNow, we can reach the same result without using list comprehension but at the cost of a lot of code like so:\ntext\n\n```\n# Create empty list\nsquares = []\n\n# Iterate over the numbers in the range\nfor squared in range(1, 6):\n    # Calculare squares and append to empty list\n    squares.append(squared ** 2)\n\n# Print list    \nprint(squares)\n\n>>>\n\n[1, 4, 9, 16, 25]\n```\n\nSo, we get the same result but list comprehension makes us reach it with just one line of code.\nWe can also use `if` statements in a list comprehension, making it way quicker and elegant than the \"standard method\", for which we'd need to iterate with a `for` loop, and then select the values we need with an `if` statement.\nFor example, suppose we want to create a new list of squared numbers, but we want only the ones that are even numbers. We can do it like so:\ntext\n\n```\n# Create a list with numbers in a range\nnumbers = list(range(1, 11))\n\n# Get the even squared numbers and create a new list\nsquared_evens = [x ** 2 for x in numbers if x % 2 == 0]\n\n# Print list with squared &amp; even numbers\nprint(squared_evens)\n\n>>>\n\n[4, 16, 36, 64, 100]\n```\n\nSo, here we need to remember that to take even numbers we can use the fact that they are divisible by two. So, `x % 2 == 0` gets the numbers that, when divided by two, give a reminder of 0. Meaning: they're even numbers.\n* * *\n## Conclusions\nIn this article, we've shown a comprehensive guide on Python lists.\nLists are a very important and useful data structure. They're not hard to learn, but are a fundamental asset for every Python programmer.\n* * *\nI'm Federico Trotta and I'm a freelance Technical Writer.\nWant to collaborate with me? [Contact me](https://bio.link/federicotrotta).\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](https://assets.insightmediagroup.io/media/1787657183787_vf5bj8.png)\nWritten By\n## [Federico Trotta](https://towardsdatascience.com/author/federicotrotta/)\n[See all from Federico Trotta](https://towardsdatascience.com/author/federicotrotta/)\n[Artificial Intelligence](https://towardsdatascience.com/tag/artificial-intelligence/)[Data Science](https://towardsdatascience.com/tag/data-science/)[Federico Trotta](https://towardsdatascience.com/tag/federico-trotta/)[Python](https://towardsdatascience.com/tag/python/)[Technology](https://towardsdatascience.com/tag/technology/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fpython-lists-the-definitive-guide-for-working-with-ordered-collections-of-data-53b06a194826%2F&title=Python%20Lists%3A%20The%20Definitive%20Guide%20for%20Working%20With%20Ordered%20Collections%20of%20Data)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fpython-lists-the-definitive-guide-for-working-with-ordered-collections-of-data-53b06a194826%2F&title=Python%20Lists%3A%20The%20Definitive%20Guide%20for%20Working%20With%20Ordered%20Collections%20of%20Data)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fpython-lists-the-definitive-guide-for-working-with-ordered-collections-of-data-53b06a194826%2F&text=Python%20Lists%3A%20The%20Definitive%20Guide%20for%20Working%20With%20Ordered%20Collections%20of%20Data)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2019/11/19BEw1JtTCTtwXwy3DYciaw.png)](https://towardsdatascience.com/python-tricks-inheriting-from-built-in-data-types-f6cbeb8d88a5/)\n## [Python Tricks, Inheriting from Built-in data types](https://towardsdatascience.com/python-tricks-inheriting-from-built-in-data-types-f6cbeb8d88a5/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nLearn how to Simply Customize the Functionality of your lists, dicts and more.\n[Stephen Fordham](https://towardsdatascience.com/author/stephenfordham/)\nNovember 30, 20194 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/12/13WhyN7c9c_3urpV0cndGiQ.jpeg)](https://towardsdatascience.com/nlp-gaining-insights-from-text-reviews-94ef955c58c0/)\n## [NLP: Gaining insights from text reviews](https://towardsdatascience.com/nlp-gaining-insights-from-text-reviews-94ef955c58c0/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nEvery time we express ourselves, either verbally or in written text, these expressions carry a lot of information. What subjects we talk...\n[Fredrik Olsson](https://towardsdatascience.com/author/fredrik-olsson/)\nDecember 17, 202011 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/11/0omARYNl1JEpVbgR9.jpg)](https://towardsdatascience.com/student-crime-and-disruption-related-incident-prediction-in-the-us-public-schools-64d81ed129b1/)\n## [Student-Crime and Disruption-Related Incident Prediction in the US Public Schools](https://towardsdatascience.com/student-crime-and-disruption-related-incident-prediction-in-the-us-public-schools-64d81ed129b1/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nOur findings will encompass what may be contributing to higher rates of student-crime and disruption-related incidents at public schools...\n[Dexter Nguyen](https://towardsdatascience.com/author/dextertinhnguyen/)\nNovember 22, 202012 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/12/1TPgInsuM3qCc4iz7FB6kog.png)](https://towardsdatascience.com/python-meets-pawn-2-clustering-chess-grandmasters-based-on-their-openings-68440fc9f9b1/)\n## [Python Meets Pawn 2: Clustering Chess Grandmasters based on their Openings](https://towardsdatascience.com/python-meets-pawn-2-clustering-chess-grandmasters-based-on-their-openings-68440fc9f9b1/)\n[](https://towardsdatascience.com/python-lists-the-definitive-guide-for-working-with-ordered-collections-of-data-53b06a194826/)\nIn this blog, I will guide you through the process of analyzing Chess Grandmasters' openings using Python.\n[Mikayil Ahadli](https://towardsdatascience.com/author/mikayilahad/)\nDecember 22, 20237 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/06/01oxtMaYqbQlebXmH.jpg)](https://towardsdatascience.com/how-to-build-the-perfect-dashboard-with-power-bi-28c35d6cd785/)\n## [How to Build the Perfect Dashboard with Power BI](https://towardsdatascience.com/how-to-build-the-perfect-dashboard-with-power-bi-28c35d6cd785/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nTips to build a killer dashboard in Power BI\n[Octavio Santiago](https://towardsdatascience.com/author/octaviobomfim/)\nJune 14, 20217 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/01/0xq7Fh__FzseNhI-9-scaled.jpg)](https://towardsdatascience.com/a-quick-introduction-to-bag-of-words-and-tf-idf-fbd3ab84ecbf/)\n## [A Quick Introduction to Bag of Words and TF-IDF](https://towardsdatascience.com/a-quick-introduction-to-bag-of-words-and-tf-idf-fbd3ab84ecbf/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nHow Machine Learning and Natural Language Processing Models Deal with Text\n[Brian Roepke](https://towardsdatascience.com/author/broepke/)\nJanuary 21, 20225 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/0wPuPwo1owYZodili-scaled.jpg)](https://towardsdatascience.com/applied-time-series-analysis-of-bike-accidents-in-madrid-1f199ed5fd/)\n## [Applied Time Series Analysis of Bike Accidents in Madrid](https://towardsdatascience.com/applied-time-series-analysis-of-bike-accidents-in-madrid-1f199ed5fd/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nYou will be safe cycling home\n[Antonio Ramos](https://towardsdatascience.com/author/antonioramosglz/)\nNovember 24, 20227 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/10/0NCddBNkEnlqCm3Oe-scaled.jpg)](https://towardsdatascience.com/learn-machine-learning-concepts-interactively-6c3f64518da2/)\n## [Learn Machine Learning Concepts Interactively](https://towardsdatascience.com/learn-machine-learning-concepts-interactively-6c3f64518da2/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nFive freely available tools that intuitively break down the complicated machine learning concepts\n[Parul Pandey](https://towardsdatascience.com/author/pandeyparul/)\nOctober 4, 20203 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/11/0FBbnCBivBYp2p1sq.jpg)](https://towardsdatascience.com/analyzing-twitter-conversations-4ce28080732e/)\n## [Analyzing Twitter Conversations](https://towardsdatascience.com/analyzing-twitter-conversations-4ce28080732e/)\n[Data Visualization](https://towardsdatascience.com/category/data-science/data-visualization/)\nGetting actionable insights around a topic using the new Twitter API v2 endpoint\n[Joe Zeoli](https://towardsdatascience.com/author/jzeoli/)\nNovember 18, 20215 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3642/image?etag=1780830904480&width=500&height=500) Check Your Biases ](https://towardsdatascience.com/check-your-biases-ba2685a7f799/ \"Check Your Biases\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4973/image?etag=1782232567105&width=500&height=500) Machine Learning Tricks, Learning with ChatGPT, and Other Recent Must-Reads ](https://towardsdatascience.com/machine-learning-tricks-learning-with-chatgpt-and-other-recent-must-reads-f277648a1921/ \"Machine Learning Tricks, Learning with ChatGPT, and Other Recent Must-Reads\")\n\n\nword word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word\n  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1\n",
  "metadata": {
    "title": "Python Lists: The Definitive Guide for Working With Ordered Collections of Data | Towards Data Science",
    "description": "A comprehensive guide on lists in Python",
    "keywords": null,
    "author": "Federico Trotta",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "Python Lists: The Definitive Guide for Working With Ordered Collections of Data",
    "og:description": "A comprehensive guide on lists in Python",
    "og:url": "https://towardsdatascience.com/python-lists-the-definitive-guide-for-working-with-ordered-collections-of-data-53b06a194826/",
    "og:site_name": "Towards Data Science",
    "og:image": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/07/1ykoOnRpQPHq46AjbS5CNeg.jpeg",
    "og:image:width": "1280",
    "og:image:height": "853",
    "og:image:type": "image/jpeg",
    "twitter:card": "summary_large_image",
    "twitter:site": "@TDataScience",
    "twitter:creator": "@TDataScience",
    "twitter:label1": "Written by",
    "twitter:data1": "Federico Trotta",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "11 min read",
    "article:published_time": "2023-07-19T14:01:34.000Z",
    "article:modified_time": "2023-07-19T14:01:34.000Z",
    "article:author": "https://towardsdatascience.com/author/federicotrotta/"
  },
  "paywall": {
    "listed_paid": true,
    "detected": false,
    "marker": "",
    "public_only": true,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": "",
    "retried": true
  },
  "code_blocks": [
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_000.txt",
      "chars": 361
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_001.txt",
      "chars": 111
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_002.txt",
      "chars": 126
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_003.txt",
      "chars": 220
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_004.txt",
      "chars": 239
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_005.txt",
      "chars": 349
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_006.txt",
      "chars": 153
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_007.txt",
      "chars": 196
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_008.txt",
      "chars": 93
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_009.txt",
      "chars": 188
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_010.txt",
      "chars": 175
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_011.txt",
      "chars": 174
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_012.txt",
      "chars": 244
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_013.txt",
      "chars": 199
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_014.txt",
      "chars": 184
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_015.txt",
      "chars": 180
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_016.txt",
      "chars": 173
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_017.txt",
      "chars": 147
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_018.txt",
      "chars": 229
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_019.txt",
      "chars": 185
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_020.txt",
      "chars": 129
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_021.txt",
      "chars": 241
    },
    {
      "language": "txt",
      "file": "attachments/30b9b64214f0/code/block_022.txt",
      "chars": 273
    }
  ],
  "images": [
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/07/1ykoOnRpQPHq46AjbS5CNeg.jpeg",
      "alt": "",
      "local_path": "attachments/30b9b64214f0/images/000.jpeg",
      "bytes": 199021,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2019/11/19BEw1JtTCTtwXwy3DYciaw.png",
      "alt": "",
      "local_path": "attachments/30b9b64214f0/images/001.png",
      "bytes": 337057,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2020/12/13WhyN7c9c_3urpV0cndGiQ.jpeg",
      "alt": "",
      "local_path": "attachments/30b9b64214f0/images/002.jpeg",
      "bytes": 674733,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2020/11/0omARYNl1JEpVbgR9.jpg",
      "alt": "",
      "local_path": "attachments/30b9b64214f0/images/003.jpg",
      "bytes": 119450,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/12/1TPgInsuM3qCc4iz7FB6kog.png",
      "alt": "",
      "local_path": "attachments/30b9b64214f0/images/004.png",
      "bytes": 62849,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2021/06/01oxtMaYqbQlebXmH.jpg",
      "alt": "",
      "local_path": "attachments/30b9b64214f0/images/005.jpg",
      "bytes": 65781,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2022/01/0xq7Fh__FzseNhI-9-scaled.jpg",
      "alt": "",
      "local_path": "attachments/30b9b64214f0/images/006.jpg",
      "bytes": 796043,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2022/11/0wPuPwo1owYZodili-scaled.jpg",
      "alt": "",
      "local_path": "attachments/30b9b64214f0/images/007.jpg",
      "bytes": 653596,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2020/10/0NCddBNkEnlqCm3Oe-scaled.jpg",
      "alt": "",
      "local_path": "attachments/30b9b64214f0/images/008.jpg",
      "bytes": 258664,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2021/11/0FBbnCBivBYp2p1sq.jpg",
      "alt": "",
      "local_path": "attachments/30b9b64214f0/images/009.jpg",
      "bytes": 100680,
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [],
  "links": [],
  "retry_at": "2026-10-03T08:01:19",
  "repair_version": 2,
  "repaired_at": "2026-10-14T11:11:49Z",
  "source_url": "https://towardsdatascience.com/python-lists-the-definitive-guide-for-working-with-ordered-collections-of-data-53b06a194826/",
  "delivery_status": "excluded_paid",
  "discovery_status": "excluded_paid",
  "missing_reason": "按原约定排除付费/会员全文"
}