wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Lesson 15 - Test 2

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Total how many different type of loops are there in python?

a)

0

b)

1

c)

2

d)

3

2.

For checking some condition, What do we need to use?

a)

Iterative statements

b)

jumping statements

c)

conditional statements

d)

None of the above

3.

Which function is used to change the pen size, in turtle module?

a)

pen()

b)

size()

c)

pensize()

d)

sizepen()

4.

For changing speed of drawing in turtle module, which function should be used?

a)

exent()

b)

steps()

c)

move()

d)

speed()

5.

Suppose we want to stop current iteration in a loop, what would be used?

a)

break

b)

continue

c)

pass

d)

All of the above

6.

With which statement you can use break statement ?

a)

condtional statement

b)

iterative statement

c)

declarative statement

d)

All of the above

7.

for I in range(2,2):, how many times this loop will execute ?

a)

0

b)

1

c)

2

d)

Infinite times

8.

For loop in python will work on ?

a)

range

b)

iteration

c)

both

d)

none

9.

How many times print statement will execute?

i=0

For i in range(1,100,2):

print(i)

a)

50

b)

100

c)

101

d)

49

10.

What does the following code print to the console?

a)

Boring

b)

You rock

c)

You rock

Boring

d)

None

11.

Which function is used for changing pointer shape ?

a)

turtle

b)

shape

c)

design

d)

size

12.

Which of the following is a valid for loop in Python?

a)

for(i=0; i<n; i++)

b)

for i in range(0,5):

c)

for i in range(0,5)

d)

for i in range(5)

13.

What will be the output of the following code?

x = 'abcd'

for i in range(len(x)):

print(i)

a)

abcd

b)

0 1 2 3

c)

1 2 3 4

d)

a b c d

14.

Which of the following Boolean expressions is not logically equivalent to the other three?

a)

not(-6<0 or-6>10)

b)

-6>=0 and -6<=10

c)

not(-6<10 or-6==10)

d)

not(-6>10 or-6==10)

15.

In a Python program, a control structure:

a)

Defines program-specific data structures

b)

Directs the order of execution of the statements in the program

c)

Dictates what happens before the program starts and after it terminates

d)

None of the above