Getting Started with Python basics-dictionaries

Source: Internet
Author: User

Today, let's look at some common uses of dictionaries in Python. As for the study of dictionaries, we should know the definition and differences of dictionaries and the characteristics of other data structures, commonly used methods of operation. All right, let's get to the business!

1. Dictionary definitions

A dictionary is surrounded by curly braces, elements exist in the form of key-value pairs, and elements are separated by colons to become one of the data structures. is also the only data structure that has a mapping relationship. Keywords: key-value pairs, curly braces, variable, one of the series.

2. Dictionary Features
    1. Disordered
    2. Variable
    3. When there are duplicate keys to produce the default hold last
    4. To access a value by key
3. Dictionary common operation methods
    1. Create, access, modify, delete
    2. Keys ()
    3. VALUES ()
    4. Items ()
    5. Pop ()
    6. Popitems ()
    7. Update ()
    8. Get ()
    9. SetDefault ()
    10. Zip ()
1) Create, access, modify, delete

2)

3)

4)

5)

6)

7)

8)

9)

10)

Getting Started with Python basics-dictionaries

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.