True / falseExercise 3/6Basic10 XP

The with block

Task

True or false: a file opened in a with block is closed automatically when the block ends.

with open("data.txt", "w") as f:
f.write("ahoj")
print("hotovo")

You need to know

Your answer

Your answer

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.