LearnPy Hub
← Decorators problems
Medium

Repeat Decorator

Write a decorator factory repeat(n) that runs the function n times. Read n and a word; decorate say(word) (prints the word) with @repeat(n) at runtime and call it.

Input

n, then a word.

Output

n lines.

Sample 1

Input
3
hi
Output
hi
hi
hi

Sample 2

Input
1
once
Output
once
solution.py
Output appears here
Repeat Decorator · Python practice problem · LearnPy Hub