Examveda

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

A. 4

B. 3

C. Error

D. 6

Answer: Option A

Solution (By Examveda Team)

The correct answer is Option A: 4.
The len() function in Python is used to get the length of an object, such as a list, tuple, or string. When you pass the list ["hello", 2, 4, 6] to the len() function, it returns the number of elements in the list, which is 4. Therefore, the output will be 4.

This Question Belongs to Python Program >> Python Built In Functions

Join The Discussion

Related Questions on Python Built In Functions