wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Final Revision

Total questions: 25

Worksheet time: 12mins

Name
Class
Date
1.

Loops are a good way to repeat a sequence of code.

a)

True

b)

False

2.

Turtle is a simple tool to draw images using Python.

a)

True

b)

False

3.

To compare two values we use a double equals == symbol.

a)

True

b)

False

4.

What would happen if the user answers “n”?

a)

Ok bye gets printed

b)

Nothing happens

c)

Error

d)

It would ask the question again

5.

What is displayed by this code

a)

Mynumber

b)

0

c)

1

d)

print

6.

I want to print a string. Which print block to use: A or B?

a)

A

b)

B

7.

I want to print the value of a variable. Which print block do I use: A or B?

a)

A

b)

B

8.

What will be printed?

a)

0,1,2,3,4

b)

1,2,3,4,5

c)

i,i,i,i,i

9.

What will be printed?

a)

Hello World Once

b)

Endless Hello World

c)

Error

10.

What will be printed?

a)

Hello World Once

b)

Endless Hello World

c)

Nothing

11.

What will be printed?

a)

Hello World Once

b)

Endless Hello World

c)

Hello World 4 times

12.

What will be printed?

a)

0,1,2

b)

dog, cat, hamster

c)

dog, dog, dog

13.

What will be printed?

a)

0,1,2,3,4

b)

5 different random numbers from 1 to 5

c)

all 1s, all2s, all3s, all4s or all5s

14.

What will be printed?

a)

Endless dog, cat, hamster randomly

b)

dog, cat, hamster randomly once

c)

Endless 0, 1, 2 randomly

15.

what does this do

a)

Chose a random number

b)

import a library called random

c)

selecting a number between 1 and 13

d)

selecting a number between 1 and 100

16.

Which number could not be generated by this block

a)

1

b)

3

c)

13

d)

0

17.

What datatype would userNumber be after this block is run

a)

string

b)

integer

c)

real

d)

a number if they enter a number

18.

What will be displayed on the screen when

computerNumber = 10

and

userNumber = 10

a)

10

b)

SNAP

c)

20

d)

no snap

19.

Which shape will this block make?

a)

Triangle

b)

Circle

c)

Hexagon

d)

Pentagon

20.

What will be the output for given code?

a)

5

b)

7

c)

2

d)

6

21.

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

a)

>

b)

<=

c)

=

d)

==

22.

Which code would i use to add an item at the end to a list?

a)

variable.add()

b)

variable.append()

c)

append.variable()

d)

add.variable()

23.

how can we pick the 3rd element from the list?

a)

list[2]

b)

list(2)

c)

list(3)

d)

list[3]

24.

What will be the output of

a)

5

4

b)

4

4

c)

5

5

d)

4

5

25.

nameList = ["John", "Harry", "Jesse", "John", "Marry", "Larry"]

The list will be slice and show Harry and Jesse only. Which piece of code below would do this?

a)

print(nameList[1:3])

b)

print(nameList[0:1])

c)

print(nameList[1:2])

d)

print(nameList["Harry":"Jesse"])