Dictionary
Dictionaries, as the name implies, are similar to those of the Xinhua dictionary in our Lives. So since it is also called a dictionary in Python, there must be some connection between the two. First of all, let's think about the way we use dictionaries in general. According to pinyin search, according to the radical search and so on ... So the question is, how do we use the dictionary in Python?
How do I use the dictionary?
In Python, we use a key-value pair, which is the way to Key-value. Each key corresponds to one or more or 0 value, and each key is unique in a dictionary. Unlike the list, the dictionary is unordered, but to implement the query, we rely on key-value, only to find the key we can continue to find the value we need. The ID of our key in memory is a series of numbers that the computer uses to find these numbers for the next steps.
The basic functions of diction
We now have the following dictionary:
dic={"name": "Tom", "age": +, "phone": 123 }
Some basic features of the dictionary are described here:
1. Increase
dic[' sex ' = ' man '
2. Delete
A Dictionary of Python