A developer has activated a Python virtual environment in /opt/tools/venv and runs deactivate. What is the result?
Show the answer
Correct answerD. The shell's earlier PATH and prompt return, and /opt/tools/venv stays on disk
AWhy not this: deactivate does not delete anything; removing an environment means deleting its directory.
BWhy not this: deactivate leaves installed packages in place, so the environment can be activated again later.
CWhy not this: activate is sourced into the current shell rather than starting a subshell, so deactivate does not exit it.
DWhy this is right: Deactivate restores PATH and the prompt and leaves the environment's files intact.
The deactivate function reverts the shell's PATH and prompt to their earlier state and leaves the environment's files intact, so it can be activated again later. Removing the environment requires deleting its directory.