Skip to content
Pass Any WGU OA Exam Now & Pay After You Pass. Contact Us!
  1. Home
  2. WGU Exams
  3. WGU D522
  4. Set 3
WGU D522 · Python for IT Automation

WGU D522 Practice Questions – Set 3

50 multiple-choice questions with answers and detailed explanations. Untimed — choose an answer to check it instantly.

Question 1 of 50

What does this Python code output?

print(5 // 2)

Question 2 of 50

What does the following Python code output?

x = [“a”, “b”, “c”]

x.append(“d”)

print(x)

Question 3 of 50

What does the following Python code return?

print(len([1, 2, 3, 4, 5]))

Question 4 of 50

What does this Python code return?

print(“Hello, World!”.upper())

Question 5 of 50

What will this Python code return?

x = [1, 2, 3, 4]

print(x.index(3))

Question 6 of 50

What does this Python code return?

print(2 ** 3)

Question 7 of 50

What will the following Python code output?

fruits = [“apple”, “banana”, “cherry”]

fruits.sort()

print(fruits)

Question 8 of 50

What is the output of this Python code?

print(“abc” + “def”)

Question 9 of 50

What does this Python code return?

print([1, 2, 3].pop())

Question 10 of 50

What will this Python code output?

print(10 % 3)

Question 11 of 50

What does this Python code return?

print(“Python”.startswith(“P”))

Question 12 of 50

What is the output of this Python code?

print(list(range(3)))

Question 13 of 50

What will this Python code output?

print(3 == 3.0)

Question 14 of 50

What does this Python code return?

print(“123”.isdigit())

Question 15 of 50

What will this Python code output?

print(2 != 3)

Question 16 of 50

What does this Python code return?

print([1, 2, 3] == [1, 2, 3])

Question 17 of 50

What will be the result of this Python code?

x = [1, 2, 3]

print(len(x))

Question 18 of 50

What does this Python code output?

x = 5

y = “5”

print(str(x) == y)

Question 19 of 50

What does this Python code return?

x = [1, 2, 3]

y = x

y.append(4)

print(x)

Question 20 of 50

What does this Python code output?

x = [1, 2, 3]

y = x.copy()

y.append(4)

print(x)

Question 21 of 50

What does this Python code return?

print(“Python”.find(“y”))

Question 22 of 50

What will be the output of this Python code?

x = “banana”

y = “apple”

print(x > y)

Question 23 of 50

What does this Python code return?

print([1, 2, 3, 4][:2])

Question 24 of 50

What will this Python code output?

x = [1, 2, 3]

x.insert(1, “a”)

print(x)

Question 25 of 50

What does this Python code return?

x = [1, 2, 3]

x.clear()

print(x)

Question 26 of 50

What is the result of this Python code?

x = [“apple”, “banana”]

x.extend([“cherry”, “date”])

print(x)

Question 27 of 50

What will this Python code output?

x = 10

if x > 5:

print(“Greater”)

else:

print(“Smaller”)

Question 28 of 50

What does this Python code return?

print(min([3, 1, 2]))

Question 29 of 50

What will this Python code output?

x = [10, 20, 30, 40]

print(x[1:3])

Question 30 of 50

What does this Python code output?

print(5 + 5)

Question 31 of 50

What does this Python code return?

print(type([]))

Question 32 of 50

What is the result of this Python code?

print([1, 2] + [3, 4])

Question 33 of 50

What does this Python code output?

x = (1, 2, 3)

print(len(x))

Question 34 of 50

What will this Python code return?

x = set([1, 2, 2, 3])

print(x)

Question 35 of 50

What does this Python code return?

print(“Python”.endswith(“n”))

Question 36 of 50

What will be the output of this Python code?

x = [1, 2, 3]

y = [1, 2, 3]

print(x is y)

Question 37 of 50

What does this Python code return?

x = (1, 2, 3)

y = (1, 2, 3)

print(x == y)

Question 38 of 50

What will this Python code output?

x = {“a”: 1, “b”: 2}

print(x[“a”])

Question 39 of 50

What does this Python code return?

print(len({1, 2, 3}))

Question 40 of 50

What will this Python code output?

x = [1, 2, 3]

print(x[-1])

Question 41 of 50

What does this Python code return?

print(“Python”.islower())

Question 42 of 50

What is the result of this Python code?

x = 10

y = 20

print(x > y)

Question 43 of 50

What does this Python code return?

print(“Hello World!”.replace(“World”, “Python”))

Question 44 of 50

What will be the result of this Python code?

x = [1, 2, 3, 4, 5]

print(x[1:4])

Question 45 of 50

What does this Python code return?

print(type((1,)))

Question 46 of 50

What will this Python code output?

x = “12345”

print(x[::-1])

Question 47 of 50

What is the result of this Python code?

x = [1, 2, 3]

y = [4, 5]

x.extend(y)

print(x)

Question 48 of 50

What will this Python code output?

x = 5

if x != 5:

print(“Not Five”)

else:

print(“Five”)

Question 49 of 50

What does this Python code return?

print(“abc”.isalpha())

Question 50 of 50

What will this Python code output?

x = {“a”: 1, “b”: 2, “c”: 3}

print(len(x))

Set 3 complete

You scored 0%

0 correct out of 0 answered (50 questions in this set).

Next: Set 4

Struggling with WGU D522?

If this exam is giving you a hard time, let us be your helping hand. Contact us, and we'll provide the assistance you need to pass and move forward.

Chat Now