units 3 & 4 code hs

units 3 & 4 code hs

Assessment

Quiz

Computers

8th - 12th Grade

Easy

Created by

Hannah E

Used 16+ times

FREE Resource

Student preview

quiz-placeholder

21 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many possible values are there for a boolean variable?

1

2

3

There is an infinite number of possibilities.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Assume you are writing a program, and you have a boolean variable called b, defined like so:

b = True

Pick the correct if statement to follow the code above. The if statement should be correct Python, and the body of the if statement should only run if b is True.

if b:

print("b is True!")

if b:

print("b is True!")

if True:

print(b)

if True:

print(b

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does this Python expression evaluate to?

100 != 100

True

False

"False"

"True"

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following programs will run but will not print anything?

x = True

if x:

print("hi")

if False:

print("hi")

x = False

if x:

print("hi")

else:

print("hello")

if False:

print "hi"

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a comparison operator?

<=

!=

?

>

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a logical operator in Python?

and

or

not

because

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following conditions tell me to sleep if my alarm did not go off (alarm = False) and I’m tired (tired = True)?

if alarm and tired:

sleep

if not alarm or tired:

sleep

if not alarm and tired:

sleep

if not alarm and not tired:

sleep

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?