Skip to content
Pass Any WGU OA Exam Now & Pay After You Pass. Contact Us!
  1. Home
  2. WGU Exams
  3. WGU D335
  4. Set 5
WGU D335 · Introduction to Programming in Python

WGU D335 Practice Questions – Set 5

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

Question 1 of 50

What will print(10 // 3) output in Python?

Question 2 of 50

Which of the following creates an empty list in Python?

Question 3 of 50

What is the output of print(‘hello’.upper()) in Python?

Question 4 of 50

Which method is used to combine the contents of two dictionaries in Python?

Question 5 of 50

What will print([1, 2, 3] + [4, 5]) output in Python?

Question 6 of 50

What is the correct syntax for defining a function in Python?

Question 7 of 50

How do you add a single element to a set in Python?

Question 8 of 50

What is the correct way to check if an element is in a list in Python?

Question 9 of 50

Which of the following is a tuple in Python?

Question 10 of 50

What does the clear() method do for a list in Python?

Question 11 of 50

Which method can be used to combine all elements in a list into a single string?

Question 12 of 50

How do you define a multi-line comment in Python?

Question 13 of 50

What is the output of print(type(42)) ?

Question 14 of 50

How do you access the first element of a tuple t = (10, 20, 30) ?

Question 15 of 50

Which operator is used to check if two values are the same object in memory?

Question 16 of 50

What is the output of bool(None) in Python?

Question 17 of 50

How do you check if a list is empty in Python?

Question 18 of 50

What is the output of print(“abc” * 3) ?

Question 19 of 50

Which of the following creates a dictionary in Python?

Question 20 of 50

What does the sorted() function do in Python?

Question 21 of 50

What is the result of list(“hello”) in Python?

Question 22 of 50

How do you retrieve all the keys from a dictionary in Python?

Question 23 of 50

Which operator is used to get the remainder of a division in Python?

Question 24 of 50

What will be the output of print(3 ** 2) ?

Question 25 of 50

How do you convert a list of strings into a single string separated by commas?

Question 26 of 50

How do you find the minimum value in a list in Python?

Question 27 of 50

What is the result of len(“Hello World”) ?

Question 28 of 50

What is the default value of a global variable in Python?

Question 29 of 50

Which of the following is not a valid list method in Python?

Question 30 of 50

What is the output of print(type([])) in Python?

Question 31 of 50

How do you remove the last element from a list in Python?

Question 32 of 50

What will print(range(5)) output in Python 3?

Question 33 of 50

How do you raise an exception in Python?

Question 34 of 50

What is the output of print(“Hello”.replace(“l”, “L”)) ?

Question 35 of 50

How do you declare a global variable inside a function in Python?

Question 36 of 50

What is the result of print(len([])) ?

Question 37 of 50

Which keyword is used to handle exceptions in Python?

Question 38 of 50

What is the output of print(“A” in “Apple”) ?

Question 39 of 50

What is the result of int(“42.5”) ?

Question 40 of 50

How do you concatenate two tuples in Python?

Question 41 of 50

What is the output of print(bool(0)) ?

Question 42 of 50

How do you check if a set is a subset of another set in Python?

Question 43 of 50

Which method is used to remove an element from a set in Python?

Question 44 of 50

What does the any() function do in Python?

Question 45 of 50

What will be the result of print({1, 2, 3} & {2, 3, 4}) ?

Question 46 of 50

Which of the following can be used as a dictionary key in Python?

Question 47 of 50

What is the result of max([10, 20, 30]) ?

Question 48 of 50

How do you read a file line by line in Python?

Question 49 of 50

What is the result of print(2 ** 3 ** 2) ?

Question 50 of 50

What does the strip() method do in Python?

Set 5 complete

You scored 0%

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

Struggling with WGU D335?

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