Activity on Datatypes

Datatype- Tuple
Tuple is a collection of objects separated by commas. A tuple is similar to a list. The only difference is that tuple is immutable.
1.del tuple- Used to delete a tuple
2.len (tuple)- Used to find the length
3. list1 = [0,1,2]
print(tuple(list1)
In this way we can convert a list to a tuple.

These are the things i know with tuples, if the there any else please let me know. Thank you edyoda for this opportunity.

3 Likes

@thoufeeqansari132
Tuple with one element. If the tuple contains only one element, then it’s not considered as a tuple. It should have a trailing comma to specify the interpreter that it’s a tuple.

1 Like