Tuples Data Types

Moderator: ramajayam

Post Reply
ramajayam
Posts: 10
Joined: Wed Feb 07, 2024 8:28 am

Tuples Data Types

Post by ramajayam »

Tuples

A tuple is a built-in data structure in Python similar to lists but also has some significant differences. The difference between the two is that once the elements are assigned to the tuple can’t be changed. Tuples are used to store an ordered series of elements and are defined by parentheses (). The most common associated method of tuples are tuple(), count(), index() etc. Tuples allow duplicate values:



Examples of Tuple: thistuple = ("apple", "banana", "cherry", "apple", "cherry")
Post Reply