List elements are numbered, like the houses in a street, but starting at 0 (so that the last element of a list of n elements is actually number n-1). The indexing operator (a pair of square brackets) allows you to read or write a particular element of a list; conveniently, it can also be applied to retrieve individual characters in a string. The "len" function lets you know how many elements there are in a list, and you can use an indexing technique known as "slicing" to extract entire sub-lists. For more information, see the notebooks below (notebooks will open on Google Colab - no installation required)
Embedded video, part of the following courses:
Computer Programming at Queen Mary, University of London
Jupyter notebook: https://tinyurl.com/3xjmpf94
Coding for Scientists at Queen Mary, University of London
Jupyter notebook: https://tinyurl.com/yedumefr
Смотрите видео Accessing list elements: indexing and slicing in Python. онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь PatchyPython 06 Сентябрь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 88 раз и оно понравилось 0 людям.