What will be the output of the following Python function?
len(["hello",2, 4, 6])
len(["hello",2, 4, 6])
A. Error
B. 6
C. 4
D. 3
Answer: Option C
Solution (By Examveda Team)
Thelen()
function returns the number of items in an object.Here, we have a list
["hello", 2, 4, 6]
.The list contains 4 items: a string, two integers, and another integer.
Therefore, the output of
len(["hello", 2, 4, 6])
will be 4.
Join The Discussion