
Декоратор
Authored by Igor Perekalskiy
Science
5th Grade
Used 1+ 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
Декоратор в Python что это
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
каков результат выполнения программы
def decorator_with_args(name):
print('> decorator_with_args:', name)
def real_decorator(func):
print('>> сам декоратор', func.__name__)
def decorated(*args, **kwargs):
print('>>> перед функцие', func.__name__)
ret = func(*args, **kwargs)
print('>>> после функции', func.__name__)
return ret
return decorated
return real_decorator
@decorator_with_args('test')
def add(a, b):
print('>>>> функция add')
return a + b
print('старт программы')
r = add(10, 10)
print(r)
print('конец программы')
> decorator_with_args: test
>> сам декоратор add
старт программы
>>> перед функцие add
>>>> функция add
>>> после функции add
20
конец программы
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Каков результат выполнения программы
from functools import wraps
def decorator(func):
'''Декоратор'''
@wraps(func)
def decorated():
'''Функция Decorated'''
func()
return decorated
@decorator
def wrapped():
'''Оборачиваемая функция'''
print('функция wrapped')
print('старт программы...')
print(wrapped.__name__)
print(wrapped.__doc__)
print('конец программы')
старт программы...
wrapped
Оборачиваемая функция
конец программы
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Какой код используется для обработки исключений Python
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Найдите ошибку в коде
try:
k = 1 / 0
except ZeroDivisionError:
k = 0
print(k)
Нет ошибок
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
SAINS TAHUN 5- MANUSIA
Quiz
•
5th Grade
10 questions
SWYK LGC- Chemical Formulas & Equations
Quiz
•
5th - 6th Grade
10 questions
Earth Science Benchmark Review 2
Quiz
•
5th Grade
10 questions
Energy Transformations
Quiz
•
5th - 6th Grade
10 questions
ஆண்டு 5 அறிவியல் புதிர் 1
Quiz
•
5th Grade
10 questions
Excel
Quiz
•
4th - 6th Grade
10 questions
5. SINIF FEN BİLİMLERİ 7. ÜNİTE
Quiz
•
5th Grade
10 questions
interactions between organism
Quiz
•
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