Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Grade 9 – Diagnostic Test

Total questions: 20

Worksheet time: 23mins

Name
Class
Date
1.

Which of the following is the correct way to print in Python?

a)

echo "Hello"

b)

printf("Hello")

c)

print("Hello")

d)

say("Hello")

2.

Python is case-sensitive, so name and Name are considered different variables.

a)

True

b)

False

3.

What is the correct operator to find the remainder of a division in Python?

a)

%

b)

//

c)

/

d)

*

4.

Which data type is used to store text in Python?

a)

int

b)

float

c)

str

d)

bool

5.

What is the output of print("Hello" + " World")?

a)

Hello World

b)

HelloWorld

c)

Error

d)

"Hello" "World"

6.

input() function in Python is used to display output on the screen.

a)

True

b)

False

7.

Write a Python statement that assigns the value 10 to a variable called age.

4 lines
8.

Which of these is a valid variable name in Python?

a)

2name

b)

my-name

c)

my_name

d)

class

9.

What will be printed by print(1 + 2)?

4 lines
10.

Which of the following is a Boolean value in Python?

a)

"True"

b)

1

c)

True

d)

Yes

11.

The if statement is used in Python to repeat a block of code many times.

a)

True

b)

False

12.

Write the Python code to take input from a user and store it in a variable called name.

4 lines
13.

What is the output of this code: print("Hello" + " " + "World")?

a)

Hello World

b)

HelloWorld

c)

Error

d)

"Hello" "World"

14.

Which HTML tag is used to create the largest heading?

a)

h1

b)

h2

c)

h4

d)

h6

15.

To add an image in HTML we use:

a)

<img>

b)

<image>

16.

Write the HTML code to display a paragraph that says: Welcome to Grade 9 ICT.

4 lines
17.

Write the HTML code to create a hyperlink to https://www.google.com with the text Visit Google.

4 lines
18.

Which HTML tag is used to create a hyperlink?

a)

<a>

b)

<link>

c)

<href>

d)

<url>

19.

In Python, which keyword is used to define a function?

a)

define

b)

func

c)

def

d)

function

20.

What is the output of this code: print(5 * 2)?

a)

10

b)

12

c)

7

d)

25