About 22,600,000 results
Open links in new tab
  1. Python - Access List Items - W3Schools

    Access Items. List items are indexed and you can access them by referring to the index number:

  2. Access List Items in Python - GeeksforGeeks

    Dec 16, 2024 · __getitem__() is a special method (also known as a dunder or magic method) in Python that allows us to access an element from an object using square brackets, similar to how we access items in a list, tuple, or dictionary.

  3. python - Access item in a list of lists - Stack Overflow

    You can access the elements in a list-of-lists by first specifying which list you're interested in and then specifying which element of that list you want. For example, 17 is element 2 in list 0 , which is list1[0][2] :

  4. How to access List elements in Python - Stack Overflow

    Aug 22, 2024 · I'd start by not calling it list, since that's the name of the constructor for Python's built in list type. But once you've renamed it to cities or something, you'd do: print(cities[0][0], cities[1][0]) print(cities[0][1], cities[1][1])

  5. python - How can I access elements of a list within a list?

    Jul 3, 2015 · So I wanted to retrieve certain values of an element of a list within a list without having to loop. For example, what would I do if I wanted to retrieve the value "no" from the second element of the variable message.

  6. Python - Access List Item - GeeksforGeeks

    Dec 12, 2024 · Python list slicing is fundamental concept that let us easily access specific elements in a list. In this article, we’ll learn the syntax and how to use both positive and negative indexing for slicing with examples.

  7. Python Lists - Python Guides

    Python Lists are ordered, mutable collections used to store multiple items. They can hold mixed data types and support indexing, slicing, and various built-in methods. ... You can access list elements using indexing. Python uses zero-based indexing, meaning the …

  8. Python List - Access Items - list[index], list[range] - Python

    Python List - Access Items. To access list items individually, you can use an index just like an array. You can also access a range of items in the list by specifying a range as an index. In this tutorial, we will go through examples to understand how …

  9. Python - Access List Items | SitePoint

    Explore how to access list items in Python effortlessly. Learn indexing, slicing, and practical methods to retrieve elements from lists with clear examples.

  10. Python List Operations

    In the following, you shall learn how to create lists in Python, like creating empty lists, creating list of specific data types, creating list of specify size, etc. The following tutorials cover how you could access items in a list in different ways, like accessing items in a …

Refresh