Class 7 · CBSE AI · Strand B — Python for AI
Python variables and types explained for Class 7
A variable is a named container for a value. How Python figures out the type for you. A beginner guide for Class 7.
Class 7 · CBSE AI · Strand B — Python for AI
A variable is a named container for a value. How Python figures out the type for you. A beginner guide for Class 7.
Tiffin box with a name label
A variable is like a tiffin box with your name written on it. The name tells you whose box it is and what to expect inside. The type is like knowing whether the box holds rice, liquid curry, or a dry snack — you handle each differently.
Cricket scoreboard
A cricket scoreboard tracks runs (int), strike rate (float), player name (str), and whether they are out or not (bool). Each slot on the board holds a specific kind of information, and you cannot put a player's name where the run count goes.
Every Dhee Learning session for this concept follows three stages. We share the questions Dhee actually asks, so you can hear what a session sounds like.
Stage 1 — Surface
If I write score = 95 in Python, what do you think is happening? What is 'score', and what is '95'?
Rote answer
"score is a variable and 95 is its value"
Understood
"score is a name we give to a box in the computer's memory so we can refer to that value later without writing 95 every time — and we can also change it"
Stage 2 — Reasoning
Why does Python care whether a value is an integer, a decimal, or text? What could go wrong if it did not?
Follow-up Dhee may use: What do you think Python does if you try to add a number to a piece of text? Guess before you try it.
Stage 3 — Application
You are building a student record. Create variables for a student's name, age, percentage score, and whether they passed. What type should each one be, and why?
Misconception Dhee watches for: Using strings for everything (e.g. age = '13') because it looks fine on screen but breaks any arithmetic or comparison operation
Dhee turns this concept into a 15-minute spoken session — asking, listening, and probing — so your child builds the idea themselves.
A variable is a named container for a value. How Python figures out the type for you. A beginner guide for Class 7.
A variable's value cannot change — in reality, variables can be reassigned at any point, which is why they are called 'variables'
Dhee opens with a question — for example: "If I write score = 95 in Python, what do you think is happening? What is 'score', and what is '95'?" — listens to your child's answer, then probes the reasoning behind it. The session ends when the child can apply the idea to a brand-new situation, not just recall it.