Home  >  Article  >  Backend Development  >  Are python collections mutable?

Are python collections mutable?

silencement
silencementOriginal
2019-05-23 09:20:555546browse

Are python collections mutable?

A set is an unordered sequence of non-repeating elements. Python collections include mutable collections and immutable collections.

You can use curly brackets { } or the set() function to create a set. Note: To create an empty set, you must use set() instead of { }, because { } is used to create an empty dictionary.

Creation format:

Are python collections mutable?

The following is an example of demonstration

Are python collections mutable?

Are python collections mutable?

The above is the detailed content of Are python collections mutable?. 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