A picnic club looks back over its weather records. Day i has a temperature temps[i] (in °C) and a rainfall rain[i] (in mm), so the two lists line up day by day.
A day counts as picnic weather when both of these are true:
low and at most high,0.Task: write picnic_days(temps, rain, low, high) returning a tuple (kept, count, share):
kept — the temperatures of the picnic-weather days, as a plain list, in the same order as the records,count — how many days were picnic weather,share — the fraction of all the days that were picnic weather, rounded to 4 decimal places.There is always at least one day of records.
Example
31 is too hot, 22 had rain, and 18 and 15 are too cold.