Skip to content
dreamcode
dreamcode
Peaks
List Wrangler
BeginnerPython
Reward: +40 XP
PROBLEM

List Wrangler

Given a list of numbers representing daily temperatures, write a function find_cold_days(temps, threshold) that filters and returns a list of all temperatures that are strictly below the threshold.

Examples
find_cold_days([15, 22, 12, 25, 9], 15)
[12, 9]
find_cold_days([], 0)
[]
solution.py
PYTHON
Saved as you type

Tests

0 of 3 passing
  • temps=[15, 22, 12], threshold=15 → [12]
    find_cold_days([15, 22, 12, 25, 9], 15)
    expected [12, 9]
  • empty list → []
    find_cold_days([], 0)
    expected []
  • no cold days → []
    find_cold_days([18, 20], 15)
    expected []
On the line
+40 XP
Pass all 3 tests to claim it.