# Syntax::
#
Tuple_Empty = ()
#
Tuple_Name = (Element_1 , Element_2 , Element_3)
#
===> Tuples are immutable
#
===> i.e. you cannot change the elements of tuple once it is made
#
Operations on Tuple
#
Tuple Concatenation
#
===> adds the two tupples
#
New_Tuple = Tuple_1 + Tuple_2
#
min( Tuple_Name )
#
===> returns the element with minimum
value
#
New_Variable_3 = min( Tuple_Name )
#
max( Tuple_Name )
#
===> returns the element with maximum
value
#
New_Variable_3 = max( Tuple_Name )
#
len( Tuple_Name )
#
===> returns the size of the tuple
#
New_Variable_8 = len( Tuple_Name )
#
sorted( Tuple_Name )
#
===> sorts the items of the tuple in
ascending order
#
New_Variable_8 = sorted( Tuple_Name )
#
sum( Tuple_Name )
#
===> sorts the items of the tuple in
ascending order
#
New_Variable_8 = sum( Tuple_Name )
#
Python Slicing
#
New_Tuple = Tuple_Name[Start_Position:Stop_Position]
#
New_Tuble = Tuple_Name[Start_Position:]
#
New_Tuple = Tuple_Name[:Stop_Position]
#
New_Tuple = Tuple_Name[::-1]
#
===> To Reverse the Tuple
0 Comments