runtime
433 / 500
question 433 Visualization & EDA · easy

Films by runtime band

A catalogue page groups films by length. Write runtime_bands(runtimes): return how many films are short (under 90 minutes), feature (90 to under 120) and long (120 or more). Every band appears in the result, even with 0 films. Missing runtimes (None) are not counted.

Functionruntime_bands(runtimes)
Returns{"short": int, "feature": int, "long": int}
Examples
callruntime_bands([107, 87, 133, 79, None, 95])returns{'short': 2, 'feature': 2, 'long': 1}
callruntime_bands([124, 126, 132])returns{'short': 0, 'feature': 0, 'long': 3}
callruntime_bands([])returns{'short': 0, 'feature': 0, 'long': 0}

Loading your progress…

Films by runtime band — Python practice · Runtime