Home  >  Article  >  Backend Development  >  What does tuple mean in python?

What does tuple mean in python?

藏色散人
藏色散人Original
2019-06-26 09:42:1439309browse

What does tuple mean in python?

What does tuple refer to in python?

tuple in python refers to tuple. Python’s tuple is similar to a list, the difference is that the tuple Group elements cannot be modified.

Use parentheses for tuples and square brackets for lists.

Tuple creation is very simple, just add elements in brackets and separate them with commas.

The following examples:

Examples (Python 2.0)

tup1 = ('physics', 'chemistry', 1997, 2000)
tup2 = (1, 2, 3, 4, 5 )
tup3 = "a", "b", "c", "d"

Recommended learning: "Python Tutorial"

The above is the detailed content of What does tuple mean in python?. 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
Previous article:How to use python tupleNext article:How to use python tuple