LearnPy Hub
← Context Managers problems
Easy

@contextmanager Hello

Use @contextmanager to write greeting() that prints start, yields, then prints end. Inside the block print the input line.

Input

One line.

Output

Three lines.

Sample 1

Input
middle
Output
start
middle
end

Sample 2

Input
Python
Output
start
Python
end
solution.py
Output appears here
@contextmanager Hello · Python practice problem · LearnPy Hub