Asked by GIANSH GUPTA KHUNDKER · BIRLA BRAINIACS
Answer: B. subprocess module with shell=False and arguments passed as a list.
Answer: B) subprocess module with shell=False and arguments passed as a list.
Explanation: The subprocess module is the modern standard for executing external processes. By setting shell=False and passing commands as an explicit list (e.g., ["ping", "-c", "1", ip]), Python interacts directly with the operating system API. This ensures user input is strictly treated as a literal argument, never as executable code.
Answering after opening this box earns no Practice Points.