D522 Python for IT Automation - Set 2 - Part 1

Test your knowledge of technical writing concepts with these practice questions. Each question includes detailed explanations to help you understand the correct answers.

Question 1: Which function opens a file in Python?

Question 2: Which mode opens a file for reading only?

Question 3: Which mode opens a file for writing, overwriting existing content?

Question 4: Which mode opens a file for appending data to the end?

Question 5: What is the recommended way to open a file so it closes automatically?

Question 6: Which method reads the entire contents of a file as a single string?

Question 7: Which method reads one line from a file?

Question 8: Which method writes a string to a file?

Question 9: Which module provides functions to interact with the operating system?

Question 10: Which os function lists the contents of a directory?

Question 11: Which os function creates a new directory?

Question 12: Which os function checks whether a path exists?

Question 13: Which os function removes (deletes) a file?

Question 14: Which module is used to copy and move files at a high level?

Question 15: Which shutil function copies a file?

Question 16: Which module provides access to command-line arguments?

Question 17: What does sys.argv[0] contain?

Question 18: Which module is designed for user-friendly command-line argument parsing?

Question 19: Which module lets Python run external system commands?

Question 20: Which subprocess function runs a command and waits for it to complete?


Complete the Captcha to view next question set.


Quick View

Need Guaranteed Results?

Our exam support service guarantees you'll pass your OA on the first attempt. Pay only after you pass!

Get Exam Support