CompTIA Linux+ XK0-006 (V8) Practice Question

A Linux administrator is reviewing a colleague's new Python backup script and notices the import section shown below, placed immediately above the main() function.

import sys, os
import requests, json
from backup.utils import logger

According to PEP 8 best practices, which revision would make this import block compliant with the style guide while preserving its functionality?

  • Move all import statements below the main() function and append # noqa to silence style warnings.

  • import json, logger, os, requests, sys
    
  • import json
    import os
    import sys
    
    import requests
    
    from backup.utils import logger
    
  • from backup.utils import *
    from requests import *
    import sys, os
    
CompTIA Linux+ XK0-006 (V8)
Automation, Orchestration, and Scripting
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot