Python for IT Automation (WGU D522)
questions with complete solution
What are the traits of Imperative/procedural programming? - answer-Focuses on
f f f f f f f f f
describing a sequence of steps to perform a task
f f f f f f f f f
What are the traits of Object-Oriented Programming (OOP)? - answer-Organize code
f f f f f f f f f f
around objects, which encapsulate data and behavior.
f f f f f f f
What are the traits of Functional Programming? - answer-emphasizes the use of functions
f f f f f f f f f f f f
and immutable data for computation.
f f f f f
What are the traits of Declarative Programming? - answer-describes what the program
f f f f f f f f f f f
should accomplish without specifying how to achieve it.
f f f f f f f f
What are the traits of Event-Driven Programming? - answer-Reacts to events and user
f f f f f f f f f f f f
actions, triggering corresponding functions.
f f f f
What are the traits of Logic Programming? - answer-defines a set of logical conditions and
f f f f f f f f f f f f f f
lets the system deduce solutions.
f f f f f
What does Python syntax refer to? - answer-The set of rules that dictate the combinations
f f f f f f f f f f f f f f
of symbols and keywords that form valid Python programs
f f f f f f f f f
What is the purpose of indentation in Python? - answer-To define blocks of code
f f f f f f f f f f f f f
Why might a programmer use comments for 'Preventing Execution'? - answer-To
f f f f f f f f f f
temporarily disable lines or blocks of code
f f f f f f f
What is the primary use of whitespace in Python? - answer-To define the structure and
f f f f f f f f f f f f f f
hierarchy of the code
f f f f
What does Python use to define the scope of control flow statements and structures like
f f f f f f f f f f f f f f
functions and classes? - answer-Indentation
f f f f f
What is the purpose of the input() function in Python? - answer-To capture user input and
f f f f f f f f f f f f f f f
store it as a string
f f f f f
What does the format() method do in Python? - answer-It enhances output formatting by
f f f f f f f f f f f f f
embedding variables in strings. (although 'f' strings are easier to read)
f f f f f f f f f f f
, What is the purpose of the Code Editor in a Python IDE? - answer-To provide a text editor
f f f f f f f f f f f f f f f f f
designed for Python, offering features like syntax highlighting, code completion, and
f f f f f f f f f f f
indentation.
f
What does this built in Python function do?: print() - answer-outputs text or variables to the
f f f f f f f f f f f f f f f
console
f
What does this built in Python function do?: input() - answer-reads user input from the
f f f f f f f f f f f f f f
console
f
What does this built in Python function do?: len() - answer-determines the length of a
f f f f f f f f f f f f f f
sequence (string, list, tuple)
f f f f
What does this built in Python function do?: type() - answer-returns the type of an object
f f f f f f f f f f f f f f f
What does this built in Python function do?: int(), float(), str() - answer-converts values to
f f f f f f f f f f f f f f
integers, floats, or strings; respectively
f f f f f
What does this built in Python function do?: max(), min() - answer-returns the maximum or
f f f f f f f f f f f f f f
minimum value from a sequence
f f f f f
What does this built in Python function do?: sum() - answer-calculates the sum of elements
f f f f f f f f f f f f f f
in a sequence
f f f
What does this built in Python function do?: abs() - answer-returns the absolute value of a
f f f f f f f f f f f f f f f
number
f
What does this built in Python function do?: range() - answer-generates a sequence of
f f f f f f f f f f f f f
numbers
f
What does this built in Python function do?: sorted() - answer-returns a sorted list from an
f f f f f f f f f f f f f f f
iterable
f
What does this built in Python function do?: any(), all() - answer-checks if any or all
f f f f f f f f f f f f f f f
elements in an iterable are true
f f f f f f
What does this built in Python function do?: map(), filter() - answer-applies a function to
f f f f f f f f f f f f f f
elements or filters elements based on a function
f f f f f f f f
What does this built in Python function do?: open(), read(), write() - answer-handles file I/O
f f f f f f f f f f f f f f
operations
f
What does this built in Python function do?: dir() - answer-lists the names in the current
f f f f f f f f f f f f f f f
scope or attributes of an object
f f f f f f
questions with complete solution
What are the traits of Imperative/procedural programming? - answer-Focuses on
f f f f f f f f f
describing a sequence of steps to perform a task
f f f f f f f f f
What are the traits of Object-Oriented Programming (OOP)? - answer-Organize code
f f f f f f f f f f
around objects, which encapsulate data and behavior.
f f f f f f f
What are the traits of Functional Programming? - answer-emphasizes the use of functions
f f f f f f f f f f f f
and immutable data for computation.
f f f f f
What are the traits of Declarative Programming? - answer-describes what the program
f f f f f f f f f f f
should accomplish without specifying how to achieve it.
f f f f f f f f
What are the traits of Event-Driven Programming? - answer-Reacts to events and user
f f f f f f f f f f f f
actions, triggering corresponding functions.
f f f f
What are the traits of Logic Programming? - answer-defines a set of logical conditions and
f f f f f f f f f f f f f f
lets the system deduce solutions.
f f f f f
What does Python syntax refer to? - answer-The set of rules that dictate the combinations
f f f f f f f f f f f f f f
of symbols and keywords that form valid Python programs
f f f f f f f f f
What is the purpose of indentation in Python? - answer-To define blocks of code
f f f f f f f f f f f f f
Why might a programmer use comments for 'Preventing Execution'? - answer-To
f f f f f f f f f f
temporarily disable lines or blocks of code
f f f f f f f
What is the primary use of whitespace in Python? - answer-To define the structure and
f f f f f f f f f f f f f f
hierarchy of the code
f f f f
What does Python use to define the scope of control flow statements and structures like
f f f f f f f f f f f f f f
functions and classes? - answer-Indentation
f f f f f
What is the purpose of the input() function in Python? - answer-To capture user input and
f f f f f f f f f f f f f f f
store it as a string
f f f f f
What does the format() method do in Python? - answer-It enhances output formatting by
f f f f f f f f f f f f f
embedding variables in strings. (although 'f' strings are easier to read)
f f f f f f f f f f f
, What is the purpose of the Code Editor in a Python IDE? - answer-To provide a text editor
f f f f f f f f f f f f f f f f f
designed for Python, offering features like syntax highlighting, code completion, and
f f f f f f f f f f f
indentation.
f
What does this built in Python function do?: print() - answer-outputs text or variables to the
f f f f f f f f f f f f f f f
console
f
What does this built in Python function do?: input() - answer-reads user input from the
f f f f f f f f f f f f f f
console
f
What does this built in Python function do?: len() - answer-determines the length of a
f f f f f f f f f f f f f f
sequence (string, list, tuple)
f f f f
What does this built in Python function do?: type() - answer-returns the type of an object
f f f f f f f f f f f f f f f
What does this built in Python function do?: int(), float(), str() - answer-converts values to
f f f f f f f f f f f f f f
integers, floats, or strings; respectively
f f f f f
What does this built in Python function do?: max(), min() - answer-returns the maximum or
f f f f f f f f f f f f f f
minimum value from a sequence
f f f f f
What does this built in Python function do?: sum() - answer-calculates the sum of elements
f f f f f f f f f f f f f f
in a sequence
f f f
What does this built in Python function do?: abs() - answer-returns the absolute value of a
f f f f f f f f f f f f f f f
number
f
What does this built in Python function do?: range() - answer-generates a sequence of
f f f f f f f f f f f f f
numbers
f
What does this built in Python function do?: sorted() - answer-returns a sorted list from an
f f f f f f f f f f f f f f f
iterable
f
What does this built in Python function do?: any(), all() - answer-checks if any or all
f f f f f f f f f f f f f f f
elements in an iterable are true
f f f f f f
What does this built in Python function do?: map(), filter() - answer-applies a function to
f f f f f f f f f f f f f f
elements or filters elements based on a function
f f f f f f f f
What does this built in Python function do?: open(), read(), write() - answer-handles file I/O
f f f f f f f f f f f f f f
operations
f
What does this built in Python function do?: dir() - answer-lists the names in the current
f f f f f f f f f f f f f f f
scope or attributes of an object
f f f f f f