Understanding Logical Operators in Python

Understanding Logical Operators in Python

9th Grade

10 Qs

quiz-placeholder

Similar activities

Computer Components

Computer Components

9th Grade

12 Qs

Logical Operators

Logical Operators

9th - 12th Grade

14 Qs

CodeHS 2.13 Short-Circuit Evaluation

CodeHS 2.13 Short-Circuit Evaluation

9th - 12th Grade

11 Qs

Apple Swift Playgrounds: Lesson Review: 4 - 6 Vocabulary

Apple Swift Playgrounds: Lesson Review: 4 - 6 Vocabulary

9th - 12th Grade

10 Qs

Y10M2A2 - Selection

Y10M2A2 - Selection

6th - 10th Grade

15 Qs

Boolean logic

Boolean logic

9th Grade

10 Qs

Retake Review 1

Retake Review 1

9th Grade

10 Qs

PLTW 1.1.5 Guess a Number 1 Player

PLTW 1.1.5 Guess a Number 1 Player

9th Grade

10 Qs

Understanding Logical Operators in Python

Understanding Logical Operators in Python

Assessment

Quiz

Computers

9th Grade

Medium

Created by

Kangni Amouzougan

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the `not` operator do in Python?

Inverts the boolean value

Combines two boolean values

Checks for equality

Converts a string to a boolean

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

python x = True

y = not x

print(y)

True

False

None

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the `and` operator return if both operands are `True`?

True

False

None

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? Python

x = True

y = False

print(x and y)

True

False

None

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the `or` operator return if one operand is `True` and the other is `False`?

True

False

None

Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The `and` operator only returns `True` if both operands are `True`.

True

False

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The `not` operator only works with integers in Python.

True

False

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?