Ad Code

✨🎆 JOIN MERN, JAVA, PYTHON, AI, DEVOPS, SALESFORCE Courses 🎆✨

Get 100% Placement Oriented Program CLICK to new more info click

Tuple In Python

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

0 Comments