Python lists - Full Tutorial in 12 minutes | Python list properties | python list methods | usages
Python lists full tutorial. One of the key things to understand when you're learning a new programming language is how to handle a collection of items. In real life applications, you're always needed to write programs that handle lists of items. You can see lists everywhere. In this video, we're going to look at how Python handles lists. Python has 4 in-built data types for handling collections of items.
1. Python Lists
2. Python Tuples
3. Python Sets
4. Python Dictionaries
In this video, we're going to look at Python lists.
But when it comes to Python list data structure, it can be a bit initimidating to look at the code written by others.
To summarize what is covered in the video.
First thing to understand is - what are python lists?
What are python lists?
Properties of python lists
- Python list is a basic sequence type, which means you'll be able to use functions like len() to find the length of a list object, and you use functions like min() and max().
- Python lists are mutable, which means it is possible to add, remove or update items in a list. We will be seeing how to do that later on.
- Python lists are ordered which means the order of input to the list object is maintained when we access them.
- Python lists are dynamic which means that lists don't have a fixed size and it can grow if you keep adding elements to your list.
- Python lists can contain duplicates.
- Python lists are heterogenous, which means you can add values of different data types into a python list and it still would not throw errors.
Consider these properties before you choose Python lists as your data structure. Let's say, if you want to define a list of items that should not be changed after creation, Python lists are probably not your best option, maybe you'll need to look into something like Python tuple instead.
How to access python lists?
This video covers how to access python lists using different types of indexing like negative indexing, different types of slicing.
How to check if an item exists in a python list?
This video covers the usage of "in" and "not in" keywords.
What are sequence operations inherited by python lists?
Python list is a sequence type. Therefore, it supports certain operations that all sequences have, like len() which will give you the length of a list. This video covers the usage of functions like max(), min(), index(), count()
max() returns the maximum number in a python list
min() returns the minimum number in a python list.
list.count() returns the number of occurences of an item in a list.
list.index() returns the index of the first occurence of an item in a list.
List methods
This video covers methods like append(), extend(). extend() can be applied on any python sequence like python tuple.
copy(), insert(), pop(), remove(), reverse, sort(), sort on objects.
List Comprehensions
List comprehension provides a syntax to create new lists based off the values from an existing list.
This video covers an example on list comprehension.
Timestamps
00:00:00 Introduction
00:00:55 Creating a Python list
00:01:25 Properties of Python lists
00:02:56 Accessing elements in Python list
00:05:50 Sequence Operations for Python List
00:07:00 Python List Methods
00:11:04 Python List comprehension
References:
------------------
https://towardsdatascience.com/a-complete-guide-to-python-lists-6b592c8d5707
https://www.w3schools.com/python/python_lists.asp
Music: bensound.com
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Python lists - Full Tutorial in 12 minutes | Python list properties | python list methods | usages», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.