wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Conditional statements

Total questions: 80

Worksheet time: 55mins

Name
Class
Date
1.

What is the output?

a)

3

b)

3

7

c)

3

5

7

d)

7

2.

What is the output?

a)

True

b)

NIL

c)

True

NIL

d)

True

NIL

NIL

3.

What is the output?

a)

level 3

b)

level 3

level 1

c)

level 3

level 1

NIL

d)

level 3

level 2

level 1

NIL

4.

What part of an if statement should be indented?

a)

All of it

b)

The statements within it

c)

the first line

d)

the lines within the brackets

5.

Given the nested if-else below, what will be the value x when the code is executed successfully.

a)

0

b)

4

c)

2

d)

3

6.

Given the nested if-else structure below, what will be the value of x after code execution completes.

a)

2

b)

0

c)

3

d)

4

7.

What is the output of the following if statement?

a)

False

b)

True

8.
An if statement must evaluate to:
a)
Right or Wrong
b)
True
c)
True or False
d)
False
9.
This operator means that one value is the same as the other value
a)
==
b)
!=
c)
>
d)
<
10.

What is the result of the code:

team = Cowboys

if team = Cowboys:

print(Dallas is #1)

a)

Error

b)

Cowboys

c)

Team

d)

Dallas is #1

11.
What best defines an IF statement in python?
a)
Is an embedded string with a variable
b)
An IF statement checks to see if a statement is true or false and then does one of two things depending on the result.
12.

What will be the output after the following statements?

a)

0

b)

1

c)

2

d)

15

e)

error

13.

What will be the output after the following statements?

a)

15

b)

yes

c)

equal

d)

no

e)

error

14.

What will be the output after the following statements?

a)

false

b)

true

c)

not false

d)

not true

e)

error

15.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

16.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

17.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

18.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

19.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

20.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

21.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

22.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

23.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

24.

What will be the output after the following statements?

a)

true

b)

not false

c)

false

d)

not true

e)

error

25.
a)
Man on board
b)
Man over board
c)
Man on the board
d)
Man under board
26.
a)
Confidential secret
b)
First secret
c)
Top secret
d)
Secret folder
27.
a)
Man in the moon
b)
Man in the blue moon
c)
Man on moon
d)
Man in the outerspace
28.
a)
Top aid
b)
Ambulance aid
c)
Emergency aid
d)
First aid
29.
a)
Heroes that are remembered
b)
Forgotten heroes
c)
Got heroes
d)
Got a hero
30.
a)
Ones in time
b)
One at a time
c)
Once upon a time
d)
Ones upon a time
31.
a)
Once in moon
b)
Once on moon
c)
Once in a moon
d)
Once in a blue moon
32.
a)
Top cut
b)
Favorite cut
c)
A lot of cut
d)
A cut above the rest
33.
a)
Uplifting moral
b)
Moral support
c)
Moral lesson
d)
Moral standard
34.
a)
Multiple personality
b)
Two personalities
c)
Split personality
d)
Double personality
35.
a)
Boxing in box 10
b)
Manny Pacquiao wins!
c)
Bitten by a blur and black
d)
Beaten black and blue
36.
a)
Poor world
b)
Last world
c)
Third world
d)
Flat world
37.
a)
Green fingers
b)
Three green finger
c)
Dirty fingers
d)
Green fingerlings
38.
a)
Around the world
b)
A trip on the world
c)
Tour the world
d)
A trip around the world
39.
a)

Five c

b)

Under the blue sea

c)

Blue and white c

d)

Blue sea

40.
a)

Crossroads

b)

Two roads

c)

Two white roads

d)

Roads & roads

41.
a)

Animal

b)

Cat

c)

Black cat

d)

Big black cat

42.
a)

Coffee

b)

Coffee Gap

c)

Coffee Break

d)

Space between coffee

43.
a)

Comfortable

b)

Come & 4 Tables

c)

Come for table

d)

Come to tables

44.
a)

Naelc

b)

Clean up

c)

Clean room

d)

Black clean

45.

(Time: 10s) Pick the odd one out

a)

A

b)

B

c)

C

d)

D

46.
How many balls?
a)
16
b)
40
c)
25
d)
30
47.
What is the missing number?
a)
9
b)
18
c)
34
d)
22
48.
How many triangles are in this picture?
a)
14
b)
35
c)
10
d)
27
49.

How many cubes altogether ?

(a)  

50.

When the 5 pieces shown are fitted together correctly, the result is a rectangle with a calculation written on it.

What is the answer to this calculation?

(a)  

51.

Can you find which number is missing?

(a)  

52.

Which cube it will be?

a)
b)
c)
d)
53.

print(not (0<1))

a)

TRUE

b)

FALSE

c)

TYPE ERROR

54.

print(8!=8)

a)

TRUE

b)

FALSE

55.

print(9>2 and 6<=6)

a)

TRUE

b)

FALSE

56.

Choose correct option.

a)

False

b)

True

c)

Error

d)

None of these

57.

What is the purpose of the "else" statement in an "if-else" block?

  

a)

To execute a block of code if the condition is true

b)

To execute a block of code if the condition is false

c)

To repeat a block of code multiple times

d)

To skip the current iteration of a loop

58.

What is the output of the following code snippet?

   x = 5

   if x > 3:

       print("Greater than 3")

   else:

       print("Less than or equal to 3")

  

a)

Greater than 3

b)

Less than or equal to 3

c)

Invalid syntax

d)

No output

59.

1.How many possible values are there for a boolean variable?

a)

0

b)

1

c)

2

d)

3

60.

2.Which of the following is not a comparison operator?

a)

<=

b)

?

c)

!=

d)

>

61.

3.What does this Python expression evaluate to?

1000 != 1000

a)

"False"

b)

"True"

c)

False

d)

True

62.

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

a)

or

b)

and

c)

not

d)

because

63.

5.What will print to the screen when the following program is run?

number = 20

greater_than_zero = number >10

print(type(number))

a)

<class ‘bool’>

b)

<class ‘int’>

c)

20

d)

10

64.

6.What will be the output of this program?

number = 10

greater_than_zero = number > 5

if greater_than_zero:

print(number)

a)

10

b)

5

c)

Nothing will print

d)

True

65.

7.What will be the output of this program?

number = 10

less_than_zero = number < 0

if less_than_zero:

print(number)


number = number-2

less_than_zero = number > 0

if less_than_zero:

print(number)

a)

8

b)

10

c)

8

10

d)

10

8

66.

What is the output of the Python code :

(a)  

67.

Identify output :

a)

OK

b)

ERROR

c)

No output

68.

What will be the output of the above code:

a)

A

b)

B

c)

A and B

d)

Error

69.

What will be the output of the expression:

3<(10 or 2)

a)

True

b)

False

c)

3

d)

10

70.

What will be the output:

(50<100)and(10<100)

a)

50

b)

100

c)

True

d)

False

71.

Evaluate the expression :

a=10

b=15

a and b

a)

10

b)

15

c)

True

d)

False

72.

Predict the output:

a,b=10,20

c=b

print(b is c)

a)

True

b)

False

73.

Predict the output:

a=b=10

c,b=b,a+5

print(a,b,c)

a)

10 10 10

b)

15 10 10

c)

10 15 10

d)

10 15 15

74.

Predict the output:

"5" in [1,2,3,4,5]

a)

True

b)

False

75.

Predict the output:

print(2+12//4-25%3)

a)

12

b)

6

c)

4

d)

0

76.

If the following expression is evaluated, what type of error will occur?

x=10/0

print(x)

a)

logical error

b)

Syntax error

c)

Runtime error

d)

No error

77.

What will be the output of the following expression:

-14>-15

a)

True

b)

False

c)

Error

d)

No output

78.

Predict the output of the following code:

a,b,c=5,12,35

x,y,z=c-20,b+3,a*2

print(x,y,z)

a)

15 10 15

b)

15 15 10

c)

10 15 15

d)

15 10 10

79.

Predict the output of the following code:

L=[10,24,23,45,67]

print(100//10 in L)

a)

TRUE

b)

FALSE

c)

ERROR

d)

NO OUTPUT

80.

Predict the output of the following code:

x=8

y=2

x+=y

y-=x

print(x,y)

a)

10 -6

b)

10 -8

c)

8 -6

d)

8 -8