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 1
WGU D335 · Introduction to Programming in Python

WGU D335 Practice Questions – Set 1

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

Question 1 of 50

What function in Python is used to get input from the user?

Question 2 of 50

What is a string literal in Python?

Question 3 of 50

How can you keep multiple print() statements on the same line in Python?

Question 4 of 50

What is the symbol for an exponent operator in Python?

Question 5 of 50

Which function returns the number of elements in a list or string in Python?

Question 6 of 50

What type of loop repeats as long as a specified condition is true in Python?

Question 7 of 50

Which function converts a string to an integer in Python?

Question 8 of 50

What is a syntax error in Python?

Question 9 of 50

What does \\n represent in Python strings?

Question 10 of 50

What error occurs when a program attempts an impossible operation, such as dividing by zero?

Question 11 of 50

What is the purpose of indentation in Python code?

Question 12 of 50

What does the float() function do in Python?

Question 13 of 50

What is the result of 5 // 2 in Python?

Question 14 of 50

Which Python keyword is used to define a function?

Question 15 of 50

What does the return statement do in a function?

Question 16 of 50

What does pass do in Python code?

Question 17 of 50

Which Python function can round a floating-point number up to the nearest integer?

Question 18 of 50

What is a list in Python?

Question 19 of 50

Which operator is used for string concatenation in Python?

Question 20 of 50

What does the len() function return when applied to a list?

Question 21 of 50

What method would you use to add an element to the end of a list in Python?

Question 22 of 50

What is the correct syntax to import the math module in Python?

Question 23 of 50

What does the abs() function return?

Question 24 of 50

Which Python data type is used to store key-value pairs?

Question 25 of 50

How can you remove an element from a list in Python?

Question 26 of 50

Which of the following is a valid Python variable name?

Question 27 of 50

What does x = [1, 2, 3] represent in Python?

Question 28 of 50

Which operator is used for floor division in Python?

Question 29 of 50

Which method is used to reverse a list in Python?

Question 30 of 50

What does the random.randint() function do?

Question 31 of 50

Which function can be used to generate a random float number between 0 and 1 in Python?

Question 32 of 50

What is the default value returned by a Python function if no return statement is specified?

Question 33 of 50

How do you create a tuple in Python?

Question 34 of 50

Which method is used to find the position of a character in a string?

Question 35 of 50

What is the output of the following code: print(2 ** 3) ?

Question 36 of 50

Which function returns the type of an object in Python?

Question 37 of 50

Which method removes whitespace from the beginning and end of a string in Python?

Question 38 of 50

What is the purpose of the continue statement in a loop?

Question 39 of 50

What type of data does the input() function return?

Question 40 of 50

What is a comment in Python denoted by?

Question 41 of 50

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

Question 42 of 50

What does str(5) return in Python?

Question 43 of 50

Which method can be used to convert a string to lowercase in Python?

Question 44 of 50

Which keyword is used to handle exceptions in Python?

Question 45 of 50

What will be the output of print(4 % 2) ?

Question 46 of 50

Which function in Python generates a range of numbers?

Question 47 of 50

What is the output of the following code: print(10 // 3) ?

Question 48 of 50

Which method would you use to convert a string to an integer in Python?

Question 49 of 50

What is the purpose of the elif statement in Python?

Question 50 of 50

Which keyword is used to define a class in Python?

Set 1 complete

You scored 0%

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

Next: Set 2

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