wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Vocab

Total questions: 34

Worksheet time: 17mins

Name
Class
Date
1.

Command displays text and numbers on the screen.

a)

Print

b)

write

c)

print

d)

function

2.

Gives the remainder of integers which have been divided.

a)

Modulus

b)

Division

c)

Multiplication

d)

Compiler

3.

Information sent to a function.

a)

Detail

b)

Command

c)

Parameter

d)

print

4.

Command that tests a true/false condition.

a)

while loop

b)

if

c)

else

d)

lie

5.
To create a newline at the end of a prompt, you can use which of the following expressions?
a)
\new
b)
\return
c)
\break
d)
\n
6.
Which of the following is not a reserved word in Python?
a)
in
b)
for
c)
while
d)
function
7.
A _____________ expression is an expression that is either true or false. 
a)
boolean
b)
truth
c)
variable
d)
conditional
8.
There are three logical operators in Python:
and, or, ____
a)
in
b)
else
c)
not
d)
true
9.
In a conditional statement, the boolean expression after the if or elif statement is called a ______________.
a)
condition
b)
print
c)
function
d)
definition
10.
The first line of a function definition is called a header. The rest of the function definition is called the _______. 
a)
body
b)
conclusion
c)
execution
d)
return
11.
A(n) _______ specifies a position of a character in a sequence. 
a)
function
b)
bracket
c)
index
d)
module
12.
To obtain the length of a string, you can use which function?
a)
length()
b)
len()
c)
index()
d)
length_input()
13.
When you use this symbol in your code, #, you can write notes to yourself that the computer will ignore. These are called:
a)
Syntax
b)
Commands
c)
Comments
d)
Identifiers
14.
This shows the structure of the code in Python and is not optional. 
a)
Loop
b)
"For" Loop
c)
Indentation
d)
Nesting
15.
This will stop a loop from iterating before it ends naturally. 
a)
"While" Loop
b)
"Do-while" Loop
c)
"Break" Statement
d)
Infinite Loop
16.

This loop will never stop iterating.

a)

Infinite Loop

b)

"Break" Statement

c)

"While" Loop

d)

"Do-while" Loop

17.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
18.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

19.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
20.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
21.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
22.

If you want to create an empty list called colors in Python, which of the following is correct?

a)

colors = [ ]

b)

colors = ( )

c)

colors = { }

d)

colors = <>

23.
What is the position of the name "Robert" in the following list:
a)
0
b)
1
c)
2
d)
3
24.
What does the APPEND procedure do in the following code:
a)
Adds Liverpool to the beginning of the list
b)
Replaces Bristol with Liverpool
c)
Replaces Manchester with Liverpool
d)
Adds Liverpool to the end of the list
25.

Each item in a list has an index. What is the first index in a Python list?

a)

0

b)

1

c)

a

d)

A

26.
The correct way to write a variable in Python?
a)
my_variable = 10
b)
my variable = 10
c)
my_variable is 10
d)
my_variable: 10
27.

Which of these is correct Python conditional statement?

a)

IF answer == "Yes":

b)

if answer == "Yes"

c)

if answer == "Yes":

d)

if answer = "yes":

28.

Which of these operators means EQUAL TO?

a)

=

b)

=>

c)

<=

d)

==

29.
Look at this code, what is the variable? 
a)
0
b)
4
c)
for
d)
i
30.
In Python, a subroutine, function or procedure is created by using which key word?
a)
sub
b)
fun
c)
def
d)
pro
31.
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
32.

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)

33.

When you want to hide the turtle on the screen which command should you use?

a)

hide_turtle( )

b)

remove_turtle( )

c)

hideturtle( )

d)

turtle.disappear( )

34.

To make the turtle move forward, which command is used?

a)

turtle.penup()

b)

turtle.forward()

c)

turtle.left()

d)

turtle.backward()