WGU D522 PYTHON FOR IT AUTOMATION SCRIPTING
GUIDE
UPDATED ACTUAL EXAM QUESTIONS AND CORRECT
ANSWERS
Question 1.
string [start:stop:step]
ANSWER
start is where slicing begins
-if not provided default to beginning of string
stop is where slicing ends
- if not provided default to end of string step or stride between characters
- if not provided default to 1
Question 2.
first for cloud automation
ANSWER
pip install boto3
Question 3.
while loop
ANSWER
used to repeatedly execute a block of code as long as a certain condition is true.
Question 4.
for loop
ANSWER
used to iterate over a sequence
,Question 5.
clear ()
ANSWER
clears dictionary
Question 6.
greeting = "Hello "
greeting =+ "Python!"
print (greeting)
ANSWER
Hello Python
Question 7.
immutable
ANSWER
cannot be changed
Question 8.
you can modify strings with
ANSWER
replace ()
upper ()
lower ()
Question 9.
del
ANSWER
delete objects.
, Question 10.
break
ANSWER
used to exit a loop prematurely.
Question 11.
reverse ()
ANSWER
method used to reverse the order of items in a list.
Question 12.
Return
ANSWER
optionally provides a result
Question 13.
definition
ANSWER
function is a named block of reusable code
Question 14.
Benefits
ANSWER
enhances code modularity, readability, and reusability
Question 15.
modulus %
ANSWER
returns the remainder
GUIDE
UPDATED ACTUAL EXAM QUESTIONS AND CORRECT
ANSWERS
Question 1.
string [start:stop:step]
ANSWER
start is where slicing begins
-if not provided default to beginning of string
stop is where slicing ends
- if not provided default to end of string step or stride between characters
- if not provided default to 1
Question 2.
first for cloud automation
ANSWER
pip install boto3
Question 3.
while loop
ANSWER
used to repeatedly execute a block of code as long as a certain condition is true.
Question 4.
for loop
ANSWER
used to iterate over a sequence
,Question 5.
clear ()
ANSWER
clears dictionary
Question 6.
greeting = "Hello "
greeting =+ "Python!"
print (greeting)
ANSWER
Hello Python
Question 7.
immutable
ANSWER
cannot be changed
Question 8.
you can modify strings with
ANSWER
replace ()
upper ()
lower ()
Question 9.
del
ANSWER
delete objects.
, Question 10.
break
ANSWER
used to exit a loop prematurely.
Question 11.
reverse ()
ANSWER
method used to reverse the order of items in a list.
Question 12.
Return
ANSWER
optionally provides a result
Question 13.
definition
ANSWER
function is a named block of reusable code
Question 14.
Benefits
ANSWER
enhances code modularity, readability, and reusability
Question 15.
modulus %
ANSWER
returns the remainder