KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Predict the output of the following snippet:

List1=["Happy", "New", "Year", 2026]
print(len(List1))

Python Functions

1 Like

Answer

Output
4
Explanation

The len() function returns the number of items (elements) in a list. List1 contains four elements — "Happy", "New", "Year", and 2026. Hence, the output is 4.

Answered By

2 Likes


Related Questions