Google IT Automation Python System Administration Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Questions: 20 | Updated: Aug 15, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. What does the glob module allow you to do in Python automation?

Explanation

Python’s `glob` module searches directories for file and folder names that match pathname patterns, such as `*.txt` for all text files or `data_??.csv` for matching names. This makes it useful in automation scripts that need to locate groups of files without listing each filename individually.

Submit
Please wait...
About This Quiz
Google IT Automation Python System Administration Quiz - Quiz

This quiz assesses your understanding of Python automation in IT system administration. It covers core concepts including file handling, process management, configuration automation, and scripting best practices. Ideal for college-level learners preparing for IT automation roles or Google IT Automation certification.

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. In Python system automation, what does the term 'dry run' refer to?

Explanation

A dry run simulates an automation script’s actions without applying changes to the system. It helps verify the planned operations and identify potential issues safely before executing the script for real.

Submit

3. What is the primary benefit of using Python virtual environments in automation projects?

Explanation

Virtual environments create a separate space for each project’s Python packages. This prevents version differences or dependencies in one automation project from interfering with other projects or the system-wide Python installation.

Submit

4. Which Python module enables you to interact with APIs for cloud infrastructure automation?

Explanation

Python’s `requests`, `urllib`, and `http.client` modules can all send HTTP requests and receive responses, enabling communication with cloud infrastructure APIs. `requests` offers a convenient high-level interface, while `urllib` and `http.client` provide standard-library alternatives with varying levels of control. Any can support automation when configured for the API’s authentication and data formats.

Submit

5. What is idempotency in the context of system automation?

Explanation

Idempotency means an operation can be repeated without changing the outcome after the first successful run. In system automation, this ensures that running a task multiple times produces the same desired system state, helping make workflows reliable and safe to retry.

Submit

6. Which Python module would you use to parse command-line arguments in your automation scripts?

Explanation

Python’s `argparse` and `getopt` modules both help scripts process command-line options and arguments. `argparse` is the modern, higher-level choice, providing automatic help messages, type conversion, and validation, while `getopt` offers a simpler interface modeled on Unix-style option parsing. `sys.argv` only exposes the raw argument list and does not parse or validate it automatically.

Submit

7. What does the logging module help you accomplish in system automation scripts?

Explanation

The logging module records events as a script runs and captures errors or warnings. These logs help you monitor execution, understand what happened, and diagnose problems during debugging.

Submit

8. In Python, which approach is preferred for running external commands with complex arguments?

Explanation

For commands with complex arguments, `subprocess.run()` accepts each command component as a separate list item. This avoids manual shell quoting and reduces injection risks when values come from external input. It also provides access to the exit status, output, and errors, making execution more reliable and easier to manage than shell-based calls.

Submit

9. What is the purpose of the pathlib module in modern Python automation?

Explanation

The `pathlib` module provides an object-oriented way to work with filesystem paths. Its `Path` objects make common tasks—such as joining paths, checking whether files exist, and reading or writing files—clearer and more portable across operating systems.

Submit

10. Which Python module is best for managing environment variables and system paths?

Explanation

`os.environ` provides a dictionary-like interface to the current process’s environment variables. You can use it to read or set variables such as `PATH`, which contains system path locations. This makes it the best option among the choices for managing environment variables and access to the system path configuration.

Submit

11. Which Python module is used to interact with the operating system and execute system commands?

Explanation

Python’s `os` module provides functions for interacting with the operating system, such as accessing files and directories, reading environment variables, and running shell commands with `os.system()`. It serves as a general interface between Python programs and the operating system.

Submit

12. Which method is used to read all lines from a file into a list in Python?

Explanation

`readlines()` reads the file’s contents line by line and returns all lines as a list of strings. Each list item typically includes its line-ending character, such as `\n`, if present.

Submit

13. What is the advantage of using context managers (with statement) for file handling?

Explanation

Context managers handle file cleanup automatically, closing the file even if an exception occurs. This helps prevent resource leaks and makes file-handling code clearer by avoiding explicit cleanup logic.

Submit

14. In Python, how do you handle exceptions that may occur during file operations?

Explanation

Try-except blocks let you catch and respond to errors such as missing files or permission problems. Context managers, using the `with` statement, manage file resources safely by ensuring files are closed even if an exception occurs. Both are useful for handling exceptions during file operations.

Submit

15. Which Python module enables you to schedule tasks at specific times or intervals?

Explanation

The `schedule` module provides a simple way to run functions at specified times or recurring intervals, such as every hour or every day. You define a job and its schedule, then have your program check for and execute jobs that are due.

Submit

16. What is the primary purpose of using regular expressions in system automation?

Explanation

Regular expressions provide a concise way to describe text patterns, such as dates, error codes, or email addresses. In system automation, scripts can use these patterns to check whether text follows an expected format and to find or extract relevant information from log files and other text, supporting tasks like monitoring and troubleshooting.

Submit

17. Which module would you use to parse and manipulate JSON configuration files?

Explanation

Python’s `json` module is designed to read and write JSON data. Use `json.load()` or `json.loads()` to parse JSON into Python objects, such as dictionaries and lists, then manipulate those objects. Use `json.dump()` or `json.dumps()` to serialize the modified data back into JSON.

Submit

18. In Python, what is the purpose of the shutil module?

Explanation

The `shutil` module provides high-level utilities for working with files and directories. It can copy, move, rename, and remove files or directory trees, making common file-management tasks easier than using lower-level operations alone.

Submit

19. Which function from the os module is used to list files in a directory?

Explanation

`os.listdir()` returns the names in a directory, `os.scandir()` provides directory entries with file information, and `os.walk()` traverses a directory tree and yields its files and subdirectories. Each can be used to list files, so all of the above apply.

Submit

20. What does the subprocess module's run() method return?

Explanation

`subprocess.run()` returns a `CompletedProcess` object representing the finished command. It includes information such as the command arguments and exit status; captured standard output and standard error are also available when requested, for example by setting `capture_output=True`. It does not return the output string or exit code alone by default.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What does the glob module allow you to do in Python automation?
In Python system automation, what does the term 'dry run' refer to?
What is the primary benefit of using Python virtual environments in...
Which Python module enables you to interact with APIs for cloud...
What is idempotency in the context of system automation?
Which Python module would you use to parse command-line arguments in...
What does the logging module help you accomplish in system automation...
In Python, which approach is preferred for running external commands...
What is the purpose of the pathlib module in modern Python automation?
Which Python module is best for managing environment variables and...
Which Python module is used to interact with the operating system and...
Which method is used to read all lines from a file into a list in...
What is the advantage of using context managers (with statement) for...
In Python, how do you handle exceptions that may occur during file...
Which Python module enables you to schedule tasks at specific times or...
What is the primary purpose of using regular expressions in system...
Which module would you use to parse and manipulate JSON configuration...
In Python, what is the purpose of the shutil module?
Which function from the os module is used to list files in a...
What does the subprocess module's run() method return?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!