Future careers in the AI era: what to prepare now

Coding Education

Bayu Nugraha
Children's Coding Specialist

A constant is a fixed value in a program that cannot be changed while the program runs. Unlike a variable, whose contents can change again and again, a constant is locked from the start: once it is given a value, that number or text stays the same until the program finishes. Programmers use constants to store values that genuinely should never change, such as pi (π = 3.14), the number of days in a week (7), or the speed of light.
Table of Contents
The easiest way to understand a constant is to compare it with a variable. A variable is like a box whose contents you can swap at any time; a constant is like a box that has been glued shut — its contents stay put. In Python, for example, you can write PI = 3.14 and use it to calculate the area of a circle, and the value of PI must not change because pi is always 3.14. Another example: SPEED_OF_LIGHT = 299792 km/s — this number is constant throughout the universe. In Scratch, a child can make a block called “gravity” that always equals 10 and is never changed during the game. In many programming languages, constants are written in ALL CAPITALS so they stand out from ordinary variables. Fun fact: if a program tries to change a constant, the computer shows an error right away — which actually helps programmers avoid mistakes.
A constant means a fixed value that is locked in and does not change while the program runs. Some constants that come up often:
None of those values ever change, so they fit perfectly as constants. That is what sets them apart from ordinary values that can go up and down. A child can try using fixed values like these in their own project during a free Algonova coding class.
Learning to tell a constant from a variable trains children to think logically: which data stays fixed and which changes. This idea is the foundation of almost every piece of code they will write. In Algonova's coding courses, kids learn concepts like this through real projects — building games and animations, not memorizing theory.
Want your child to try? Take one free coding class to see how they learn.
A constant is a fixed value that cannot change while a program runs, such as pi or the number of days in a week. Its value is locked from the start until the program ends.
A variable's contents can change at any time, while a constant stays the same from beginning to end. Constants are used for values that should never change.
It is simply a naming convention that helps programmers spot constants quickly when reading code, for example PI or MAX_SCORE.
Yes. In Scratch, a child can use a fixed value like “gravity = 10” in their game and understand constants visually, without typing complex code.