A variable is a labelled box
rakho means "keep". rakho naam = "Asha"; keeps the text Asha in a box labelled naam. Later you can use the label instead of the value. Names may contain letters, digits and underscores, but cannot start with a digit — kul_marks and marks2 are fine, 2marks is not.
Changing a value
Once a variable exists, give it a new value with = alone — no rakho the second time. Writing rakho again for the same name in the same block is an error, because the box already exists.
You can use a variable's own value on the right-hand side: score = score + 10; reads the old score, adds ten and stores the result back.
pakka: values that must not change
pakka means "fixed" or "for sure". A value declared with pakka cannot be reassigned — if you try, the program stops with a runtime error that names the constant. Use it for things like tax rates, the number of days in a week, or a game's maximum lives.
If you declare a variable without a value, as in rakho jawab;, it starts as khali (empty).
Where a variable lives
Every pair of curly braces { } creates a new block. A variable made with rakho inside a block exists only inside it. Code outside the block can still read and change variables that were declared outside, which is how a loop updates a running total.
Practice exercise
Create a variable daam with value 120 and a constant GST with value 18. Make daam the price including GST using daam = daam + daam * GST / 100; and print Final daam: 141.6.
Expected output
Final daam: 141.6
Show solution
rakho daam = 120;
pakka GST = 18;
daam = daam + daam * GST / 100;
bol("Final daam:", daam);