The index(), count() and other "functions" you mention aren't standalone functions, they are methods of lists. That means you apply them to the list, like this: test = [1, 2, 3, 4, 5, 6] print(test.index(3)) # print index in list of the element of value 3 The list methods are described in the documentation . Answer from Deleted User on reddit.com
🌐
W3Schools
w3schools.com › python › ref_list_index.asp
Python List index() Method
Remove List Duplicates Reverse ... Q&A Python Bootcamp Python Training ... The index() method returns the position at the first occurrence of the specified value....
🌐
Reddit
reddit.com › r/learnpython › w3schools lists tutorials; half of the functions they use don't seem to work?
r/learnpython on Reddit: w3schools lists tutorials; half of the functions they use don't seem to work?
October 2, 2023 -

Total newbie here. Just been doing some basic exercises and I think the site I'm using is missing some advice, but its such a basic problem I've had no luck googling.

https://www.w3schools.com/python/python_lists.asp

Here they have a list of functions for working with lists; "index()"; "count()"; etc. and implies that these are "built in". However my Python install (3.11.5) doesn't have them as core. I assume I just need to import a module but w3 doesn't tell me which module to import.

Am I right? If so which module is it? I assume its really basic common knowledge.

Thanks x

List/Function Logic Error Apr 1, 2024
r/learnpython
2y ago
How "list" is implemented in Python? Aug 26, 2024
r/learnpython
last yr.
Quick question on w3schools Dec 17, 2025
r/learnprogramming
7mo ago
More results from reddit.com
Discussions

Learning about list functions - Creating a new list from index values
You could try using a zip() to combine the two lists and then filter from that. It will end up looking something like: For index, value in zip(input_list, value_list): I’ll let you carry on from there, but it essentially works the same way as unpacking a dictionary’s .items() Hope this gets you going in the right direction Edit ::: link for .zip() explanation https://www.w3schools.com/python/ref_func_zip.asp More on reddit.com
🌐 r/learnpython
7
1
November 20, 2022
W3Schools - How useful are they?
I wouldn't recommend them that much, as they're more of a trick learner than an explanatory learning resource. Therefor I consider them more as a knowledge base than a good starting point to learn the language. Instead I would suggest to check out the list at r/learnpython/w/index at 'new to programming', there should be some that work well on a phone too. More on reddit.com
🌐 r/learnpython
11
5
January 4, 2021
🌐
Programiz
programiz.com › python-programming › methods › list › index
Python List index()
The index() method returns the index of the given element in the list.
🌐
w3resource
w3resource.com › python › list › index_method.php
Python List index() Method
April 14, 2026 - Python List - index() Method: The index method() is used to get the zero-based index in the list of the first item whose value is given.
🌐
DataCamp
datacamp.com › tutorial › python-list-index
Python List index() Method Explained with Examples | DataCamp
March 28, 2025 - This function is especially useful ... Master Python for data science and gain in-demand skills. ... The method index() returns the lowest index in the list where the element searched for appears....
🌐
Codecademy
codecademy.com › docs › python › lists › .index()
Python | Lists | .index() | Codecademy
June 11, 2025 - The .index() method is a built-in Python list method that returns the index position of the first occurrence of a specified element within a list.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-list-index
Python List index() - Find Index of Item - GeeksforGeeks
Explanation: a.index("dog") searches for "dog" in the list and element is found at index 1, so 1 is returned.
Published   1 day ago
Find elsewhere
🌐
Du
cs.du.edu › ~intropython › intro-to-programming › list_methods.html
List methods - Introduction to Programming
The call your_list.index(x) searches for the value x in your_list. It then returns an int which is the index of the first time that value appears in the list. One down side of the index() method is that x must be in the list - if it isn't then a ValueError results.
🌐
W3Schools
w3schools.com › python › python_lists_access.asp
Python - Access List Items
When specifying a range, the return value will be a new list with the specified items. ... thislist = ["apple", "banana", "cherry", "orange", "kiwi", "melon", "mango"] print(thislist[2:5]) Try it Yourself » · Note: The search will start at index 2 (included) and end at index 5 (not included). Remember that the first item has index 0.
🌐
W3Schools
w3schools.com › python › ref_tuple_index.asp
Python Tuple index() Method
The index() method finds the first occurrence of the specified value. The index() method raises an exception if the value is not found. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: ...
🌐
Simplilearn
simplilearn.com › home › resources › software development › python index: mastering list indexing techniques
Python List index() Method Explained with Examples
1 month ago - The Python index() method helps you find the index position of an element or an item in a string of characters or a list of items.
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
Skill Matrix Academy
skillsmatrixacademy.com › home › python list index() method explained with practical examples
Python list index() Method Explained with Practical Examples
November 7, 2025 - The index() Function helps you find the position of an element in a list or string. It searches for the first match and returns its index number (or position). ... This will output 2, because in Python indexing, the count starts at 0.
🌐
Analytics Vidhya
analyticsvidhya.com › home › how can i manipulate python list elements using indexing?
How can I Manipulate Python List Elements Using Indexing?
January 22, 2024 - The index() function, a built-in method in Python, returns the index of the first occurrence of a specified element in a list:
🌐
Tutorialspoint
tutorialspoint.com › python › list_index.htm
Python List index() Method
The Python List index() method is used to retrieve the lowest index in a list at which a specified object appears. The object can be anything; a single element or a collection of elements in the form of another list, tuple, set etc.
🌐
freeCodeCamp
freecodecamp.org › news › indices-of-a-list-in-python-list-indexof-equivalent
Indices of a List in Python – List IndexOf() Equivalent
April 6, 2023 - Python has several methods and hacks for getting the index of an item in iterable data like a list, tuple, and dictionary. In this article, we are looking at how you can get the index of a list item with the index() method. I’ll also show ...
🌐
TUHH
www3.tuhh.de › sts › hoou › data-quality-explored › 0-5-3-lists.html
Lists and indexes — Data Quality Explored
Appending multiple elements to a list would create a sublist. To avoid a nested list then the extend( ) function can be used. ... index( ) is used to find the index value of a particular element.
🌐
Toppr
toppr.com › guides › python-guide › references › methods-and-functions › methods › list › index › python-list-index
Python List index() function | Why do we use Python list index() function? |
September 20, 2021 - The Python list index() function is used to return the index value of the specified element in the list. The Python list index() is a built-in function that searches for a specified element from the beginning of the list and returns the lowest ...
🌐
Analytics Vidhya
analyticsvidhya.com › home › python list index: a guide to finding and manipulating list elements
Python List Index: A Guide to Finding and Manipulating List Elements
January 23, 2024 - The `index()` function is a built-in method in Python that returns the index of the first occurrence of a specified element in a list.
🌐
Sentry
sentry.io › sentry answers › python › get the index of a list item in python
Python Index of Item in List Using list.index() | Sentry
2 weeks ago - We can use Python’s list.index() method to return the index of a given item: mylist = ["run", "hop", "bop"] print(mylist.index("hop")) # will print 1 · If the given item is not found in the list, a ValueError will be raised.
🌐
H2K Infosys
h2kinfosys.com › blog › understanding python list index with example
Understanding Python list Index with Example | H2K Infosys Blog
January 8, 2026 - Python lists make this process intuitive and efficient. The index() method is used to find the index of a list. There are several other methods to return the list index, but the easiest is the index() method.