Python Python Collections (2016, retired 2019) Slices Slice Functions

henry duquesnay
henry duquesnay
6,976 Points

The EXACT example others provide does not reliably work

def first_4(iterable) return iterable[0:4]

what is going on? Why doesn't this work?

slices.py
def first_4(iterable)
    return iterable[0:4]

1 Answer

There should be a colon at the end of your first line