
CompTIALinux+
Domain 4Objective 3
Python Basics XK0-006 Practice Questions (Page 3)
Part of the Automation, Orchestration, and Scripting domain, which accounts for 17% of the XK0-006 exam. CompTIA does not publish an official question count, but from its 90-minute exam (~35–60 total, ~6–10 in this domain), expect 1–2 from this objective — we provide 19 practice questions to prepare you well beyond it. (estimate)
19questions here
4free pages
7concepts
17%of the exam
Questions 11–15
- 11
A script needs to store the MAC addresses of all devices on a network. The script must ensure that each MAC address is stored only once, and later it must quickly check if a given MAC address is present. Which data structure is most appropriate?
Select an answer first - 12
Which of the following is a valid Python boolean value?
Select an answer first - 13
Which Python keyword is used to define a function?
Select an answer first - 14
A developer is working on a Python project that requires a specific version of the `flask` package. The developer wants to ensure that other projects on the same system are not affected by version changes. Which command sequence should be used?
Select an answer first - 15
A Python script reads a configuration value from a file. The value is read as a string, but the script needs to perform arithmetic on it. The script currently does: `value = open('config.txt').read().strip()` and then `result = value * 2`. The output is `'1010'` instead of `20`. What is the most likely cause?
Select an answer first
Finished these 5 questions?
Review the revealed explanations, or continue through the curriculum.
Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by CompTIA. “XK0-006” is a trademark of its owner, used for identification only.