Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Review 5/20/22

Total questions: 17

Worksheet time: 11mins

Name
Class
Date
1.

T/F: The "elif" statement will only run if the "if" statement before it is False

a)

True

b)

False

2.

What is the output of the following code?

a)

"Invalid: size should only use digits"

b)

"size is too low"

c)

"size is recorded"

d)

"size is too high"

3.

What is the output of the following code?

a)

"Invalid: size should only use digits"

b)

"size is too low"

c)

"size is recorded"

d)

"size is too high"

4.

What is it called when you change data from one data type to another? (For example from a string to an integer?)

a)

Switching

b)

Casting

c)

Converting

d)

Changing

5.

If you wanted to cast the string "6" to an integer, which code would you use?

a)

num("6")

b)

def("6")

c)

str("6")

d)

int("6")

6.

T/F: Python follows the same order of operations as mathematics?

a)

True

b)

False

7.

For the code: x= 3+9*2, what value will be returned?

a)

12

b)

24

c)

21

d)

54

8.

What is the output of the following code?

a)

9

b)

9.0

c)

1

d)

1.0

9.

What is the output of the following code?

a)

13

b)

13.0

c)

9

d)

9.0

10.

T/F: Nested conditionals will only run if the "if" statement above it is True

a)

True

b)

False

11.

What is the output of the following code if the grade variable has a value of 85?

a)

Passing grade of A

b)

Passing grade of B

c)

Passing grade of C

d)

Failing grade

12.

What will be the output of this code if the grade variable has a value of 54?

a)

Passing grade of B

b)

Passing grade of C

c)

Passing grade of D

d)

Failing grade

13.

What is the output of the following code if the grade variable has a value of 94? (Pay close attention)

a)

Passing grade of A

b)

Passing grade of B

c)

Passing grade of C

d)

Passing grade of D

14.

T/F: Escape sequences start with a backslash (\)

a)

True

b)

False

15.

If you want to tab over, which escape sequence should you use?

a)

\n

b)

\\

c)

\t

d)

\tab

16.

If you want to print a backslash using escape sequencing, which one would you use?

a)

\\

b)

\t

c)

\n

d)

\b

17.

What is the output of the following code?

a)

A

b)

B

c)

C

d)

D