Separate filtering from conditional replacement

A calibration program processes signed readings measured in millivolts. Examine the conditional output expression and trailing filter in this Python code. Select every true statement about its execution.


Python
readings = [-4, 0, 3, -1, 6]
adjusted = [r + 2 if r > 0 else 0 for r in readings if r != 0]
Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More List Comprehensions Questions: