wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python revision quiz

Total questions: 22

Worksheet time: 16mins

Name
Class
Date
1.

Conditions are used to create ___________ algorithms.

a)

conditional

b)

looping

c)

general

d)

operator

2.

A condition is a step in an algorithm where a ________ is made.

a)

choice

b)

condition

c)

decision

d)

option

3.

What will be the output for given code?

a)

5

b)

7

c)

2

d)

6

4.

What will be the datatype of the result?

a)

float and int

b)

int and float

c)

int and int

d)

float and float

5.

What will be the output of given code?

a)

Your score is : 50

b)

50

c)

Error

d)

Your score is: 0

6.

Which Arithmetic operator is not present in Edublock ?

a)

Floor division (//)

b)

Multiplication ( * )

c)

Exponentiation( ** )

d)

Addition(+)

7.
This operator means that one value is the same as the other value
a)
==
b)
!=
c)
>
d)
<
8.
This operator means that one value is not equal to another value
a)
==
b)
<=
c)
>=
d)
!=
9.
Which is the correct syntax?
a)
has_dog = true
b)
has_dog = True
c)
has_dog = Treu
d)
HAS_DOG = tRue
10.
An if statement must evaluate to:
a)
Right or Wrong
b)
True
c)
True or False
d)
False
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.
I am 71 years old! What will the output be?: IF you are 70 or older, say “You are aged to perfection!” ELIF you are exactly 50, say “Wow, you are half a century old!” ELSE say “You are a spring chicken!”
a)
“You are aged to perfection!”
b)
"Wow, you are half a century old!"
c)
"You are a spring chicken!"
13.
I am 18 years old! What will the output be?: IF you are 70 or older, say “You are aged to perfection!” ELIF you are exactly 50, say “Wow, you are half a century old!” ELSE say “You are a spring chicken!”
a)
"You are aged to perfection"
b)
"Wow, you are half a century old!"
c)
"You are spring chicken!"
14.

What does <= mean?

a)

less than

b)

greater than

c)

less than or equal to

d)

greater than or equal to

15.

Which of the following is NOT a comparison operator in C++ language?

a)

>

b)

<=

c)

=

d)

==

16.

Evaluate the following expressions to true or false


3!=4-1

a)

true

b)

False

17.

Evaluate the following expressions to true or false


5 >= (1+6)-4

a)

True

b)

False

18.

Evaluate the following expressions to true or false

5+1 == 6 OR 8-1 > 4

a)

True

b)

False

19.

What is the maximum number of if-else statements you can use in a program?

a)

As Many as You Need

b)

2*44

c)

Ten

d)

99

20.

Which one is not a correct data type?

a)

int

b)

float

c)

real

d)

char

21.

Find if the condition is True or False where int x=10; y=12;

x == y

a)

1 (True)

b)

0 (False)

22.

Find if the condition is True or False where int x=10; y=12;

x < y

a)

1 (True)

b)

0 (False)