We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Length

Now that we have all sorts of Snek Objects (integers, floats, strings, arrays, etc.), we need a convenient way to get the length of any Snek Object. In Python (Sneklang's dreaded competitor) it's as easy as:

print(len(x))

As a Python dev, you don't have to know the value of x ahead of time because Python keeps track of it under-the-hood for you. We want the same capability in Sneklang.

Assignment

In snekobject.c, complete the snek_length function: