wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Vocab Chapters 1-6

Total questions: 25

Worksheet time: 26mins

Name
Class
Date
1.
Which of the following describes a program in high-level language
a)
Binary
b)
Hexadecimal
c)
Source Code
d)
Assembly Language
2.
Numbers with a decimal point belong to a type called...
a)
pointing
b)
integers
c)
decimal
d)
float
3.
An assignment statement.....
a)
names the program.
b)
assigns a value to a variable. 
c)
increases an iteration variable.
d)
is the conditional expression for an if-statement. 
4.
Reserved words are sometimes called _________.
a)
keywords
b)
variables
c)
functions
d)
methods
5.
The modulus operator, represented by the % symbol, serves what purpose?
a)
To tell time throughout the program. 
b)
Find the percentage of efficiency of a program. 
c)
Yields the remainder of two numbers after division. 
d)
Yields the simplified ratio of two numbers after divison. 
6.
The + operator links two strings together. What do we call this operator?
a)
Addition
b)
Concatenation
c)
Combination
d)
Compilation
7.
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
8.
Which of the following is not a reserved word in Python?
a)
in
b)
for
c)
while
d)
function
9.
A _____________ expression is an expression that is either true or false. 
a)
boolean
b)
truth
c)
variable
d)
conditional
10.
There are three logical operators in Python:
and, or, ____
a)
in
b)
else
c)
not
d)
true
11.
In a conditional statement, the boolean expression after the if or elif statement is called a ______________.
a)
condition
b)
print
c)
function
d)
definition
12.
What two reserved words can be used in a program as an "safety net" against invalid data entry from a user?
a)
if/else
b)
try/fail
c)
try/except
d)
attempt/else
13.
Parameters are variables used in the function ____________..
Arguments are variables used in the function ____________. 
a)
call ; definition
b)
statement ; return
c)
return ; statement
d)
definition ; call
14.
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
15.
The syntax for calling a function in another module is to specify the module name followed by a _____ and the function name. 
a)
dash
b)
dot
c)
underscore
d)
space
16.
Each time the body of a loop is executed, it is called a(n) _______________. 
a)
pass
b)
loopy
c)
iteration
d)
lap
17.
A ________ is a sequence of characters. 
a)
string
b)
floating point number
c)
boolean
d)
snake
18.
A(n) _______ specifies a position of a character in a sequence. 
a)
function
b)
bracket
c)
index
d)
module
19.
To obtain the length of a string, you can use which function?
a)
length()
b)
len()
c)
index()
d)
length_input()
20.
A segment of a string is called a(n) ____________. 
a)
shorter string
b)
index
c)
piece
d)
slice
21.
What is the purpose of the split() method for strings?
a)
It will split a string into two strings.
b)
It will split a string into a list of the individual words in the string
c)
It will split any numeric values in the string in half.
d)
It will split the string into string types and integer/float types. 
22.
Raw_input() is a function that uses which data type?
a)
Strings
b)
Float
c)
Integers
23.
What are the reserved words used in the code below:
for number in list:
   print number*2
a)
print
b)
for, print
c)
for, print, in
d)
for, print, in, list
24.
What does IDE stand for in the programming world?
a)
Integrated Development Environment
b)
Iteration Development Emulator
c)
Iteration Debugger Environment
25.
An IDE typically consists of a text editor, compiler/shell, a debugger, and a GUI builder. Which one have we NOT used in class?
a)
text editor
b)
compiler
c)
debugger
d)
GUI