ExamVeda
Login
Home
Python Built In Functions
?

What will be the output of the following code:
my_list = [1, 2, 3, 4]
print(len(my_list))

Answer & Solution
Correct Answer: Option A
The len() function in Python is used to find the number of elements in an object. In this case, len(my_list) will return the length of the list my_list, which contains four elements [1, 2, 3, 4]. Therefore, the output will be 4.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.