Sling Academy
Home/Python/Python List Tutorials (Basic and Advanced)

Python List Tutorials (Basic and Advanced)

In Python, lists are ordered collections of items enclosed in square brackets ([]). They are versatile and dynamic data structures that can hold elements of different data types. Lists provide flexibility for storing and manipulating data as they allow for adding, removing, and modifying elements.

In this series of tutorials, you’ll learn to solve almost every problem related to lists in Python. The articles are arranged in order from basic to advanced, from simple to complex. They can be read separately. You can skip the topics that you already know and go straight to the areas where you are stuck or don’t have enough confidence. That will save you more time.

1 How to Create a List in Python (4 Approaches)

2 List Comprehension in Python: Tutorial & Examples

3 Python: How to Access Elements in a List

4 Python: 6 Ways to Iterate Through a List (with Examples)

5 Python: Counting the Number of Elements in a List (4 Examples)

6 Python: How to Check If a List Is Empty (3 Approaches)

7 Python: Replacing/Updating Elements in a List (with Examples)

8 Ways to Combine Lists in Python

9 Python: 3 Ways to Select Random Elements from a List

10 Python: How to Remove Elements from a List (4 Approaches)

11 Python: How to Find All Occurrences of a Value in a List

12 How to Reverse a List in Python (with Examples)

13 Python: Find the Min and Max in a Numeric List (4 Ways)

14 Python: 4 Ways to Find the Sum of a Numeric List

15 Python: How to Calculate the Average of a Numeric List

16 Using the list.insert() method in Python

17 Sorting Lists in Python (4 Examples)

18 Working with Nested Lists in Python (5 Examples)

19 Python: How to Flatten a Nested List (3 Approaches)

20 Cloning a List in Python (Deep Copy & Shallow Copy)

21 Python: How to Remove Duplicates from a List (with Examples)

22 Filtering Lists in Python (4 Examples)

23 Python reduce() function: Tutorial & examples

24 Python: 2 Ways to Find Common Elements in 2 Lists

25 Python: How to Swap 2 Elements in a List (2 Approaches)

26 Python: How to Compare 2 Lists (3 Approaches)

27 Python: Checking If a List Contains an Element (3 Approaches)

28 Shuffling a List in Python (4 Approaches)

29 Python: 3 Ways to Find the Product of a Numeric List

30 Python: Count the Occurrences of Elements in a List (3 Ways)

31 Python: How to loop through 2 lists in parallel (3 ways)

32 Python map() function: Tutorial & examples

33 Python: Separate a List into Equally Sized Chunks

34 Python: Declaring Lists with Type Hints (7 Examples)

35 Python: Passing a List to a Function as Multiple Arguments

36 Python: Generate a Dummy List with N Random Elements

37 List element-wise operations in Python

38 Python: Defining type for a list that can contain both numbers and strings

39 Python IndexError: List index out of range

40 Python: Define Generic Types for Multidimensional List

41 Python: Using type hints with map() function – Examples