Problem 187882 · easy · Phase 01 Prerequisites & Setup

Passing Grades Only

lists · filtering · conditionals

Write passing(scores, threshold) that returns a new list containing only the scores that are greater than or equal to threshold, in their original order.

Examples

Input:  scores = [72, 45, 90, 60], threshold = 60
Output: [72, 90, 60]

Input:  scores = [50, 55], threshold = 60
Output: []

Constraints

  • 0 <= len(scores) <= 5000
  • scores may be integers or decimals

Goals

  • Keep only the items that satisfy a condition
  • Preserve the original order
Starting Python…