HOW do LISTS work in PYTHON? 📋 [with SOLVED EXERCISES] - PYTHON Course from SCRATCH #7

Published: 20 April 2021
on channel: Dimas
30,976
990

Want to learn how to use Lists in Python? Here I'll teach you everything you need! Come in to learn how to use lists and their methods with solved exercises.

Lists in Python are a native data type that allows us to store a set of values ​​or variables. They are similar to arrays or vectors in other programming languages, although much more flexible and with more features. Within Python lists, we can store different types of data or create a list of only one particular data type. Understanding them is essential, and they are used extensively in all kinds of programs.

We'll see many things, such as how to iterate over a list using a loop, how to access different positions in a list, and how to create sublists. Of course, we'll also see list methods.

List methods are functions with the ability to modify the list from which we are calling the method. For example, if I have: list = [0,1,2,3] and I execute the following instruction: list.append(4), the number 4 will be added to the end of the list variable: [0,1,2,3,4]. We'll see many more things like this, such as how to search for an element in a list in Python.

Finally, we'll do an exercise where we'll review the concepts learned in this video and previous ones. We'll search a text for how many times certain keywords, provided by the user, appear.

🎬 TIMESTAMPS:

00:00 - Introduction
01:20 - How to create a list in Python
01:45 - How to access an element in a list
02:10 - List length in Python
02:35 - How to iterate over a list
04:40 - List indexing
05:43 - Negative indices in Python lists
07:32 - Creating sublists in Python
12:36 - How to determine if an element belongs to a list
16:40 - How to modify elements in a list
19:40 - Modifying multiple elements in a list at once
24:14 - List methods in Python
26:51 - What does the `append` function do in Python?

30:32 - How to add one list to another in Python? 33:03 - How to remove items from a list
33:29 - The pop method
34:41 - The remove method
40:40 - The index method
41:14 - Solved exercise using lists

📚CODE AND REFERENCES:
Course code: https://github.com/dimas-avila/curso-...
Visual Studio Code (Code editor): https://code.visualstudio.com/download

🟡IF YOU WANT TO SUPPORT THIS CHANNEL:

My Amazon affiliate link: https://amzn.to/3ossyBA
My SiteGround affiliate link: https://www.siteground.com/index.htm?...
Mini-project: https://www.parateletrabajo.es/
A blog about remote work.


On this page of the site you can watch the video online HOW do LISTS work in PYTHON? 📋 [with SOLVED EXERCISES] - PYTHON Course from SCRATCH #7 with a duration of hours minute second in good quality, which was uploaded by the user Dimas 20 April 2021, share the link with friends and acquaintances, this video has already been watched 30,976 times on youtube and it was liked by 990 viewers. Enjoy your viewing!