Python - Context Managers
You want to copy contents from
source.txt to dest.txt safely, ensuring both files close properly even if an error occurs. Which code correctly uses a single with statement to handle both files?