Python Tuples Example – Programming, Pseudocode Example, C# Programming Example
Python 3

Python Tuples Example

Python Tuple

Tuples are used to store multiple items in a single variable.

Tuple is one of 4 built-in data types in Python used to store collections of data, the other 3 are ListSet, and Dictionary, all with different qualities and usage.

A tuple is a collection which is ordered and unchangeable.

Tuples are written with round brackets.

Python Tuples are used to store multiple items in single variable. In above program tupleExample is holding three string items.

Tuples is built in data type in pyton to store collections of data. A tuple is a collection which is ordered and unchangeable.

Python tuples are written in round backeets (eg : tuple1 = (“apple”, “banana”, “cherry”)).

Tuple items are indexed, the first item has index [0], the second item has index [1] etc.

Tuple is with order and that cannnot be change.

Tuples are unchangeable, so that we cannot change, add or remove items after the tuple has been created.

Python tuple can store duplicate values, so there can have same value items.

len() function python will the size of tuple. First program shows how to find the legnth of tuple.

Tuple can store the items of different data types (eg: tuple1 = (“abc”, 34, True, 40, “male”)), in this you can see that it is storing string, boolean and numbers.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.