Vidyalelo
Python · Q32

Python Built

Programming · Python · question 32

Q32

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

A.
4
Answer
B.
3
C.
Error
D.
6

Answer: Option A

Solution

Answer: Option A
Solution:
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.