Skip to content
Advertisement

Python: can I have a list with named indices?

In PHP I can name my array indices so that I may have something like:

JavaScript

Is this possible in Python?

Advertisement

Answer

This sounds like the PHP array using named indices is very similar to a python dict:

JavaScript

See http://docs.python.org/tutorial/datastructures.html#dictionaries for more on this.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement