LearnPy Hub
← Context Managers problems
Medium

Indentation Manager

Write a context manager Indent that increases an indentation level on entry and decreases it on exit, with a method say(text) printing the text indented by 2 spaces per level. Read n and nest n levels, saying level K at each.

Input

One integer n ≥ 1.

Output

n lines.

Sample 1

Input
3
Output
  level 1
    level 2
      level 3

Sample 2

Input
1
Output
  level 1
solution.py
Output appears here
Indentation Manager · Python practice problem · LearnPy Hub