Home  >  Article  >  Backend Development  >  Summarize the points to note about frozenset

Summarize the points to note about frozenset

巴扎黑
巴扎黑Original
2017-06-15 16:26:382510browse

Set: It combines different elements to form a set, which is the basic data type of python. Collection classification: mutable set (set), immutable set (frozenset), the creation method is the same. Collection characteristics: disordered, unique, fast 1. Create a set>>> s =set('ian')> >> s{'a', 'n', 'i'}>>> len(s)3>>> li =['apple','pear','peach']> ;>> s =set(li)>>> s{'peach', 'pear','apple'}>>> len(s)3 2. Accessing the collection Since the collection itself is Unordered, so it cannot be a set

1. Basic content of Python: Set

Summarize the points to note about frozenset

Introduction: Set: It combines different elements to form a set, which is the basic data type of python. Collection classification: mutable set (set), immutable set (frozenset), the creation method is the same. Collection characteristics: disordered, unique, fast 1. Create a set>>> s =set('ian')> >> s{'a', 'n', 'i'}>>> len(s)3>>> li =['apple','pear','peach']> ;>> s =set(li)>>> s

2. Detailed introduction to Python’s built-in frozenset function

Summarize the points to note about frozenset

Introduction: This article explains in detail the detailed introduction of Python’s built-in frozenset function

3. Introduction to python core data types

Summarize the points to note about frozenset

## Introduction: Overview Numbers: int, long, float, complex, bool character: str, unicode list: list dictionary: dict tuple: tuple file: file other types: set (set), frozenset, class type, None other file type tools: pipes (pipes), first-in-first-out pipes (fifos) ,...

4. Python built-in function——set&frozenset

Summarize the points to note about frozenset

##Introduction: If you need the sample code of Python built-in function-set&frozenset, you can refer to it

[Related Q&A recommendations]:

The above is the detailed content of Summarize the points to note about frozenset. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn