PYTHON IT
AUTOMATION WGU
D522 EXAMS
QUESTIONS AND
CORRECT ANSWERS
,CORE CONCEPTS FOR PYTHON IT AUTOMATION WGU D522
EXAMS QUESTIONS AND CORRECT ANSWERS
.\env\Scripts\activate - Answer-A command to activate a virtual environment on Windows.
// operator in Python - Answer-The // operator is the floor division operator.
== operator - Answer-The == operator checks for equality of value between two objects.
Accessing a missing key - Answer-Will raise a KeyError if you try to access a dictionary key that
doesn't exist.
Accessing Dictionary Values - Answer-Values in a dictionary can be accessed by their
associated keys, e.g., student['name'].
Accessing List Elements - Answer-Elements can be accessed by index (zero-based).
Accessing Tuple Elements - Answer-Accessing elements of a tuple is done in the same way as
with lists, using indexing.
add function - Answer-Defines a function that takes two parameters and returns their sum.
Adding/Updating Dictionary Entries - Answer-You can add or update entries in a dictionary
using the syntax student['key'] = value.
Anticipating exceptions - Answer-The practice of preparing to handle exceptions while the
program is running.
append mode - Answer-The mode 'a' used with open() to add content to the end of a file without
erasing existing content.
, arguments - Answer-The actual values provided to the parameters when calling the function.
Arithmetic operators in Python - Answer-Include + (addition), - (subtraction), * (multiplication), /
(division), // (floor division), % (modulus), and ** (exponentiation).
auto-completion - Answer-A feature in IDEs that automatically suggests completions for partially
typed code.
Automation task pattern - Answer-A typical automation task pattern involves iterating through
files and performing read/modify/write operations.
Automation tasks - Answer-Tasks that can be performed automatically through programming.
automation tools - Answer-Software applications that help automate tasks and processes in IT
environments.
Basic data types in Python - Answer-Important built-in data types include Integer (int), Floating-
point (float), String (str), Boolean (bool), and NoneType.
Benefits of frequent coding - Answer-Frequent coding practice helps students become familiar
with common pitfalls and improves reliability in automation roles.
binary mode - Answer-A mode for opening files that treats the file as a binary stream, reading
and writing bytes.
black - Answer-A code formatter that also functions as a linter, ensuring code style consistency.
Blocking calls - Answer-Calls in code that cause the program to wait for an external resource or
input before proceeding.
Boolean in Python - Answer-Truth values True or False.