Beginner · Lesson 8 of 12

Arrays & lists

A collection groups related values in a particular order. Indexes start at zero in these languages. Check whether a collection is empty before accessing its first value, and avoid changing its length while iterating unless you intend to.

Try it for yourself

Run the example, then change one thing and see what happens.

13px
main.pyYour ideas, in code.
Loading your editor…
Run your code to see the output here.
Ready to buildUTF-82 lines

Expected output

soup

Make it your own

Create a collection of three favorite foods and display the last one.

A quick check

Which habit helps when learning arrays & lists?

PreviousNext lesson