Challenge 1
Complete the context-manager alias for the directory iterator.
import os
from pathlib import Path
from tempfile import TemporaryDirectory
with TemporaryDirectory() as temporary:
root = Path(temporary)
(root / "item.txt").touch()
with os.scandir(root) as :
names = sorted(entry.name for entry in entries)
print(names)
Press Ctrl⌘Enter to check your answer