Lesson: Python Dictionary
Well, dictionary essentially is used to store information. Dictionary stores not
only related information, a buch of different data values can be
stored in the list and organise for later retrieval, just like array in Java,
Javascript, PHP and other programming languages; data are stored
in dictionary and keep tract and access the dictionay value pair anytime.
data are stored and accessed in the dctionary by means of key value pair,
through which storage and accessibility of data is made possible.
Values are stored in a list with each having and index number.
It is through this index that any list member
could be accessed and called for further data proccessing.
Without the index, accessing list values would not be possible.
Syntax for creating a list is:
list name = [values] .
In the box below, let us create a book list and do some data proccessing
on it.
List of books
books = ["Biology", "Physics", "Chemistry", "Geograpy"]
Explanations:
We have created a variable called 'books'
and put its values in a list. This list contains four different
book elements which is refered to as list values - biology, physics,
Chemistry, and geography books. At this stage, we can do a lot of things
with this list, we can modify this list in many ways. We can modify
the list, we can add, delete, and update the list members;
we can also delete the entire list.