Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python - Operators and Conditional Statement

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

In the given expression find out the operator :

x - y

a)

Arithmetic Operators

b)

Bitwise Operators

c)

Assignment Operators

d)

Logical Operators

2.

what will be the output of the given code:

x = 400

if (X % 2 == 0):

print(" You are a good Programmer")

else :

print("You are Pro Level Programmer")

a)

You are a good Programmer

b)

You are Pro Level Programmer

c)

Nothing will be Printed

d)

Error Message

3.

To assign a value to a variable which operator is used ?

x = 5

a)

Arithmetic

b)

Logical

c)

Assignment

d)

Equality

4.

Find out the output of the given code :

a = 20

b = 15

c = 15.0

if( b == c ):

print("Equal")

else :

print("Not Equal")

a)

Equal

b)

Not Equal

c)

Error

d)

Nothing Will be printed

5.

Find out the output of the given code :

x = 20

y = 15

if (x != y):

print("False")

else :

print("True")

a)

True

b)

False

c)

Error

d)

Nothing Will be Printed

6.

Find Out the output of the given code :

a = 5

b = 3

if ( a > 4 and b > 2):

print(" Good Morning! ")

else :

print(" Good Evening!")

a)

Error

b)

Nothing will be printed

c)

Good Evening!

d)

Good Morning!

7.

which type of data is this :

Odd = [ 1, 3, 5, 7, 9]

a)

Int

b)

Set

c)

List

d)

Tuple

8.

Find Out the output of the given code :

a = 2

print(a**3)

a)

2

b)

6

c)

5

d)

8

9.

What will be the output of the given code ?

a = 1

while( a< 6):

print(a)

a= a+1

a)

0, 1, 2, 3, 4, 5

b)

0, 1, 2, 3, 4, 5, 6

c)

1, 2, 3, 4, 5

d)

1, 2, 3, 4, 5, 6

10.

What is the use of 'break' keyword in a loop ?

a)

repeat the steps

b)

to skip the current iteration of the loop

c)

Stop the execution of the program

d)

to break the code in several parts