
Higher Order Functiond and Regex

Quiz
•
Computers
•
12th Grade
•
Hard
Dhana Lakshmi
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a lambda function in Python?
A lambda function is an anonymous function defined with the lambda keyword, allowing for quick, inline function definitions.
A lambda function is a method for defining classes in Python.
A lambda function is a built-in Python library for data analysis.
A lambda function is a type of variable in Python.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you define a lambda function that adds two numbers?
lambda x, y: x - y
lambda a, b: a * b
lambda num1, num2: num1 / num2
lambda x, y: x + y
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the map() function in Python?
The purpose of the map() function in Python is to apply a function to every item in an iterable and return an iterator of the results.
To filter items from an iterable
To sort items in an iterable
To create a new list from an existing list
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How does the filter() function work in Python?
filter() modifies the original iterable by removing elements.
filter() filters elements from an iterable based on a function that returns True or False.
filter() sorts elements in an iterable based on their values.
filter() creates a new iterable without any conditions.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the reduce() function do in Python?
The reduce() function reduces an iterable to a single value by applying a function cumulatively.
The reduce() function filters elements from an iterable based on a condition.
The reduce() function sorts an iterable in ascending order.
The reduce() function splits an iterable into multiple values.
6.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Can you provide an example of using map() with a lambda function?
list(map(lambda x: x-1, range(5))
list(map(lambda x: x+1, [1, 2, 3, 4]))
map(lambda x: x*2, [1, 2, 3])
list(map(lambda x: x**2, [1, 2, 3, 4]))
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code: list(map(lambda x: x**2, [1, 2, 3, 4]))?
[1, 2, 3, 4]
[1, 8, 27, 64]
[0, 1, 4, 9]
[1, 4, 9, 16]
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Basic 2 Python

Quiz
•
12th Grade - Professi...
20 questions
Robotics Pretest

Quiz
•
9th - 12th Grade
16 questions
Variables and Data Types Knowledge Check

Quiz
•
9th - 12th Grade
20 questions
Python Basics & Syntax

Quiz
•
10th - 12th Grade
10 questions
Python Exception Handling

Quiz
•
10th - 12th Grade
20 questions
Mastering Python Loops and Functions

Quiz
•
10th Grade - University
10 questions
Random functions

Quiz
•
12th Grade
15 questions
Exploring Python Fundamentals

Quiz
•
12th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade