?
What will be the output of the following Python function?
What will be the output of the following Python function?
len(["hello",2, 4, 6])
len(["hello",2, 4, 6])
Answer & Solution
Correct Answer:
Option
C
The
Here, we have a list
The list contains 4 items: a string, two integers, and another integer.
Therefore, the output of
len() 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
Login to post a comment or share your explanation.
Login