Tuple In Python:-

It provides Immutable Object means tuple value can not be changed dynamically.

A tuple is mostly used to create Constant List in Program. tuple variable always will be declared by ().

arr = (item1,item2,item3,item4)


Tuple declare by () but access by []


Program to display element in Tuple

arr = (12,23,34,56,67,78)

for i in range(0,len(arr)):
  print(arr[i])


Append, Edit and Delete operation can not be supported by tuple Object?

#arr[0]=11
#arr.append(1)
#del arr[0]
print(arr[0:2])   





Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post