LearnPy Hub
← Context Managers problems
Easy

with open()

Write the input line to msg.txt using with, then print whether the file object is closed after the block and the file's contents.

Input

One line.

Output

Two lines.

Sample 1

Input
hello
Output
True
hello

Sample 2

Input
Python
Output
True
Python
solution.py
Output appears here
with open() · Python practice problem · LearnPy Hub