CBSE Class 12 Computer Science
Question 61 of 68
Data Structures - I : Linear Lists — Question 17
Back to all questions- In the code, round brackets are used for list comprehensions, but list comprehensions work with square brackets only.
- The syntax error arises from the use of two
ifstatements within the list comprehension. To resolve this error, we should use a singleifstatement with both conditions combined using theandoperator.