Computer Science
Which function returns the number of elements in the tuple?
- len()
- max()
- min()
- count()
Python Tuples
3 Likes
Answer
len()
Reason — The len() function returns the number of elements in the tuple.
Answered By
3 Likes
Related Questions
If tup = (20, 30, 40, 50), which of the following is incorrect?
- print (tup[3])
- tup[2] = 56
- print (max(tup))
- print (len(tup))
Consider two tuples given below:
tup1 = (1, 2, 4, 3) tup2 = (1, 2, 3, 4)What will the following statement print:
print (tup1 < tup2)- True
- False
- Error
- None of these
To create an empty dictionary, we use the statement as:
- d1 = {}
- d1 = []
- d1 = ()
- d1 == {}
In a dictionary, the elements are accessed through:
- Key
- Value
- Index
- None of these