Questions
The quiz itself will be similar in difficulty but longer in length than these practice questions.
Solutions for each problem can be found at the bottom of this page.
Memory Diagrams
- Produce a memory diagram for the following code snippet, being sure to include its stack and output.

Boolean Operators
- What is the result of the following boolean expressions?
3.1.((not False) and True) == True
3.2.(not False) or (True and False)
3.3.True and (7 < 3 * 4 / 6)
3.4.(not False) != True
3.5.not(True and False) and (False or not False)
Conditionals
- Every
ifstatement must have a pairedelsebranch. (T/F) - Lines contained in an
elsebranch in Python do not have to be indented. (T/F) - You can name a variable
elsein your program without Python confusing your variable’s name and theelsekeyword. (T/F) - Given the following code snippet, what is the printed output with the specified values for
xandy?

7.1. When x = 3, y = 5?
7.2. When x = 5, y = 3?
7.3. When x = -5, y = 1?
7.4. When x = 13, y = 8?
7.5. When x = 4, y = 3?
While Loops
Given the following code snippet, what is the printed output once it completes?

Given the following code snippet, what is the printed output once it completes?

Solutions
Memory Diagrams
Boolean Operators
- 3.1.
True
3.2.True
3.3.False
3.4.False
3.5.True
Conditionals
- False
- False
- False
- 7.1. 16.0
7.2. 2.0
7.3. -3.0
7.4. 3.0
7.5. 1
While Loops
- 3
3
“1303132” - “036910875421”
