The tuple is the same as a list but it's immutable. We can access a tuple like a list but can't update data, can't add data, and can't remove data.
names = ("Jone", "Doe", "Jems")
print(names)
print(names[0])
print(names[1])
names = ("Jone", "Doe", "Jems")
print(len(names))
print("Doe" in names)
del names
Method | Description |
---|---|
count() | Used to get the number of times a given value occurs in a tuple |
index() | Used to search the position of a specified value |