Higher Order Functiond and Regex

Higher Order Functiond and Regex

12th Grade

15 Qs

quiz-placeholder

Similar activities

Revision for grade12- week 1 &2

Revision for grade12- week 1 &2

12th Grade

15 Qs

Quiz sobre Administración

Quiz sobre Administración

12th Grade - University

20 Qs

HTML Fundamentals

HTML Fundamentals

10th - 12th Grade

14 Qs

Personal Finance 3.01-3.07 Review Quiz

Personal Finance 3.01-3.07 Review Quiz

9th - 12th Grade

20 Qs

Aplikom

Aplikom

1st Grade - University

20 Qs

PPG 25 Feb 2022

PPG 25 Feb 2022

12th Grade

19 Qs

Topologías de red!

Topologías de red!

12th Grade

14 Qs

Administrasi Server Jaringan

Administrasi Server Jaringan

12th Grade - University

15 Qs

Higher Order Functiond and Regex

Higher Order Functiond and Regex

Assessment

Quiz

Computers

12th Grade

Practice Problem

Hard

Created by

Dhana Lakshmi

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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]

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?