6. Tuple
A Tuple is a sequence datatype that is similar to the list. The tuple consists of a number of values separated by commas. The main different between list and tuples are:
lists are enclosed in square brackets([ ]) while tuples are enclosed by parenthesis (( )) .
In list elements size can be changed but tuples can be considered as a read only.
Example:
first_tuple=('ram', 123, 2.4, 'shyam', 679.5)
small tuple=(111, 'Tom')
print(first_tuple)
print(small_tuple)
print(first_tuple + small tuple)
Built in Tuple Function
tuple1=('ram', 123, 2.4, 'shyam', 679.5)
len() : print(len(tuple1)
max(tuple1)
min(tuple1)
tuple(seq)
list1= ['abcd', 147, 2.43, 'Tom']
printf("Tuple :", tuple(list))