選擇會記在這個瀏覽器裡
天氣預報給了這週每天的最高溫 temps。寫 heat_alert(temps):只要有一天超過 35 度,就返回 True;一天都沒有(或者列表是空的)返回 False。
temps
heat_alert(temps)
True
False
heat_alert([30, 33, 37, 31])
heat_alert([28, 30, 35])
def heat_alert(temps): for t in temps: # 在這裡寫:超過 35 度,馬上返回 True pass return False
寫好了先點「執行」試試示例,沒問題再點「提交」。
這一頁要開啟 JavaScript 才能寫程式碼。