Search Header Logo

Python Control Structures Quiz Review - CodeHS Unit 4 Review

Authored by Garrett Jones

Computers

9th - 12th Grade

Used 37+ times

Python Control Structures Quiz Review - CodeHS Unit 4 Review
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

About

This quiz focuses on Python programming fundamentals, specifically control structures including conditional statements, loops, and Boolean logic operations. The content is appropriate for grades 9-12, targeting students in an introductory computer science course who are learning core programming concepts. Students need to understand Boolean expressions and logical operators (AND, OR, NOT), conditional statements (if/elif/else), iteration with for and while loops, and program flow control. The questions require students to trace through code execution, evaluate Boolean expressions, predict program output, and identify appropriate control structures for different scenarios. Students must also understand syntax errors, infinite loops, nested conditionals, and the proper use of Python's random module. The problems assess computational thinking skills including pattern recognition, logical reasoning, and the ability to mentally execute code step-by-step. Created by Garrett Jones, a Computers teacher in US who teaches grade 9-12. This quiz serves as an excellent review tool for students completing a unit on Python control structures, particularly those following the CodeHS curriculum framework. The assessment can be effectively used as a formative evaluation before a unit test, allowing students to identify areas needing additional practice and giving teachers insight into common misconceptions around Boolean logic and loop structures. It works well as a homework assignment for independent practice or as a warm-up activity to reinforce previously taught concepts. Teachers can also use individual questions as exit tickets or discussion starters when reviewing specific control structure concepts. The quiz aligns with Computer Science standards focusing on algorithmic thinking and programming fundamentals, supporting students' development of essential computational problem-solving skills.

    Content View

    Student View

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the following Boolean expressions is equivalent to the expression?

a AND (b OR c)

(a AND b) OR (a AND c)

(b AND c) OR a

(a AND b) AND (a AND c)

(a AND b) OR c

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What is the value of the boolean variable can_graduate at the end of this program?

earned_credits = 120

no_fees_owed = True

can_graduate = earned_credits >= 115 and no_fees_owed = True

True

False

None, there is a syntax error.

Yes, can graduate.

3.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What is the last thing printed by the following program?

start = 24

stop = 9

for i in range (start, stop -1, -3):

if i % 3 == 0:

print(i *2)

else:

print(i)

9

18

0

3

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

How many times will the following program print "Call me asparagus."?

i = 0

while i < 10:

print("Call me asparagus.")

This program will loop infinitely.

5

10

0

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What will be the output of this program?

number = 9

greater_than_zero = number > 0

if greater_than_zero:

if number > 5:

print(number)

0

9

False

Nothing will print

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

The AP Exam uses the following relational (comparison) operators: =, ≠, >, <, ≥, and ≤.
As well, AND, OR and NOT are used instead of and, or and not.

A comparison using a relational operator evaluates to a Boolean value. For example, a = b evaluates to true if a and b are equal; otherwise, it evaluates to false.


Determine what the following expression would evaluate to.

(12 != 8 AND 19 < 6) OR 68 < 5

yes

true

false

no

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What is printed by the following program?

is_snowing = True

is_windy = True

is_blizzard = is_snowing AND is_windy

is_winter = False

is_cold = is_snowing or is_winter

print("Is it cold: " + str(is_cold))

Is it cold: True

Is it cold: False

Is it cold: yes

Is it cold: no

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?