Анонимная функция
Quiz
•
Computers
•
9th - 12th Grade
•
Hard
whitemoontears whitemoontears
FREE Resource
Enhance your content
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Что делает функция map() в Python?
Применяет функцию к каждому элементу последовательности
Фильтрует элементы, оставляя только подходящие
Сворачивает последовательность в одно значение
Выполняет итерацию по списку без изменений
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Какой результат вернёт следующий код?
list(map(lambda x: x * 2, [1, 2, 3]))
[1, 2, 3]
[2, 4, 6]
[0, 2, 6]
Ошибка
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Что делает функция filter()?
Заменяет все элементы списка на заданное значение
Изменяет элементы списка по заданному алгоритму
Применяет функцию ко всем элементам списка
Оставляет только те элементы, которые удовлетворяют условию
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Какой результат вернёт следующий код?
list(filter(lambda x: x > 2, [1, 2, 3, 4]))
[1, 2, 3, 4]
[3, 4]
[1, 2]
Ошибка
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Какой из вариантов эквивалентен map(str.upper, words)?
[w.upper() for w in words]
[w.lower() for w in words]
[w.capitalize() for w in words]
filter(str.upper, words)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Что делает lambda-функция?
Определяет новую переменную
Создаёт анонимную (безымянную) функцию
Создаёт бесконечный цикл
Выполняет математические операции
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Какой из вариантов правильно создаёт lambda-функцию, которая удваивает число?
def f(x): return x * 2
lambda x: x * 2
reduce(lambda x, y: x + y, [1, 2, 3])
lambda = x*2, x
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
15 questions
Spreadsheets L4
Quiz
•
9th Grade
10 questions
Format and filter cell
Quiz
•
10th Grade
15 questions
SQL JOIN, Order By, Group By
Quiz
•
12th Grade
15 questions
ბონუს ქვიზი
Quiz
•
9th - 12th Grade
14 questions
Викторина по работе с файлами и функциями в Python
Quiz
•
11th Grade
10 questions
Analisis Data (1)
Quiz
•
10th Grade
13 questions
Создание программ на ЯП Python
Quiz
•
9th - 12th Grade
15 questions
SOAL PTS DESAIN GRAFIS SMK SEM GENAP 2024
Quiz
•
10th 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