
Генераторы2
Authored by Igor Perekalskiy
Science
5th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Генераторы
работают только один раз. Можно ли изменить данное поведение у генераторов?
Чтобы создать объект, допускающий повторные итерации, стоит определить его как класс и
сделать метод iter() генератором
Чтобы создать объект, допускающий повторные итерации, стоит определить его как класс и
сделать метод next() генератором
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Неотъемлемое свойство генераторов в том, что функция с yield
никогда не выполняется
сама по себе. Ею всегда должен управлять другой код с циклом for или явными вызовами
функции next()
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Что позволяет команда yield from
помогает избавится от необходимости управлять перебором вручную.
переход к следующей иттерации.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Итератор (iterator) - это объект, который возвращает свои элементы?
по одному за раз
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Что выдаст код?
a = 'hello'
iterator = iter(a)
print(next(iterator))
print(next(iterator))
print(next(iterator))
print(next(iterator))
print(next(iterator))
print(next(iterator))
Когда мы перебрали весь объект, то на следующей итерации мы видим исключение
StopIteration.
h
e
l
l
o
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
Easy science quiz
Quiz
•
1st - 12th Grade
10 questions
Motion Graphs Review
Quiz
•
5th Grade
10 questions
ESS.5.1.2 (5.E.1.2) #1 Schoolnet
Quiz
•
5th Grade
9 questions
MinecraftPython Test 1
Quiz
•
5th - 6th Grade
10 questions
5.L.2.3 #2: Schoolnet
Quiz
•
5th Grade
10 questions
Science Safety Review
Quiz
•
4th - 5th Grade
10 questions
Fossils 5.7D
Quiz
•
5th Grade
10 questions
Matter Matters!
Quiz
•
4th - 5th 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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th 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
Discover more resources for Science
20 questions
The Water Cycle
Quiz
•
5th Grade
20 questions
Weathering, Erosion, Deposition
Quiz
•
5th Grade
28 questions
4th Grade The Need for Speed
Quiz
•
3rd - 5th Grade
20 questions
Food Chains and Food Webs Review
Quiz
•
5th Grade
20 questions
The Water Cycle
Quiz
•
4th - 5th Grade
21 questions
Solar System Review
Quiz
•
5th Grade
20 questions
Food Webs
Quiz
•
5th Grade
20 questions
Earth Processes and Landforms
Quiz
•
5th Grade