
Unit 1 Python - Part 2
Quiz by Jennifer Whiteaker
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
- Q1
What does the 'and' logical operator do?
Combines two statements that have opposite truth values
Return True if at least one of the statements is true
Combines two statements that are both false
Combines two statements that are both true
30s - Q2
What does the 'or' logical operator do?
Combines two statements that are both false
Combines two statements that are both true
Combines two statements that have opposite truth values
Returns True if at least one of the statements is true
30s - Q3
Does the following code return True or False?
3 != 4
Integer
True
False
Boolean
30s - Q4
Which comparison operator is used to check if two values are not equal?
==
>
!=
<=
30s - Q5
Which comparison operator is used to check if one value is greater than or equal to another value?
<=
>=
==
<>=
30s - Q6
Which comparison operator is used to check if one value is less than another value?
<=
<
>
<>
30s - Q7
What is the difference between the == and = operators in Python?
== is never correct to use.
== is used for comparison and = is used for assignment
No difference. They mean the same thing.
= is used for comparison and == is used for assignment
30s - Q8
camelCase and snake_case are the two naming conventions we use in Python to name variables
True
False
30s - Q9
A variable name can contain spaces
True
False
30s - Q10
A variable name can contain a symbol
True
False
30s - Q11
A variable name cannot start with a number
True
False
30s - Q12
age and AGE are the same variable
False
True
30s - Q13What is the correct syntax to create a variable named 'age' and assign it the value 18 in Python?age = 1818 = ageage == 18variable age = 1830s
- Q14
What is the output of the following code?
num = 6
if num > 6
print ("Greater than 6")
else:
print ("Not greater than 6")
Error
Nothing will print
Not greater than 6
Greater than 6
30s - Q15
What is the output of the following code?
name = "Joe"
print name * 2
JoeJoe
Error
Nothing will print
Joe
30s