Languages
[Edit]
EN

Python - access list items

0 points
Created by:
mkrieger1
726

In this article, we would like to show you how to access list items in Python.

Quick solution:

 

1. Positive indexing

Edit

In this example, we use positive indexing to access list items by refering to the specific index number. We start from index 0 that refers to the first item.

Output:

2. Negative indexing

Edit

In this example, we use negative indexing to access list items by refering to the specific index number. We start from index -1 that refers to the list item.

Output:

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Python - list (popular problems)

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join