?
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
A
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.
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.
Join the Discussion
Login to post a comment or share your explanation.
Login