โšกFREE Live Master Session: Code Your AI Companion for Kids

    Register for Free โ†’
    Free Worksheet ยท Interactive Python Engine

    Python ListsIndexing, Slicing & List Operations

    Store and manage collections of items in Python! Master zero-based indexing, slicing, methods like append(), and looping over list items.

    ๐Ÿ“‹

    What is a List?

    A list in Python is a built-in data structure used to store a collection of multiple items in a single variable. Lists are defined using square brackets [] with items separated by commas.

    Real-world analogy

    Think of a shopping list on a notepad, or a backpack containing your lunchbox, notebook, and water bottle. Instead of holding each item in a separate bag, you keep them all together in one organized container!
    ๐Ÿ“‹

    Multiple Items

    Store integers, floats, strings, or even other lists inside one variable.

    ๐Ÿ”ข

    Zero-Indexed

    Every item has a numerical position starting at index 0.

    ๐Ÿ”„

    Mutable

    You can add, remove, or change elements in a list at any point.

    ๐ŸŒˆ

    Ordered Sequence

    Items maintain their order unless explicitly sorted or re-arranged.

    Key vocabulary

    • Element / Item โ€” an individual value stored inside a list.
    • Index โ€” the integer position of an element in the list (starting at 0).
    • Mutability โ€” the ability to alter list contents after creation.
    • Length (`len`) โ€” the total count of elements in a list.

    ๐Ÿงช Compact List Playground

    Run the script below to inspect a Python list containing different strings:

    ๐Ÿงช Compact List Playground

    Ready to run

    Python ScriptEditable
    1
    2
    Variable Inspector

    No variables yet.

    Run your Python code to see them appear here live!

    Output & Console
    Output Console
    Press Run Code above to see Python output here.
    Real Python Execution & Tracing
    Interactive input() Supported
    1 / 6
    ๐Ÿš€ Ready to go further?

    Master Python Data Structures with Live 1-on-1 Expert Tutors

    Worksheets are a fantastic start! Our Python Programming Course for Kids takes you from list operations to building data-driven projects with personalised expert feedback.