Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

codePannu Level 1 Python Course - Week 6 Quiz on Logical Operators

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

 What is an example of a logical operator

a)

and

b)

if

c)

else

d)

elif

2.

Which of the following is not a boolean expression?

a)

TRUE

b)

3==4

c)

3+4

d)

3+4==7

3.

 What Python does when we use the and operator?

a)

Python does not evaluate the second condition when the first condition is false.

b)

 Python does not evaluate the first condition when the second condition is true.

c)

 Python does not evaluate the second condition when the first condition is true.

d)

Python does not evaluate the first condition when the second condition is false

4.

What will be the output of the following Python code ?

 (10<20) and (10>30)

a)

True

b)

False

c)

Error

5.

OR operators are true if...

a)

At least one condition is true

b)

Both conditions are always true

c)

All conditions are false

6.

print(9>2 and 6<=6)

a)

True

b)

False

7.

print(2%2==0 or 3%2==0)

a)

True

b)

False

c)

Invalid Output

8.

a = 10

b = 12

c = 0

print(a and b and c)

a)

0

b)

1

c)

10

d)

12

9.

a = 10

b = 12

c = 0

print(a or b or c)

a)

10

b)

0

c)

12

10.

x = 10

y = 20

print(not(x == 10 and y == 20))

print(not(x == 3 or y == 20))

a)

False

   False

b)

False

True

c)

TRUE 

False

d)

True 

True

11.

x = "Hello World"

print(x)

print('x')

a)

Hello World

x

b)

x     

Hello World

c)

x

d)

Error

12.

x = 10

y = 20

print(not(x == 10 or y == 20))

print(not(x == 3 and y == 20))

a)

False 

True

b)

True

  True

c)

False

False

d)

Error

13.

AbCdE, DeFgH, GhIjK, JkLmN, ?       

a)

OpQrS

b)

NoPqR

c)

MnOpQ

d)

LmNoP

14.

Which month of the year has 28 days?

a)

February

b)

December

c)

Leap Year

d)

All Months

15.

a=10

b=19

print(a and b)

a)

10

b)

19

c)

Error

d)

1019