filmov
tv
#16 Tuple Functions and Methods || Tuples-I Built-in Data Types in Python Hindi Tutorial with Code

Показать описание
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 List, Set, and Dictionary, all with different qualities and usage. A tuple is a collection which is ordered and unchangeable.
Code:
a=(0,1,2,3,4,5,6,7)
print("The individual items of tuple are:")
for i in a:
print(i,end=' ')
print("The value of index number 3 is:",a[3])
print("the value from index number 2 are:",a[2:])
print("Length of tuple is:",len(a))
print("The maximum value from tuple is:",max(a))
print("The minumum value from tuple is:",min(a))
Code:
a=(0,1,2,3,4,5,6,7)
print("The individual items of tuple are:")
for i in a:
print(i,end=' ')
print("The value of index number 3 is:",a[3])
print("the value from index number 2 are:",a[2:])
print("Length of tuple is:",len(a))
print("The maximum value from tuple is:",max(a))
print("The minumum value from tuple is:",min(a))