KnowledgeBoat Logo
|

Informatics Practices

The command [1,2,3,4,]<[9,1] will give the output as True.

Python List Manipulation

1 Like

Answer

True

Reason — In Python, [1, 2, 3, 4] < [9, 1] returns True because list comparison is done element-wise from left to right. The comparison stops and returns True upon finding the first pair where the element in the first list is less than the corresponding element in the second list. Here, 1 < 9 is True, hence the result.

Answered By

1 Like


Related Questions