✍️Introduction
In Python, a tuple is used to store multiple values in a single variable, just like a list.
But unlike lists, tuples cannot be changed after creation.
In this article, you will learn:
-
What a tuple is
-
How to create tuples
-
Tuple properties
-
Tuple operations with examples
What is a Tuple in Python?
A tuple is a collection of items stored inside round brackets ( ).
Tuples can store different data types.
Example:
numbers = (1, 2, 3, 4)
Creating a Tuple
Tuple with different data types:
Comments
Post a Comment