How to Code PYTHON: Working with *List in Data Structures*
Let's get started! ??? In this video, we will write a few PYTHON ? scripts to show how we can use *List as a data structure* to manage data in applications. Using a list in this tutorial, we can add and remove items, and reference single items or slices of items. In this tutorial, you will learn some basics in about 10 minutes!
In this video, you will learn how to:
★ 0:09 Create a list of values with the same data type.
★ 1:13 Create a list of values with different data types.
★ 2:13 Create an empty list.
★ 2:36 Use an index to access an item.
★ 4:31 Access an item by using an index that doesn't exist in a list.
★ 5:26 Create a slice by defining a range of items.
★ 8:28 Reverse and sort a list.
Tips and Tricks:
► We could create a list by using square brackets [], use a comma to separate each item, like [1,2,3].
►The data in the list can be of any data type though items in the same list are usually of the same type.
► Keep in mind the index is zero-based. The first item has an index 0 if accessing items relative to the beginning of the list. The last item has an index -1 if accessing items to the end of the list.
► To avoid "IndexError: list index out of range", be sure to check the length of the list using len() before accessing the item by the index.
► Slices can be created by using square brackets and a colon. The slice syntax uses a colon (:) to separate the beginning of the slice, on the left, and the end of the slice, on the right.
For example:
[1:3] is a slice starting at index 1 and excluding index 3, meaning 2nd and 3rd items.
[:4] is a slice starting at index 0 to index 4, meaning 1st to 5th items.
[6:] is a slice starting at index 6 to the end of the list, meaning 7th item to the last item of the list.
► reverse() and sort() functions reverse the list's order and sort it alphabetically.
WANT MORE PYTHON TUTORIALS?
? Python Coding for Beginners:
https://www.youtube.com/playlist?list=PLYnuuwG097TxI0viOUfWD7sx_D_wRsGbo
For the setup, please read the followings before you begin:
1. Download latest Python: https://www.python.org/downloads/
2. Install Python and remember to select "Add Python... to PATH" when asked.
3. Download and install latest Visual Studio Code: https://code.visualstudio.com/Download
4. Install the Python extension for Visual Studio Code: Go to View and select Extensions, or select the Extensions icon, then search for python.
Python - a programming language used by world-class companies such as Amazon.com, Alphabet (Google), Facebook, Twitter, and NASA.
? SUBSCRIBE TO CODING WITH KIDS ?????? YOUTUBE CHANNEL NOW ?
https://www.youtube.com/channel/UCsPTo-vWxs0uBa2ZdPd9Y_Q?sub_confirmation=1
#CodingWithKids #PythonProgramming #PythonForBeginners
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «How to Code PYTHON: Working with *List in Data Structures*», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.