you are a and you need to your . You could the on a , rub it out, and a new each you a . A in a the way. It is a that can a — and that can as the . 🎯
The from the for . In you see x or y used as . In , have like , , or so the what is .
of a as a box. The is the and is the box is its . You can the box at any , what is in it, or add to it. A at 0. Every the an , the the box, 1, and the new in. 📦
| Variable name | What it stores | Example value |
|---|---|---|
| score | How many points the player has earned | 7 |
| lives | How many chances the player has left | 3 |
| playerName | The name typed in by the player | Priya |
In like , you a by Make a and it a . You then use to set the at the and it during the . The set a in the box. The by or a from is there. These two are your key for a . 🧩
set your to 0 at the very of your . If you , the on from a and the . This is called the — it before it is .
🔗 Match each coding block to what it does. Drag the block name to the correct description. 🔗
set score to 0
change score by 1
if answer = correct
say score
when you them with the other you know. in . through again and again. using an if to the got the before the . these let you a , . 🎮
and ! After you your , it and for . A bug is a in the . If the up when it should not, which is the by . is called and every does it, even the .
🧩 Put these steps in the correct order to build a simple score-keeping quiz game. Drag them into the right sequence. 🔢
- Show the final score on screen
- Use change score by 1 if the answer is right
- Use an if block to check if the answer is correct
- Ask the player a question
- Set score to 0 at the start of the program
- Create a variable called score
✍️ Complete the sentences about variables using the word bank below. 📝
A is a can . You should a before the . When a a , you use the to the .
done — you now the ! Every app on your , every on a , and every to while it . it is your , your , or the of in a , are the the . 🌟
Quiz time! 📝
Variables and Keeping Score — Quick Check
Question 1 of 5Tip: log in to save your score and track progress.
Finished?
Log in to mark this lesson complete and track your progress.