In this video we will discuss about Tuple in Python and Tuple Functions.
Tuple is an Immutable Object
Tuple is a Collection of any valid Literal.
Tuple is Heterogeneous, it can store any type of value
Tuple elements are ordered, Unchangeable & allows duplicate
() (round Brackets) are used in Tuple
Each element in list has its Index (0,1,2…) & Slicing is supported
Eg. ls = ( 3 , 7.9 , ’hello’ , True , [5,6,7] , (2,3,4) )
There are following Function on Tuple :-
tuple(iterable) – creates a tuple from an iterable
a.index(v) – gives index of first occurrence of value ‘v’
a.count(v) – counts occurrences of ‘v’ in tuple ‘a’
len()
max() , min() , sum()