Python Control Structures Flashcard Review - CodeHS Unit 4 Review

Python Control Structures Flashcard Review - CodeHS Unit 4 Review

Assessment

Flashcard

Computers

9th - 12th Grade

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

17 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which of the following Boolean expressions is equivalent to the expression? a AND (b OR c)

Back

(a AND b) OR (a AND c)

2.

FLASHCARD QUESTION

Front

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

Back

True

3.

FLASHCARD QUESTION

Front

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)

Back

18

4.

FLASHCARD QUESTION

Front

How many times will the following program print "Call me asparagus."?
```python
i = 0
while i < 10:
print("Call me asparagus.")
```

Back

This program will loop infinitely.

5.

FLASHCARD QUESTION

Front

What will be the output of this program?
number = 9
greater_than_zero = number > 0
if greater_than_zero:
if number > 5:
print(number)

Back

9

6.

FLASHCARD QUESTION

Front

What does the expression (12 != 8 AND 19 < 6) OR 68 < 5 evaluate to?

Back

false

7.

FLASHCARD QUESTION

Front

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))

Back

Is it cold: True

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?