Python Learning DAY05

Source: Internet
Author: User

Dictionary
Use {} to represent
Keys must be hash-
Key-value pair data {Key:value}
Key must be unique.
Increase
Dic[key] = value
Dic.setdefault (Key,value) does not exist, operates on
Delete
Pop (key) can return the deleted value
Del Dic[key]
Popitem () Random deletion
Clear ()
Change
Dic[key] = value
Dic.update (dict) Upgrade dictionary
Check
Get (Key)
Dic[key]
You can use a for loop
SetDefault (Key)
Keys gets to the list of key deposit high imitations
Values gets the value to be stored in the list of high imitations
Items gets all the key-value pairs into a meta-ancestor
Nesting
Enter as key value into nested

Python Learning DAY05

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.