WEBVTT

00:00.000 --> 00:03.000
We'll explore a key concept in programming.

00:03.000 --> 00:04.000
List.

00:07.000 --> 00:11.000
And by the end, you'll be able to, working with lists,

00:11.000 --> 00:15.000
storing multiple items together, create and modify a list.

00:18.000 --> 00:20.000
What is a list?

00:20.000 --> 00:24.000
A list in Python is like a box that can hold multiple items.

00:24.000 --> 00:28.000
You can store different things, like numbers, words,

00:28.000 --> 00:31.000
or even other lists.

00:31.000 --> 00:34.000
How to create a list.

00:34.000 --> 00:37.000
You create a list by using square brackets and separate

00:37.000 --> 00:40.000
each item inside the list with a comma.

00:42.000 --> 00:44.000
Examples of list.

00:44.000 --> 00:47.000
You can create a list of R of tasks you need to do after school.

00:47.000 --> 00:51.000
You can organize them like this, tasks equals square brackets.

00:51.000 --> 00:55.000
Finish work, comma, walk, comma, play.

00:55.000 --> 01:01.000
Here tasks is the name of the list, and the items are separated by commas.

01:01.000 --> 01:06.000
Type print opening curve, tasks, close curve.

01:06.000 --> 01:11.000
Run the code, you will see the items in the list in the console.

01:11.000 --> 01:15.000
Accessing items in a list.

01:15.000 --> 01:21.000
To access items, you use their index, starting from zero.

01:21.000 --> 01:27.000
Print opening curve tasks, square brackets, two, close curve.

01:27.000 --> 01:31.000
Click on run to execute the code play.

01:31.000 --> 01:35.000
Adding and removing items from a list.

01:35.000 --> 01:44.000
To add an item to a list, you can use the dot append method, tasks dot append, read, print tasks.

01:44.000 --> 01:47.000
Click on run to execute the code.

01:47.000 --> 01:50.000
To remove an item, use the dot remove method.

01:50.000 --> 01:55.000
Type tasks dot remove, walk, print tasks.

01:55.000 --> 01:58.000
Click on run to execute the code.

01:58.000 --> 02:02.000
Try creating a list of your favorite foods or a to-do list for practice.

02:02.000 --> 02:07.000
In Python, lists are a powerful way to organize and manage multiple items.

02:07.000 --> 02:10.000
Keep exploring.

