PythiloLesson 14 of 30 · progress kept in this browser

Lists

A list is an ordered, mutable sequence.

xs = [30, 10, 20]
xs.append(40)
print(xs[0], xs[-1])  # 30 40
print(xs[1:3])        # [10, 20]
print(xs[::-1])       # reversed copy

Slices never raise for out-of-range bounds. They return whatever exists, and they build a new list.

Your task

Write top_three(scores) returning the three largest scores, highest first, without changing the input. Write chunks(items, size) returning a list of consecutive slices of at most size items.