• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 23 pages
Exam (elaborations)

Wgu D522 V2 Python For It Automation Final Exam Study Guide

Document preview thumbnail
Preview 3 out of 23 pages

WGU D522 V2 PYTHON FOR IT AUTOMATION FINAL EXAM STUDY GUIDE

Content preview

WGU D522 V2 PYTHON FOR IT
AUTOMATION FINAL EXAM STUDY
GUIDE




1. Which method is used in the ‘os’ module to change the current working directory of the

script?

A. os.path.move()


B. os.getcwd()


C. os.setdir()


D. os.chdir()


Answer: D


Conceptual Explanation: The os.chdir() function is used to change the current working

directory to a specified path.


2. When using the ‘csv’ module, which class allows you to map the information in each row to

a dictionary?

A. csv.Reader


B. csv.RowDict

,C. csv.DataMap


D. csv.DictReader


Answer: D


Conceptual Explanation: csv.DictReader creates an object that operates like a regular

reader but maps the information in each row to a dict whose keys are given by the optional

fieldnames parameter.


3. In regular expressions, which metacharacter matches the start of a string?

A. $


B. ^


C. *


D. .


Answer: B


Conceptual Explanation: The caret (^) symbol is used in regex to match the beginning of a

line or string.


4. What is the result of the expression: ‘Hello World’.split()?

A. (‘Hello’, ‘World’)


B. [‘Hello’, ‘World’]


C. ‘Hello’, ‘World’

, D. [‘H’, ‘e’, ‘l’, ‘l’, ‘o’, ’ ‘, ’W’, ‘o’, ‘r’, ‘l’, ‘d’]


Answer: B


Conceptual Explanation: The split() method without arguments splits a string into a list of

words using whitespace as the delimiter.


5. Which subprocess function is recommended for running a command and waiting for it to

finish while capturing the output?

A. subprocess.popen()


B. subprocess.call()


C. subprocess.execute()


D. subprocess.run()


Answer: D


Conceptual Explanation: subprocess.run() is the recommended approach for invoking

subprocesses in Python 3.5+.


6. How do you access the first command-line argument passed to a script (excluding the script

name)?

A. sys.argv[0]


B. sys.args[1]


C. sys.argv[1]


D. os.argv[1]

Document information

Uploaded on
August 31, 2026
Number of pages
23
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$15.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Thebright
3.6
(46)
Sold
256
Followers
6
Items
15914
Last sold
5 days ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions