W3Schools
w3schools.com › python › ref_func_list.asp
Python list() Function
The list() function creates a list object. A list object is a collection which is ordered and changeable. Read more about list in the chapter: Python Lists. ... If you want to use W3Schools services as an educational institution, team or enterprise, ...
W3Schools
w3schools.com › python › python_lists_methods.asp
Python - List Methods
Python Functions Python Arguments Python *args / **kwargs Python Scope Python Decorators Python Lambda Python Recursion Python Generators Code Challenge Python Range
w3schools lists tutorials; half of the functions they use don't seem to work?
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 . More on reddit.com
Not Understanding Python Example of Recursion from W3Schools
I am reading that as result = 6+ tri_recursion(6 - 1) Which is correct, but what is happening then? You enter the next recursion depth as tri_recursion(5) which because 5 > 0 calls 5 + tri_recursion(5 -1) Brings us to the next depth level as tri_recursion(4) -> 4 + tri_recursion(4-1) Next level: 3 + tri_recursion(3 - 1) -> 3 + tri_recursion(2) Next: 2 + tri_recursion(2 - 1) -> tri_recursion(1) Next: 1 + tri_recursion(1 - 1) -> tri_recursion(0) For tri_recursion(0)´ the conditionk > 0is no longer satisfied and thus theelsebranch is executed which executesreturn(0)` With this return we move one level back in the recursion to result = 1 + tri_recursion(1 - 1) -> we have the return value from the tri_recursion(1 - 1) call, which is 0 -> so it becomes result = 1 + 0 -> result = 1 The next executed line in the code is print(result) -> which prints the 1 The else´ branch is skipped and the next executed line isreturn resultwhich brings us one level back up to2 + tri_recursion(2 - 1)- the return value from before is1, so it becomes2 + 1->3` which is what is printed. And this goes on until you are back out of all levels. That is what recursion is. More on reddit.com
Am I the only person who thinks W3schools isn't a great resource to learn?
I think people who know the basics and go to w3 to refresh stuff recommend it but they themselves didn't learn it there. More on reddit.com
Shuffling a list
The line in bold is what is giving me an error It's a good idea to post the full error message when asking for help with an error. Besides that i assume you are trying to shuffle a string, you can't do that in python. You need to shuffle a list, and then rejoin it back to a string. pass_list = list(password) random.shuffle(pass_list) password = "".join(pass_list) print(password) More on reddit.com
Videos
13:20
How to Use Lists in Python | How to Work with Lists in Python - ...
12:09
All Python List Methods in 12 Minutes - YouTube
09:23
ALL 11 LIST METHODS IN PYTHON EXPLAINED - YouTube
01:39
HTML - Lists - W3Schools.com - YouTube
03:57
Join Lists - Python Tutorial - w3Schools - Ch#26 English - YouTube
W3Schools Python | W3Schools Python tutorial | W3Schools ...
W3Schools
w3schools.com › python › python_ref_list.asp
Python List/Array Methods
Python Functions Python Arguments Python *args / **kwargs Python Scope Python Decorators Python Lambda Python Recursion Python Generators Code Challenge Python Range
W3Schools
w3schools.com › python › python_lists.asp
Python Lists
List is a collection which is ordered and changeable. Allows duplicate members. Tuple is a collection which is ordered and unchangeable. Allows duplicate members. Set is a collection which is unordered, unchangeable*, and unindexed.
W3Schools
w3schools.com › python › python_lists_comprehension.asp
Python - List Comprehension
You can use the range() function to create an iterable: newlist = [x for x in range(10)] Try it Yourself » ... The expression is the current item in the iteration, but it is also the outcome, which you can manipulate before it ends up like a list item in the new list: ... The expression can also contain conditions, not like a filter, but as a way to manipulate the outcome: ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com
W3Schools
w3schools.com › python › python_lists_exercises.asp
Python - List Exercises
Python Functions Python Arguments Python *args / **kwargs Python Scope Python Decorators Python Lambda Python Recursion Python Generators Code Challenge Python Range
W3Schools
w3schools.com › python › python_dsa_lists.asp
Python Lists and Arrays
In Python, lists are the built-in data structure that serves as a dynamic array.
W3Schools
w3schoolsua.github.io › python › python_lists_methods_en.html
Python List Methods. Lessons for beginners. W3Schools in English
Python - List Methods. Python has a set of built-in methods that you can use on lists. Examples. Lessons for beginners. W3Schools in English
Du
cs.du.edu › ~intropython › intro-to-programming › list_methods.html
List methods - Introduction to Programming
The full list can be found at Python list documentation by w3schools or Offical python documentation on list methods. Here are the list methods you'll learn: the count() and index() methods for counting and searching · theinsert() and extend() methods for adding elements · the pop() and remove() methods and the del keyword for removing elements · the reverse() and sort() methods and the sorted() function for rearranging elements
W3Schools
w3schools.com › python › python_lists_access.asp
Python - Access List Items
thislist = ["apple", "banana", "cherry"] if "apple" in thislist: print("Yes, 'apple' is in the fruits list") Try it Yourself » ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
W3Schools
w3schools.am › python › python_lists.html
Python Lists
You will learn more about for loops in our Python For Loops Chapter. To determine if a specified item is present in a list use the in keyword: ... thislist = ["apple", "banana", "cherry"] if "apple" in thislist: print("Yes, 'apple' is in the fruits list") Run example » · To determine how many items a list has, use the len() function:
W3Schools
w3schools.com › python › gloss_python_function_passing_list.asp
Python Passing a List as an Argument
Remove List Duplicates Reverse a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... You can send any data types of argument to a function (string, number, list, dictionary etc.), and it will be treated as the same data type inside the function.
Programiz
programiz.com › python-programming › methods › built-in › list
Python list()
text = 'Python' # convert string to list text_list = list(text) print(text_list) # check type of text_list print(type(text_list)) # Output: ['P', 'y', 't', 'h', 'o', 'n'] # <class 'list'>
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
Top answer 1 of 2
4
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 .
2 of 2
1
Can you mention explicitly what you've done and how Python reacts? I have 3.11.5, and the builtin list functions you've mentioned work just fine. >>> b = ['apple', 'banana', 'apple', 'cherry'] >>> b.count('apple') 2 >>> b.index('banana') 1
W3Schools
w3schools.com › python › python_lists_loop.asp
Python - Loop Lists
Learn more about for loops in our Python For Loops Chapter. You can also loop through the list items by referring to their index number. Use the range() and len() functions to create a suitable iterable.
DataCamp
datacamp.com › tutorial › python-list-function
Python List Functions & Methods Tutorial and Examples | DataCamp
December 19, 2022 - The main characteristics of Python lists are that they are iterable, ordered, indexed, mutable, and allow duplicated values. Place a sequence of items inside square brackets and separate them by comma, e.g., ['cake', 'ice-cream', 'donut']. Alternatively, use the list() built-in function with double brackets: list(('cake', 'ice-cream', 'donut')).
GeeksforGeeks
geeksforgeeks.org › python › list-methods-python
Python List methods - GeeksforGeeks
... pop(): Removes and returns the element at the specified position (or the last element if no index is specified). remove(): Removes the first occurrence of a specified element. reverse(): Reverses the order of the elements in the list. sort(): ...
Published July 23, 2025
W3Schools
w3schools.com › python › python_ref_functions.asp
Python Built-in Functions
Remove List Duplicates Reverse a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... Python has a set of built-in functions. ... If you want to use W3Schools ...