What does tuple mean in python?

藏色散人
Release: 2019-08-01 15:35:55
Original
39316 people have browsed it

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"
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template