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

    Register for Free โ†’
    Free Worksheet ยท Beginner

    Python VariablesA Complete Beginner Worksheet

    Learn what variables are in Python, how to assign values, work with different data types, convert between types, and complete hands-on exercises to solidify your understanding.

    ๐Ÿ’ก

    What is a Variable?

    In Python, a variable is a named location in memory that stores a piece of data. Think of it as a labelled box โ€” you give the box a name, put something inside, and can retrieve or update that value at any point in your program.

    Real-world analogy

    Imagine a whiteboard in a classroom. A teacher writes score = 0 at the top. As the quiz progresses, she erases 0 and writes the latest total. The label "score" stays fixed โ€” only the value inside changes. That is exactly what a Python variable does.
    ๐Ÿท๏ธ

    Name

    Every variable has a unique identifier (e.g. score, player_name, is_alive) that you choose when you create it.

    ๐Ÿ“ฆ

    Value

    The data stored inside โ€” a number, text, True/False, or a more complex object.

    ๐Ÿ”„

    Mutable

    Unlike a fixed constant, a variable's value can be updated as many times as needed while the program runs.

    ๐Ÿ

    No declaration needed

    Python is dynamically typed. You don't need to say 'this is an integer' โ€” Python figures it out automatically.

    Key vocabulary

    • Assignment โ€” storing a value in a variable using the = operator.
    • Data type โ€” the kind of data stored (int, float, str, bool).
    • Dynamic typing โ€” Python infers the type automatically.
    • Re-assignment โ€” giving a variable a new value (can even change its type!).
    1 / 6
    ๐Ÿš€ Ready to go further?

    Master Python with Live 1-on-1 Expert Tutors

    Worksheets are a fantastic start! Our Python Programming Course for Kids takes you from variables to building real-world projects with personalised expert feedback.