WGU D522 Python for IT Automation
| PA | Pre- Assessment Accurate
1 of 39
Term
How do you remove an element from a list in Python?
Give this one a try later!
discard() del()
remove() pop()
Don't know?
2 of 39
Term
How can you convert the string “123” into an integer in Python?
,Give this one a try later!
str(123) list("123")
int("123") float("123")
Don't know?
3 of 39
Term
This Python code snippet returns a syntax error when run:
def multiply_numbers(num1, num2)
result = num1 * num2
return result
num1 = 5
num2 = 8
print(multiply_numbers(num1, num2))
Which code adjustment will resolve the syntax error?
Give this one a try later!
Add a semicolon at the end of the Add a colon after def
print command. multiply_numbers(num1, num2).
, Remove the parentheses after Use return (result) instead of return
multiply_numbers. result.
Don't know?
4 of 39
Term
How do you declare an empty set in Python?
Give this one a try later!
set() empty()
[] {}
Don't know?
5 of 39
Term
Which method is used to return the number of elements in a list?
Give this one a try later!
length() count()
| PA | Pre- Assessment Accurate
1 of 39
Term
How do you remove an element from a list in Python?
Give this one a try later!
discard() del()
remove() pop()
Don't know?
2 of 39
Term
How can you convert the string “123” into an integer in Python?
,Give this one a try later!
str(123) list("123")
int("123") float("123")
Don't know?
3 of 39
Term
This Python code snippet returns a syntax error when run:
def multiply_numbers(num1, num2)
result = num1 * num2
return result
num1 = 5
num2 = 8
print(multiply_numbers(num1, num2))
Which code adjustment will resolve the syntax error?
Give this one a try later!
Add a semicolon at the end of the Add a colon after def
print command. multiply_numbers(num1, num2).
, Remove the parentheses after Use return (result) instead of return
multiply_numbers. result.
Don't know?
4 of 39
Term
How do you declare an empty set in Python?
Give this one a try later!
set() empty()
[] {}
Don't know?
5 of 39
Term
Which method is used to return the number of elements in a list?
Give this one a try later!
length() count()