CBSE Class 11 Informatics Practices Question 76 of 80

Lists in Python — Question 6

Back to all questions
6
Question

Question 6

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

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.