Examveda

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

A. 4

B. [1, 2, 3, 4]

C. 10

D. 6

Answer: Option A

Solution (By Examveda Team)

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.

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

Join The Discussion

Related Questions on Python Built In Functions