
Генераторы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
5.E.1.2 #3
Quiz
•
5th Grade
10 questions
Series and Parallel Circuit
Quiz
•
4th - 5th Grade
10 questions
from Earth's Water Cycle
Quiz
•
5th Grade
10 questions
Global Winds
Quiz
•
5th Grade
10 questions
Inferring!
Quiz
•
1st - 6th Grade
10 questions
Engineering Design Process
Quiz
•
2nd - 5th Grade
10 questions
ESS.5.1.1 (5.E.1.1) #3 Schoolnet
Quiz
•
5th Grade
10 questions
Static Electricity Assessment
Quiz
•
5th Grade - University
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
Discover more resources for Science
20 questions
The Water Cycle
Quiz
•
5th Grade
20 questions
Weathering, Erosion, Deposition
Quiz
•
5th Grade
20 questions
Food Chains and Food Webs Review
Quiz
•
5th Grade
21 questions
Solar System Review
Quiz
•
5th Grade
20 questions
Food Webs
Quiz
•
5th Grade
18 questions
Acquired Trait and Inherited Trait
Quiz
•
5th Grade
20 questions
Food Chains & Food Webs
Quiz
•
5th - 7th Grade
19 questions
Mixtures and Solutions
Quiz
•
5th Grade