As you can see from the previous sections, Python is the most basic type of programming language.
It can be seen that the granularity of segmentation in data structure is to satisfy the need of more domain programming.
1 Creating a dictionary
Other methods, such as list and tuple, can also be created, see the manual. The keys of a dictionary are non-repeatable and are somewhat similar in nature to the set of set,dict that can be understood as carrying values. Of course Dict does not have a set operation method (intersection, set, difference set, etc.).
2 Reading and writing dictionaries
a_dict[' database ' = ' blog ' #database键如不存在表示增加, exists is to change the value
Reading a nonexistent key throws a Keyerror exception.
3 except for strings, read-only types can be used as keys to dictionaries
suffixes = {: [' KB ', ' MB ', ' GB ', ' TB ', ' PB ', ' EB ', ' ZB ', ' YB '], 1024x768: [' KiB ', ' MiB ', ' GiB ', ' TiB ', ' PiB ', ' EiB ', ' ZiB ', ' Yib ']}
4 Boolean Test
{} indicates false, non {} indicates true
5 None
Like other languages, NULL, which belongs to the Nonetype type, has only one value.
At the Boolean test plane none is False,not none is true.
Python 3 Grammar Note (5): Dictionary