Negative Indexing lists in Python to prevent index out of range

Опубликовано: 15 Октябрь 2023
на канале: Python for Everyone
195
3

To get the the last element of a list, you have to use the length of the list and subtract one. But what if Python can do this for you? Yes, negative indexing is just that!

C H A P T E R S
0:30 Get the last element by index
1:40 Last element by using the length of the list
1:58 Last element by using a negative index

M Y O N L I N E T R A I N I N G
🎓Want to learn more tips and tricks about Python lists? Enroll in my udemy course here: https://pythonforeveryone.com/python-...

#negativeindex #programming #python


Смотрите видео Negative Indexing lists in Python to prevent index out of range онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Python for Everyone 15 Октябрь 2023. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 195 раз и оно понравилось 3 посетителям.