Python3 set set and data conversion functions

Source: Internet
Author: User
Tags set set shallow copy

Set set is a sequence of unordered, non-repeating elements

The basic function is to test the membership and remove duplicate elements.

Use the brace {} or set () function to create a collection, note: Creating an empty collection must be set () instead of {}, because {} is used to create a new dictionary.

Add (): Increase the collection element

Copy (): Shallow copy

Clear (): Empty collection

Difference ():

Difference_update (): Deletes all elements in the current set that are contained in CSET

Discard (): remove element

Intersection (): Take intersection to create a new collection

Intersection_update (): Take intersection to update the original set set

Isdisjoint (): Determines no intersection, returns True, returns false

Issubset (): Determine if it is a subset

Issuperset (): Determines whether the parent set

Python3 set set and data conversion functions

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.