wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python 2 TEST

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

Provide context for why something is written the way it is:

a)

comments

b)

strings

c)

print

d)

variables

2.

When printing things in Python, we are supplying a text block that we want to be printed. It is so named because they're a series of letters, numbers, or symbols connected in order — as if threaded together by string.

a)

variables

b)

integers

c)

floats

d)

strings

3.

In Python, and when programming in general, we need to build systems for dealing with data that changes over time. That data could be the location of a plane, or the time of day, or the television show you're currently watching.

a)

strings

b)

variables

c)

booleans

d)

integers

4.

Addition, subtraction, multiplication, division, and other numeric calculations are easy to do in most programming languages.

a)

arithmetic

b)

addition

c)

subtraction

d)

math

5.

This function is used to tell a computer to talk.

a)

talk

b)

speak

c)

print

d)

variable

6.

Whole number with no decimal point

a)

whole number

b)

decimal

c)

float

d)

integer

7.

A number with a decimal point

a)

boolean

b)

integer

c)

float

d)

decimal

8.

This is like a light switch. It can only have two values. Just like a light switch can only be on or off, this can only be True or False.

a)

boolean

b)

and/or

c)

true/false

d)

print statement

9.

Used to structure code. On Codeacademy, we will use two-space indentation (two blank spaces for each indentation) to make sure you can easily read code with multiple indentations in your browser.

a)

white space

b)

indention

c)

Python 2

d)

blank space

10.

The window on the right side of the page is called the _______________. This runs your code line by line, and checks for any errors.

a)

screen

b)

answer

c)

console

d)

monitor

11.

A line of text that Python won't try to run as code. It's just for humans to read.

a)

parentheses

b)

string

c)

single line comments

d)

multiple line comments

12.

Prints text on more than one line. Include the whole block in a set of triple quotation marks

a)

variable

b)

comments

c)

single line comments

d)

multi-line comments

13.

Use ____ to multiply numbers in Python.

a)

*

b)

/

c)

+

d)

x

14.

Can contain letters, numbers, and symbols.

a)

variable

b)

text

c)

Boolean

d)

string

15.

Gets the length (the number of characters) of a string!

a)

upper()

b)

lower()

c)

str()

d)

len()

16.

method to get rid of all the capitalization in your strings.

a)

upper()

b)

lower()

c)

len()

d)

str()

17.

a string completely in ALL CAPS.

a)

upper()

b)

UPPER()

c)

lower()

d)

LOWER()

18.

print "Life " + "of " + "Brian"

a)

string concatenation

b)

string combination

c)

string concentration

d)

string sentences

19.

Sometimes you need to combine a string with something that isn’t a string. In order to do that, you have to convert the non-string into a string.

a)

string combination

b)

string concatenation

c)

Explicit string conversion

20.

to retrieve the current date and time.

a)

datetime.now()

b)

datetime.month()

c)

datetime.day()

d)

datetime.year()

21.

==

a)

Greater Than

b)

Less Than

c)

Not equal to

d)

Equal to

22.

!=

a)

greater than

b)

less than

c)

not equal to

d)

equal to

23.

**

a)

to the power of (exponentiation)

b)

greater than

c)

equal to

d)

makes a comment

24.

%

a)

The remaining number left over when you divide.

b)

multiplication

c)

not equal to

d)

exponents

25.

**

a)

multiply

b)

exponent - to the power of

c)

divide

d)

add

26.

The order of Boolean operators is:

NOT, AND, OR

a)

TRUE

b)

FALSE

27.

The area we type our code.

a)

Concatenation

b)

Interpret

c)

Console

d)

Editor

28.

The Boolean operator AND returns ___________ when the expressions on both sides of and are true.

a)

True

b)

False

c)

AND

d)

OR

29.

Elif means:

a)

OR

b)

ELSE

c)

else if

d)

NOT

30.

Python 2 allows the user to put "" or '' around strings of text. Ex. "dog" or 'dog'

a)

true

b)

false