
Python Lambdas and map
Quiz
•
Computers
•
9th Grade
•
Medium

Stephen Robinson
Used 1+ times
FREE Resource
Enhance your content
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of 'number % 2' when 'number' is 8?
0
1
2
8
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid ternary if statement in Python?
`x = 1 if y > 0 else 0`
`x = if y > 0 then 1 else 0`
`x = y > 0 ? 1 : 0`
`x = 1 else 0 if y > 0`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assuming numbers is a list: Which of the following is the correct syntax to use the `map` function with a lambda?
map(lambda x: x + 1, numbers)
map(x: x ** 2, numbers)
map(lambda x: x ** 2)
map(lambda x: x ** 2, numbers)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What type of object does the `map` function return in Python 3?
List
Tuple
Map object
Dictionary
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct use of the `lambda` to replace a sum function?
lambda x, y: x * y
lambda x, y: x - y
lambda x, y: x + y
lambda x, y: x / y
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
what lambda would be used for a subtract function in place of the add?
:lambda = x+y
lambda x , y: x - y
x= lambda :x-y
x , y lambda y + x:
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct syntax for using `map` with a lambda function that takes two parameters?
map(lambda x: x + 1, list1)
map(lambda x, y: x * y, list1)
map(lambda x, y: x + y, list1, list2)
map(lambda x: x - 1, list2)
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
8° / 9° Pensamento Computacional
Quiz
•
9th Grade
10 questions
Storyboards - R081 - Creative iMedia
Quiz
•
8th - 10th Grade
11 questions
Digital Imaging
Quiz
•
KG - University
14 questions
p5.js Week1 PREtest
Quiz
•
7th - 12th Grade
8 questions
Blender L1
Quiz
•
7th - 9th Grade
13 questions
CMU CS Academy Unit 3.2.3 If Else Statements
Quiz
•
9th Grade
10 questions
Circle Map in Thinking Map CFA
Quiz
•
9th - 12th Grade
16 questions
GameMaker - Quiz #2
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
30 questions
Computer Terminology Exercise #1 ( Fill Ins)
Quiz
•
9th Grade
15 questions
MLA Formatting
Quiz
•
9th Grade
20 questions
Typing Practice
Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro
Lesson
•
5th - 9th Grade
20 questions
Google Sheets Quiz
Quiz
•
9th Grade