wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Assessment preparatory quiz

Total questions: 49

Worksheet time: 26mins

Name
Class
Date
1.

Python is a

a)

text language

b)

database language

c)

programming language

2.

Code for Hello, World!

a)

print Hello, World!

b)

print("Hello, World!)

c)

print("Hello, World!")

3.

Code for

Five is greater than two!

a)

if 5 > 2:

print("Five is greater than two!")

b)

if 5 = 2:

print("Five is greater than two!")

c)

if 5 > 2: Print("Five is greater than two!")

4.

Code for

257

Hello, World!

a)

x = 257

y = "Hello, World!"


print(y)

print(x)

b)

x = 257

y = "Hello, World!"


print(x)

print(y)

c)

x = 257

y = Hello, World!


print x

print y

5.

Code for

b is greater than a

a)

a = 33

b = 200


if b > a:

print("b is greater than a")

b)

a = 33

b = 200


if b < a:

print("b is greater than a")

c)

a = 330

b = 200


if b > a:

print("b is greater than a")

6.
Look at this code, how many times will it loop?
a)
50
b)
90
c)
0
d)
4
7.
Look at this code, what shape will it make?
a)
Square
b)
Triangle
c)
Rectangle
d)
Hexagon 
8.
Look at this code, what is the variable? 
a)
0
b)
4
c)
for
d)
i
9.
What is wrong with this code?
a)
Missing Brackets
b)
Missing Comma
c)
Missing Colon
d)
Incorrect spelling 
10.
What is wrong with this code?
a)
Missing Brackets
b)
Missing Comma
c)
Missing Colon
d)
Incorrect spelling 
11.

In Python, a function is created by using which key word?

a)

sub

b)

fun

c)

def

d)

pro

12.
When creating a def in Python, what is the correct order for the elements?
a)
def ( ) subroutine :
b)
def subroutine : ( )
c)
def subroutine ( ) :
d)
def : ( ) subroutine
13.
When using a command to move the turtle to a specific position on the drawing canvas, the middle of the canvas is represented by which coordinates?
a)
1, 1
b)
100, 100
c)
0, 0
d)
500, 500
14.
How do you tell that Python that you are going to use the turtle library?
a)

import_turtle

b)

turtle import

c)

import turtle

d)

from turtle import

15.
In order to move the turtle 120 forward without drawing on the screen, which order is correct?
a)
turtle.forward(120)
turtle.penup()
turtle.pendown()
b)
turtle.pendown()
turtle.forward(120)
turtle.penup()
c)
turtle.penup()
turtle.forward(120)
turtle.pendown()
16.
What is the extension on a Python file name?
a)
.py
b)
.xls
c)
.doc
d)
.ppt
17.

What is the keyword needed to repeat code (iterate) in Python?

a)

for

b)

if

c)

input

d)

print

18.

There is an error on this piece of code, what is wrong?

a)

Nothing

b)

No full stop needed in the pen.down statement e.g. turtle.pendown()

c)

No brackets needed in the pen.down statement e.g. turtle.pen.down

d)

No turtle prefix needed in the pen.down statement e.g. pen.down()

19.

There is an error on this piece of code, how should it be written?

a)

There is no error

b)

turtle.right(90)

c)

turn.right(90)

d)

right(90)

20.

There is an error on this piece of code, how should it be written?

a)

There is no error

b)

turtle.right(90)

c)

turtle.drawcircle(10)

d)

import.turtle

21.

The program above

a)

prints all the odd numbers between 1 and 20

b)

prints all even numbers between 1 and 20

c)

print all the odd numbers between 1 and 21

d)

prints all the even numbers between 1 and 21

22.

The above program prints

a)

Numbers 1 to 10 in reverse order

b)

Numbers 1 to 11 in reverse order

c)

Numbers 1 to 10

d)

Numbers 1 to 11

23.

The program above prints each number between 1 and 10

a)

as many times as the number itself

b)

10 times

c)

11 times

24.

How many times will 1 be printed

a)

3

b)

4

c)

5

d)

6

25.

The default return value of any function in Python is _______________.

a)

null

b)

0

c)

None

d)

Garbage value

26.

Which of the following items are present in the function header?

a)

Function name only

b)

Both function name and parameter list

c)

parameter list only

d)

Return value

27.

What does a opening tag look like?

a)

< >

b)

</ >

c)

<< >>

d)

<

28.

What does a closing tag look like?

a)

< >

b)

<\ >

c)

</ >

d)

<< >>

29.

Which tag would you use for an ordered list?

a)

<ol>

b)

<ul>

c)

<li>

d)

None of the above

30.

What is the difference between <h1> and <h2>?

a)

<h1> is larger in size than <h2>

b)

<h2> is larger in size than <h1>

c)

both are the same size but different headings

d)

none of the above

31.

Which tag would you use to insert a image?

a)

<marquee>

b)

< a href>

c)

<br>

d)

<img src>

32.

Which tag would you use to create a hyperlink?

a)

<a href>

b)

<img src>

c)

<br>

d)

<link>

33.

Which tag does not need a closing tag?

a)

<a href>

b)

<head>

c)

<body>

d)

<img src>

34.
What does HTML stand for?
a)
Hypertext Making Language
b)
Hyper Transfer Markup Language
c)
Hypertext Markup Language
d)
Hyper Transfer Making Language
35.
<p> is
a)
punctuation tag
b)
closing paragraph tag
c)
closing punctuation tag
d)
paragraph tag
36.
Body tags are used;
a)
Used for only the header
b)
Used only for the paragraph
c)
element that wraps everything that is visible on the page.
d)
Not used in HTML
37.
<body>
a)
Body tag
b)
Paragraph tag
c)
Closing body tag
d)
Header tag
38.
<img> tag finds;
a)
finds the image located at the a URL and the src attribute and then displays it.
b)
finds the image located at the SRC in the URL attribute and then displays it.
c)
Adds a cool picture
d)
Does not work in HTML coding
39.

HTML controls the _________ of a webpage.

a)

feel

b)

precision

c)

structure

d)

style

40.

Which code below is correct for a hyperlink

a)

<a>

"https://google.com"

Click Me

</a>

b)

<a>Click Me>

"https://google.com"

</a>

c)

<a herf="https://google.com">

Click Me

</a>

d)

<a href="https://google.com">

Click Me

</a>

41.

Which is the correct HTML element for inserting a line break?

a)

<b>

b)

<lb>

c)

<br/>

d)

<break>

42.

an opening tag that doesn't have a closing tag

a)

comment

b)

container tag

c)

element

d)

empty tag

43.

only takes up as much width as necessary, and does not force line breaks

a)

inline element

b)

list

c)

internal link

d)

markup language

44.

An <em> tag will

a)

not work inside a div element.

b)

mark text as having been highlighted.

c)

make text appear to be bold.

d)

make text appear to be in italics.

45.

<input> is

a)

a parent element of the <body> tag.

b)

how you build a list of options in a form.

c)

a block-level element.

d)

an inline element.

46.

<div> is

a)

an inline element

b)

a block-level element

c)

the parent of the <body> tag

d)

deprecated

47.
Which is the correct code to insert a horizontal line in a webpage?
a)
<br>
b)
<h1>
c)
<hr>
d)
<li>
48.
What is the proper code to insert an image named "frog.jpg"?
a)
<img src="frog" width="104" height="142">
b)
<img src="frog.jpg" width="104" height="142">
c)
<img="frog.jpg" width="104" height="142">
d)
<img ="frog" width="104" height"142">
49.

Do block elements need to start on a new line ?

a)

Yes

b)

No