A Dictionary of Python

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.