WGU D522 PYTHON FOR IT AUTOMATION PRACTICAL
TESTED QUESTIONS AND COMPLETE SOLUTIONS
Question 1.
bitwise OR |
ANSWER
lowest precendence
Question 2.
dir ()
ANSWER
lists the names in the current scope or attributes of an object
Question 3.
Indexing ([])
ANSWER
accessing individual characters by position. First pos is 0.
Question 4.
map (), filter ()
ANSWER
applies a function to elements or filters elements based on a functions
,Question 5.
debugging steps
ANSWER
understanding the problem
isolating the problem
use debugger
fix error
test solution
Question 6.
lists
ANSWER
denoted by square brackets, are mutable and allow the dynamic storage of ordered elements
Question 7.
first for cloud automation
ANSWER
pip install boto3
Question 8.
function recursion
ANSWER
a process in which a function calls itself as a subroutine. allows function to be repeated several
times.
Question 9.
outside a function
ANSWER
means the code is not part of any specific function block. Variables defined outside functions
generally have a global scope and can be accessed throughout the program
, Question 10.
Print statements
ANSWER
to display the values of variables at certain points in the program. This can help identify
unexpected values or behavior.
Question 11.
list
ANSWER
ordered, mutalble sequence
[]
Question 12.
concatenation (+)
ANSWER
combine two strings
Question 13.
int_num = int(float_num)
ANSWER
converting something to integer, int
same for x = float(y)
x = round(y)
x=abs(y) - absoluite value
Question 14.
clear ()
ANSWER
clears dictionary
TESTED QUESTIONS AND COMPLETE SOLUTIONS
Question 1.
bitwise OR |
ANSWER
lowest precendence
Question 2.
dir ()
ANSWER
lists the names in the current scope or attributes of an object
Question 3.
Indexing ([])
ANSWER
accessing individual characters by position. First pos is 0.
Question 4.
map (), filter ()
ANSWER
applies a function to elements or filters elements based on a functions
,Question 5.
debugging steps
ANSWER
understanding the problem
isolating the problem
use debugger
fix error
test solution
Question 6.
lists
ANSWER
denoted by square brackets, are mutable and allow the dynamic storage of ordered elements
Question 7.
first for cloud automation
ANSWER
pip install boto3
Question 8.
function recursion
ANSWER
a process in which a function calls itself as a subroutine. allows function to be repeated several
times.
Question 9.
outside a function
ANSWER
means the code is not part of any specific function block. Variables defined outside functions
generally have a global scope and can be accessed throughout the program
, Question 10.
Print statements
ANSWER
to display the values of variables at certain points in the program. This can help identify
unexpected values or behavior.
Question 11.
list
ANSWER
ordered, mutalble sequence
[]
Question 12.
concatenation (+)
ANSWER
combine two strings
Question 13.
int_num = int(float_num)
ANSWER
converting something to integer, int
same for x = float(y)
x = round(y)
x=abs(y) - absoluite value
Question 14.
clear ()
ANSWER
clears dictionary