Tutorpip← About this lessonABCHide the answer keyDownload PDF
Coding · Ages 10+ · Set B
Variables in Python
Scan to mark
on screen
B
Name
Date
Start Finish
Goal: 15 min
Score/ 12
Remember: A variable is a named box that holds a value. The value can change.

Questions

1
A box called coins holds three. Which line takes one coin out?
🔤coins = coins - 1🔤coins == 4🔤coins = 1
2
A box called coins holds three. Which line adds one coin?
🔤coins == 4🔤coins = coins + 1🔤coins = 3 - 1
3
A box called coins holds three. Which line takes one coin out?
🔤3 = coins🔤coins = 3 - 1🔤coin = coins + 1
4
A box called coins holds three. Which line has a bug?
🔤coins = coins - 1🔤3 = coins🔤coin = coins + 1
5
A box called coins holds three. Which line has a bug?
🔤1 + coins = coins🔤coins == 4🔤coins = coins - 1
6
Which idea about variables is true?
🏷️the name on a variable is how Python finds it🔒a variable keeps its first value forever🔢a variable can only hold a number
7
A box called coins holds three. Which line leaves the box holding three?
🔤1 + coins = coins🔤coins = 1🔤coins == 4
8
Which idea about variables is true?
🔒a variable keeps its first value forever⚖️one equals sign checks if two things are equal📦a variable is a named box that holds a value
9
A box called coins holds three. Which line adds one coin?
🔤coins = 1 + coins🔤coins + 1🔤1 + coins = coins
10
⬅️Is it true that one equals sign puts a value in a variable?
YesNo
11
Which idea about variables is not true?
🔄a variable can change while the program runs⚖️one equals sign checks if two things are equal📦a variable is a named box that holds a value
12
Which idea about variables is not true?
📦a variable is a named box that holds a value🔒a variable keeps its first value forever🔄a variable can change while the program runs
Scan the code at the top to mark this sheet on screenTake a photo of your answers or type them. It is marked for you automatically, and your score is kept.
Answer key · Set B
Variables in Python
1coins = coins - 1
2coins = coins + 1
3coins = 3 - 1
43 = coins
51 + coins = coins
6the name on a variable is how Python finds it
7coins == 4
8a variable is a named box that holds a value
9coins = 1 + coins
10Yes
11one equals sign checks if two things are equal
12a variable keeps its first value forever
Mark each answer, count the right ones and write the score on the sheet.