A Box With a Name

Computing · Page 1 of 2

Name Date
DIRECTIONS: Work out this Python with a pencil. Fill in what score holds after each line, then what it prints.
A variable is a named box. It holds one thing; putting in something new throws the old one away.
1score = 0
2score = 7
3score = 2
4print(score)
linescore
1
2
3
4
what it prints 
Where is the 7 after line 3?

Two Boxes

Computing · Page 2 of 2

DIRECTIONS: Two boxes. Fill in what each holds after every line.
1a = 3
2b = 5
3a = b
4print(a)
5print(b)
lineab
1
2
3
4
5
what it prints 
  1. After line 3, what is in b? Did line 3 change it?
  2. Line 3 is a = b. Explain in one sentence which box got changed and which did not.
  3. The 3 that was in a at line 1 — where is it after line 3? Answer carefully.