1. Labelled boxes
A variable is a name that holds a value, like a labelled box. Create one with =:
player = "Smriti"puts the text Smriti in a box called playerruns = 48puts the number 48 in a box called runs
The = means store, not "equals". So runs = runs + 4 means: take the old runs, add 4, store the answer back in runs. Now runs is 52.
Name rules: use small letters and underscores (total_runs), no spaces, and don’t start with a number.
player = "Smriti"
runs = 48
print(player, runs)
runs = runs + 6 # a six!
print(player, runs)
Challenge: She hits a four!
There are two variables: player and runs. The player hits a four: add 4 to runs (write runs = runs + 4). Then print the player and her runs with one print(player, runs). The output should be Smriti 52.