wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Year 9 Python Basics Term 1 assessment

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

What is a variable used for in Python?

a)

To store data

b)

To print text

c)

To delete files

d)

To draw shapes

2.

Which symbol is used to assign a value to a variable?

a)

==

b)

=

c)

!=

d)

<>

3.

Which of these is a number?

a)

'hello'

b)

True

c)

5

d)

[1, 2, 3]

4.

Which of these is a string?

a)

5

b)

'hello'

c)

True

d)

[1, 2, 3]

5.

Which of these is a list?

a)

[1, 2, 3]

b)

'list'

c)

True

d)

5

6.

How do you print something in Python?

a)

show()

b)

print()

c)

display()

d)

output()

7.

What does the + operator do with numbers?

a)

Adds them

b)

Subtracts them

c)

Multiplies them

d)

Divides them

8.

What does the + operator do with strings?

a)

Adds them

b)

Joins them

c)

Deletes them

d)

Multiplies them

9.

Which of these is a correct list?

a)

[1, 2, 3]

b)

(1, 2, 3)

c)

{1, 2, 3}

d)

<1, 2, 3>

10.

How do you get the first item in a list called my_list?

a)

my_list[0]

b)

my_list(0)

c)

my_list{0}

d)

my_list<0>

11.

What does True mean in Python?

a)

Yes

b)

No

c)

Error

d)

Nothing

12.

Which of these is a boolean value?

a)

True

b)

'True'

c)

5

d)

[True]

13.

How do you add something to a list?

a)

list.add()

b)

list.append()

c)

list.insert()

d)

list.push()

14.

What does len() do?

a)

Adds numbers

b)

Counts items

c)

Deletes items

d)

Prints items

15.

Which of these is a correct variable name?

a)

my_var

b)

2var

c)

var-name

d)

var name

16.

What is the result of 3 * 2?

a)

6

b)

5

c)

3

d)

9

17.

What is the result of 10 / 2?

a)

5.0

b)

5

c)

2

d)

10

18.

What is the result of 10 % 3?

a)

1

b)

3

c)

0

d)

10

19.

Which function changes a number to a string?

a)

str()

b)

int()

c)

float()

d)

bool()

20.

Which function changes a string to a number?

a)

int()

b)

str()

c)

float()

d)

bool()

21.

What does == mean in Python?

a)

Equal to

b)

Assign

c)

Not equal

d)

Greater than

22.

What does != mean in Python?

a)

Not equal

b)

Equal

c)

Assign

d)

Less than

23.

Which symbol is used for comments?

a)

#

b)

//

c)

--

d)

/*

24.

What is the result of 'Hi' + ' there'?

a)

Hi there

b)

Hi+there

c)

Error

d)

Hi there

25.

What is the result of True and False?

a)

False

b)

True

c)

Error

d)

None