Grouping Objects with Python Lists - Going Beyond an Initial Python Script

Опубликовано: 07 Сентябрь 2020
на канале: Nick DeRobertis
4,095
60

Grouping Objects with Python Lists

Part of the lecture series "Going Beyond an Initial Python Script":
https://nickderobertis.github.io/fin-...

Full Course Website:
https://nickderobertis.github.io/fin-...


Notes
--------

Lists are one of the basic container data types in Python. They hold other objects so we can work with them as a group
Lists hold objects one by one in order and objects can be looked up from the list using the numeric index of the object
It is a very common pattern to create an empty list, then go through some logic in a loop to create the object you want in the list and add it in each run of the loop
This numeric index is zero-based, so look up the first object by 0, the second object by 1, and so on.
We can pass a slice to get a group of objects out of the list as a new list or a single integer to get a single object out of the list
Negative numbers means count from the end of the list, -1 is last object, -2 is second to last object, and so on
Objects can be added to the list when it is created, but also later on using .append and .insert. Objects can be removed using .pop
Lab exercise 1 tests list building for loop pattern, 2 tests adding objects to lists, and 3 tests list indexing and slicing

Resources
------------

Python Basics: https://nickderobertis.github.io/fin-...
Python Basics Lab Exercises: https://nickderobertis.github.io/fin-...


На этой странице сайта вы можете посмотреть видео онлайн Grouping Objects with Python Lists - Going Beyond an Initial Python Script длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Nick DeRobertis 07 Сентябрь 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 4,095 раз и оно понравилось 60 зрителям. Приятного просмотра!