WorksheetsGrade 9 – Diagnostic Test
Total questions: 20
Worksheet time: 23mins
Which of the following is the correct way to print in Python?
echo "Hello"
printf("Hello")
print("Hello")
say("Hello")
Python is case-sensitive, so name and Name are considered different variables.
True
False
What is the correct operator to find the remainder of a division in Python?
%
//
/
*
Which data type is used to store text in Python?
int
float
str
bool
What is the output of print("Hello" + " World")?
Hello World
HelloWorld
Error
"Hello" "World"
input() function in Python is used to display output on the screen.
True
False
Write a Python statement that assigns the value 10 to a variable called age.
Which of these is a valid variable name in Python?
2name
my-name
my_name
class
What will be printed by print(1 + 2)?
Which of the following is a Boolean value in Python?
"True"
1
True
Yes
The if statement is used in Python to repeat a block of code many times.
True
False
Write the Python code to take input from a user and store it in a variable called name.
What is the output of this code: print("Hello" + " " + "World")?
Hello World
HelloWorld
Error
"Hello" "World"
Which HTML tag is used to create the largest heading?
h1
h2
h4
h6
To add an image in HTML we use:
<img>
<image>
Write the HTML code to display a paragraph that says: Welcome to Grade 9 ICT.
Write the HTML code to create a hyperlink to https://www.google.com with the text Visit Google.
Which HTML tag is used to create a hyperlink?
<a>
<link>
<href>
<url>
In Python, which keyword is used to define a function?
define
func
def
function
What is the output of this code: print(5 * 2)?
10
12
7
25
