DEV Community

I'm Just a Guy with a Computer
I'm Just a Guy with a Computer

Posted on

Dictionaries datatype in Python.

A dictionary is a collection of many values that are ordered,changeable and do not allow duplicates.

Enter the following into interactive shell to get a look of how a dictionary works:

>>> epl = {'chelsea':'south-London','Arsenal':'North-London','Liverpool':'maryside'}
Enter fullscreen mode Exit fullscreen mode

you can acces values through their keys:

>>> epl['chelsea']
'south-London'
>>>
Enter fullscreen mode Exit fullscreen mode

Inclusion dictionaries uses keys and associated with key-value pair to access the position of a certain key-value unlike indexes in lists , also in code dictionaries are type with curly braces.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more