QuestionQ135

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

How many elements are contained in the L list?

Question Image

Explanation

range(-1, -2) has the default step of 1, so it produces no values when counting upward from -1 toward an exclusive stop of -2. The list comprehension therefore creates an empty list.

Community Discussion

No comments yet. Be the first to start the discussion!