Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Foundations of Programming

Total questions: 18

Worksheet time: 18mins

Name
Class
Date
1.

Python is a ______ - ________ Language

(a)  

2.

What is a Boolean?

a)

True or False statement

b)

Numerical Operator

c)

A cube that is used for a soup base.

d)

A Ghost on a tree

3.

Python language was developed in what year?

a)

1985

b)

2001

c)

1991

d)

1820

4.

Python uses indentation to block code into chunks

a)

True

b)

False

5.
What will the output be from the following code?
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!
6.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
7.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
8.
If you want more than one option for your code, what do you use (after if)?
a)
elif
b)
else
c)
ifif
9.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
10.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
11.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
12.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
13.

What is a Count-Controlled loop?

a)

for loop

b)

while loop

14.

Which of these operators means EQUAL TO?

a)

'='

b)

'=>'

c)

'<='

d)

'=='

15.

Which of these will allow me to count from 0-20 in steps of 5?

a)

for x in range(0,20):

print(x)

b)

while x = (0,20,5):

print(x)

c)

for x in range(0,21,5):

print(x)

d)

for x in range(0,21,5):

print(y)

16.

If I want to continuously check for a correct answer, what loop would I use?

a)

for loop

b)

while loop

17.

How many lines will this code print?

x = 10

while x > 0:

print(x)

x = x - 3

a)

5

b)

2

c)

3

d)

4

18.

There are 7 main types of numeric operators

a)

True

b)

False