
Python List Comprehensions Quiz
Authored by Nicol Sutherland
Computers
12th Grade

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why does Python provide list comprehensions?
To increase the length of code
To simplify the process of creating lists
To make code more complex
To make lists immutable
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What surrounds a list comprehension in Python?
Brackets
Angle brackets
Curly braces
Parentheses
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a list comprehension, what follows the expression?
A variable assignment
A function call
A for loop
A while loop
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you create a list of the squares of the first 100 positive integers using list comprehensions?
[i**2 for i in range(0, 100)]
[i*2 for i in range(1, 101)]
[i^2 for i in range(1, 101)]
[i**2 for i in range(1, 101)]
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What operator is used to find the remainder when dividing by a number in Python?
/
//
%
**
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you filter a list comprehension to include only certain items?
Using a break statement
Using a while loop
Using a continue statement
Using an if clause
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method can be used to check if a string starts with a specific letter?
endswith()
find()
startswith()
contains()
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
11 questions
Email of request
Quiz
•
12th Grade - Professi...
11 questions
Unit 2, 1.3 Types of information access and storage devices
Quiz
•
12th Grade
13 questions
ICT and Retail Industry
Quiz
•
8th - 12th Grade
17 questions
Security and Ethics
Quiz
•
9th - 12th Grade
20 questions
Design your website
Quiz
•
7th - 12th Grade
16 questions
OCR Sys Arch J277
Quiz
•
10th - 12th Grade
14 questions
ITGS - IT Systems (Hardware)
Quiz
•
10th - 12th Grade
13 questions
INTERNET CONNECTION
Quiz
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade