Examveda

What will be the output of the following Python function?
len(["hello",2, 4, 6])

A. Error

B. 6

C. 4

D. 3

Answer: Option C

Solution (By Examveda Team)

The 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.

This Question Belongs to Python Program >> Introduction To Python

Join The Discussion

Related Questions on Introduction to Python