LearnPy Hub
← Context Managers problems
Medium

Capture Printed Output

Use contextlib.redirect_stdout with an io.StringIO to capture the output of printing each input word. Then print the captured text in upper case, words joined by spaces.

Input

One line of words.

Output

One line.

Sample 1

Input
hello world
Output
HELLO WORLD

Sample 2

Input
x
Output
X
solution.py
Output appears here
Capture Printed Output · Python practice problem · LearnPy Hub