LearnPy Hub
← Context Managers problems
Easy

Underlined Heading

Write a @contextmanager heading(title) that prints the title, then a line of = of the same length, then yields. Read a title and a line of text and print the text inside the block.

Input

Two lines.

Output

Three lines.

Sample 1

Input
Notes
Buy milk
Output
Notes
=====
Buy milk

Sample 2

Input
Python
is fun
Output
Python
======
is fun
solution.py
Output appears here
Underlined Heading · Python practice problem · LearnPy Hub