Python Python Collections Slices Slice Functions

Gregory James
Gregory James
4,025 Points

I don't understand this at all

Since I don't understand this at all except function can someone point me in the right direction. I think I should back track. Where should I go to learn this? I did python basics and now i am on this. I feel like this took a big jump.

slices.py
def first_4[info]:
    return info[:3]

1 Answer

Thomas Harris
Thomas Harris
6,750 Points

When defining the function, you'll need to use parenthesis instead of brackets. This is covered in the Python Basics course you're working on.

def first_4(info):
    return info[:3]