
Python Lambdas and map
Authored by Stephen Robinson
Computers
9th Grade
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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)
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
10 questions
Visual Basic 2010
Quiz
•
8th Grade - University
9 questions
IT related jobs
Quiz
•
9th Grade
10 questions
S2 Subject Choice Quiz
Quiz
•
8th - 10th Grade
10 questions
Contact Center Sevices
Quiz
•
7th - 10th Grade
10 questions
Youtubers Charlie.C-J
Quiz
•
3rd - 9th Grade
8 questions
Basic computer
Quiz
•
9th - 12th Grade
8 questions
Excel
Quiz
•
1st - 12th Grade
10 questions
Licencias de Software
Quiz
•
9th - 10th 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