WorksheetsReview 5/20/22
Total questions: 17
Worksheet time: 11mins
T/F: The "elif" statement will only run if the "if" statement before it is False
True
False
What is the output of the following code?
"Invalid: size should only use digits"
"size is too low"
"size is recorded"
"size is too high"
What is the output of the following code?
"Invalid: size should only use digits"
"size is too low"
"size is recorded"
"size is too high"
What is it called when you change data from one data type to another? (For example from a string to an integer?)
Switching
Casting
Converting
Changing
If you wanted to cast the string "6" to an integer, which code would you use?
num("6")
def("6")
str("6")
int("6")
T/F: Python follows the same order of operations as mathematics?
True
False
For the code: x= 3+9*2, what value will be returned?
12
24
21
54
What is the output of the following code?
9
9.0
1
1.0
What is the output of the following code?
13
13.0
9
9.0
T/F: Nested conditionals will only run if the "if" statement above it is True
True
False
What is the output of the following code if the grade variable has a value of 85?
Passing grade of A
Passing grade of B
Passing grade of C
Failing grade
What will be the output of this code if the grade variable has a value of 54?
Passing grade of B
Passing grade of C
Passing grade of D
Failing grade
What is the output of the following code if the grade variable has a value of 94? (Pay close attention)
Passing grade of A
Passing grade of B
Passing grade of C
Passing grade of D
T/F: Escape sequences start with a backslash (\)
True
False
If you want to tab over, which escape sequence should you use?
\n
\\
\t
\tab
If you want to print a backslash using escape sequencing, which one would you use?
\\
\t
\n
\b
What is the output of the following code?
A
B
C
D
