100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

WGU D522 Python for IT Automation OBJECTIVE ASSESSMENT PRACTICE EXAM QUESTIONS WITH CORRECT DETAILED ANSWERS | ALREADY GRADED A+<RECENT VERSION>

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
31-10-2025
Written in
2025/2026

WGU D522 Python for IT Automation OBJECTIVE ASSESSMENT PRACTICE EXAM QUESTIONS WITH CORRECT DETAILED ANSWERS | ALREADY GRADED A+&lt;RECENT VERSION&gt; 1) How can multiple Python variables of different types be output using the print() function? - ANSWER By separating each variable with a comma 2) What is the scope of a variable that is defined inside a function in Python? - ANSWER Local Scope 3) How can a global variable be created inside a function in Python? - ANSWER By declaring the variable with the 'global' keyword 4) What is a characteristic of Python as a dynamically-typed language? - ANSWER The interpreter determines the type of variable during runtime 5) Which Python data type represents an ordered, mutable sequence? - ANSWER 'list' 6) What are the 3 sequence types in Python? what do they represent/look like? - ANSWER list: Ordered, mutable sequence; [1,23] tuple: Ordered, immutable sequence; (1,2,3) range: represents a range of values; e.g. range(5) 7) What are the characteristics of a set? - ANSWER Unordered, mutable collection of unique elements. {1,2,3} 8) what is a dictionary mapping type? - ANSWER an unordered collection of key-value pairs. my_dict = {'key':'value', 'name':'John'} 9) What happens when an operation is performed that involves both an int and a float in Python? - ANSWER the result is automatically promoted to a 'float' 10) What does the 'round(x, n) function do in Python? - ANSWER it rounds 'x' to 'n' decimal places 11) What are the two main escape characters? - ANSWER n : new line t : for a tab 12) What are the 3 components of a string slice? - ANSWER string [start:stop:step] · Start: the index from which the slicing begins (inclusive) · Stop: the index at which the slicing ends (exclusive) · Step (optional): The step or stride between characters. 13) What does the string slicing operation 'text {::-1] do where text = "Hello, Python!"? - ANSWER It reverses the string. The 'step' portion of the slice is negative, indicating the stride between characters is reversed. 14) What does the 'strip()' method do in Python? - ANSWER It removes leading and trailing whitespaces from a string 15) what does the += operator do in Python string manipulation? - ANSWER It is used as a shorthand for concatenation and assignment 16) What are truthy and falsy values in Python? - ANSWER Truthy values are non-zero numbers and non-empty strings. Falsy values are zero, None, and empty strings 17) What is the purpose of the // operator in Python? - ANSWER It performs floor division operation; performs division and rounds down to the nearest whole number and discards the decimal part 18) What does the pop() method do? - ANSWER It removes an item at the specified index position. example: devices = ['router1', 'switch2', 'firewall3'] removed_ device = devices. pop(1) 19) This removes 'switch2' from devices since it is in index 1 position, and now it added to "removed _device. 20) What is a 'shallow copy' of a list in Python? - ANSWER A copy of the list where changes to the copied list do not affect the original list. 21) What is the difference between using the '+' operator and the 'extend()' method to concatenate lists in Python? - ANSWER The '+' operator creates a new list, while the 'extend()' method adds elements to the end of the original list. 22) What is a significant advantage of using tuples in Python for storing information about network devices? - ANSWER tuples can be used as keys in dictionaries due to their immutability. 23) How are items in a tuple accessed? - ANSWER By placing the index of the item inside square brackets [] after the tuple name 24) What is the purpose of the input() function in Python? - ANSWER To capture user input and store it as a string 25) What does the format() method do in Python? - ANSWER It enhances output formatting by embedding variables in strings. (although 'f' strings are easier to read) 26) What is the purpose of the Code Editor in a Python IDE? - ANSWER To provide a text editor designed for Python, offering features like syntax highlighting, code completion, and indentation. 27) What does this built in Python function do?: print() - ANSWER outputs text or variables to the console 28) What does this built in Python function do?: input() - ANSWER reads user input from the console 29) What does this built in Python function do?: len() - ANSWER determines the length of a sequence (string, list, tuple) 30) What does this built in Python function do?: type() - ANSWER returns the type of an object 31) What does this built in Python function do?: int(), float(), str() - ANSWER converts values to integers, floats, or strings; respectively 32) What does this built in Python function do?: max(), min() - ANSWER returns the maximum or minimum value from a sequence 33) What does this built in Python function do?: sum() - ANSWER calculates the sum of elements in a sequence 34) What does this built in Python function do?: abs() - ANSWER returns the absolute value of a number 35) What does this built in Python function do?: range() - ANSWER generates a sequence of numbers 36) What does this built in Python function do?: sorted() - ANSWER returns a sorted list from an iterable 37) What does this built in Python function do?: any(), all() - ANSWER checks if any or all elements in an iterable are true 38) What does this built in Python function do?: map(), filter() - ANSWER applies a function to elements or filters elements based on a function 39) What does this built in Python function do?: open(), read(), write() - ANSWER handles file I/O operations 40) What does this built in Python function do?: dir() - ANSWER lists the names in the current scope or attributes of an object 41) What does this built in Python function do?: help() - ANSWER provides help information about an object or Python 42) What is the primary characteristic of Python variables? - ANSWER Variables are created as soon as a value is assigned to them. 43) What are the 5 Variable name rules in Python? - ANSWER 1. can only contain letters, numbers, or an underscore. 2. MUST start with either a letter or underscore 3. Cannot start with a number 4. Cannot contain special characters. 5. Cannot be a Python keyword (such as: and, as, def, else, etc) 44) What are the traits of Imperative/procedural programming? - ANSWER Focuses on describing a sequence of steps to perform a task 45) What are the traits of Object-Oriented Programming (OOP)? - ANSWER Organize code around objects, which encapsulate data and behavior. 46) What are the traits of Functional Programming? - ANSWER emphasizes the use of functions and immutable data for computation. 47) What are the traits of Declarative Programming? - ANSWER describes what the program should accomplish without specifying how to achieve it. 48) What are the traits of Event-Driven Programming? - ANSWER Reacts to events and user actions, triggering corresponding functions. 49) What are the traits of Logic Programming? - ANSWER defines a set of logical conditions and lets the system deduce solutions. 50) What does Python syntax refer to? - ANSWER The set of rules that dictate the combinations of symbols and keywords that form valid Python programs 51) What is the purpose of indentation in Python? - ANSWER To define blocks of code 52) Why might a programmer use comments for 'Preventing Execution'? - ANSWER To temporarily disable lines or blocks of code 53) What is the primary use of whitespace in Python? - ANSWER To define the structure and hierarchy of the code 54) What does Python use to define the scope of control flow statements and structures like functions and classes? - ANSWER Indentation 55) What happens if the number of variables is not equal to the number of values in a Python assignment statement? - ANSWER An error will occur 56) What does unpacking involve in Python? - ANSWER Extracting elements from iterable objects and assigning them to individual variables 57) What is the result of using the '+' operator to output multiple Python variables of different types? - ANSWER A Python error occurs. (must use variables of the same type)

Show more Read less
Institution
WGU D522 Python For IT Automation
Course
WGU D522 Python for IT Automation









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
WGU D522 Python for IT Automation
Course
WGU D522 Python for IT Automation

Document information

Uploaded on
October 31, 2025
Number of pages
7
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

WGU D522 Python for It AUtomAtIon
oBJECtIVE ASSESSmEnt
PrACtICE EXAm QUEStIonS WIth
CorrECt DEtAILED AnSWErS |
ALrEADy GrADED A+<rECEnt
VErSIon>


1) How can multiple Python variables of different types be output using the print()
function? - ANSWER By separating each variable with a comma


2) What is the scope of a variable that is defined inside a function in Python? -
ANSWER Local Scope



3) How can a global variable be created inside a function in Python? - ANSWER By
declaring the variable with the 'global' keyword


4) What is a characteristic of Python as a dynamically-typed language? - ANSWER
The interpreter determines the type of variable during runtime


5) Which Python data type represents an ordered, mutable sequence? - ANSWER
'list'


6) What are the 3 sequence types in Python? what do they represent/look like? -
ANSWER list: Ordered, mutable sequence; [1,23]
tuple: Ordered, immutable sequence; (1,2,3)
range: represents a range of values; e.g. range(5)

, 7) What are the characteristics of a set? - ANSWER Unordered, mutable collection of
unique elements. {1,2,3}


8) what is a dictionary mapping type? - ANSWER an unordered collection of key-
value pairs.


my_dict = {'key':'value', 'name':'John'}


9) What happens when an operation is performed that involves both an int and a float in
Python? - ANSWER the result is automatically promoted to a 'float'



10) What does the 'round(x, n) function do in Python? - ANSWER it rounds 'x' to 'n'
decimal places


11) What are the two main escape characters? - ANSWER \n : new line
\t : for a tab


12) What are the 3 components of a string slice? - ANSWER string [start:stop:step]


· Start: the index from which the slicing begins (inclusive)
· Stop: the index at which the slicing ends (exclusive)
· Step (optional): The step or stride between characters.


13) What does the string slicing operation 'text {::-1] do where text = "Hello, Python!"? -
ANSWER It reverses the string.


The 'step' portion of the slice is negative, indicating the stride between characters is
reversed.


14) What does the 'strip()' method do in Python? - ANSWER It removes leading and
trailing whitespaces from a string
$12.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
jervismuthami
4.0
(1)

Get to know the seller

Seller avatar
jervismuthami Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
7
Member since
6 months
Number of followers
0
Documents
560
Last sold
1 week ago

4.0

1 reviews

5
0
4
1
3
0
2
0
1
0

Recently viewed by you

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

Frequently asked questions