Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python logical operator

Total questions: 22

Worksheet time: 23mins

Name
Class
Date
1.

Python is a __________ language.

a)

Low-level

b)

High-level

c)

Machine

d)

Assembly

2.

Which function is used to display output?

a)

show()

b)

output()

c)

print()

d)

display()

3.

Which of the following is a valid variable name?

a)

1num

b)

my number

c)

my_number

d)

@value

4.

What does a variable do?

a)

Stores data

b)

Deletes data

c)

Prints data

d)

Converts data

5.

What is the output ?

x = 5

print(x)

a)

x

b)

5

c)

print(x)

d)

Error

6.

What is the data type of 25?

a)

String

b)

Float

c)

Integer

d)

Boolean

7.

What is the data type of "Python"?

a)

Integer

b)

Float

c)

String

d)

Boolean

8.

What is the data type of True?

a)

Integer

b)

Boolean

c)

String

d)

Float

9.

Which function is used to take input from the user?

a)

get()

b)

read()

c)

input()

d)

scan()

10.

What will be the output?

print("Hello")

a)

Hello

b)

"Hello"

c)

print

d)

Error

11.

What does % operator give?

a)

Quotient

b)

Product

c)

Remainder

d)

Power

12.

What will be the output?

print(10 % 3)

a)

3

b)

4

c)

1

d)

2

13.

Which operator is used to check if two values are equal?

a)

=

b)

==

c)

!=

d)

>=

14.

Which operator checks if one value is NOT equal to another?

a)

==

b)

!=

c)

=

d)

<=

15.

Which operator means “greater than”?

a)

>

b)

<

c)

=

d)

!

16.

Which operator means “less than or equal to”?

a)

>=

b)

!=

c)

<=

d)

==

17.

What will be the output?

print(10 > 5)

a)

True

b)

False

c)

Error

d)

None

18.

What will be the output?

print(4 == 5)

a)

True

b)

False

c)

Error

d)

None

19.

What is the output?

x = 12

print(x >= 10)

(a)  

20.

What is the output?

x = 6 print(x < 5)

a)

True

b)

False

c)

Yes

d)

No

21.

What is the output?

a = 10 b = 10 print(a == b)

a)

True

b)

False

c)

Yes

d)

No

22.

What is the output?

print(15 != 20)

a)

True

b)

False

c)

Yes

d)

No