Python OBJECTIVE ASSESSMENT ACTUAL EXAM
2025/2026 QUESTIONS WITH VERIFIED
CORRECT SOLUTIONS || 100% GUARANTEED
PASS <BRAND NEW VERSION>
WGU D335 Python Assessment Practice Questions
Category: Python Fundamentals & Syntax
1. Which of the following is the correct way to assign the value 10 to a variable named x?
A) x := 10
B) x = 10 ✓
C) x == 10
D) let x = 10
2. Which keyword is used to define a function in Python?
A) def ✓
B) function
C) define
D) func
3. What will be the output of print(2 ** 3)?
A) 6
B) 8 ✓
C) 9
D) 23
4. What is the result of 10 // 3?
A) 3.333
B) 3 ✓
C) 4
D) 1
5. Which operator is used for integer division (floor division)?
A) /
, B) %
C) // ✓
D) **
6. Which of these is a valid string declaration?
A) string = "Hello World"
B) string = 'Hello World'
C) string = """Hello World"""
D) All of the above ✓
7. What is the result of "Hello" + "World"?
A) "Hello World"
B) "HelloWorld" ✓
C) "Hello" + "World"
D) An Error
8. The % operator, when used with strings, is for:
A) Modulo division
B) String formatting ✓
C) Percentage calculation
D) Commenting
9. Which function is used to get user input from the command line?
A) input() ✓
B) get()
C) scan()
D) read()
10. What does the type() function return?
A) The memory address of an object
B) The class (data type) of an object ✓
C) The value of an object
D) The length of an object
Category: Data Structures (Lists, Tuples, Dictionaries, Sets)
11. Which data structure is ordered, mutable, and allows duplicate elements?
A) Tuple
B) List ✓
C) Dictionary
D) Set
,12. How do you access the second element in a list named my_list?
A) my_list(1)
B) my_list[1] ✓
C) my_list[2]
D) my_list{1}
13. Which method is used to add an element to the end of a list?
A) append() ✓
B) add()
C) insert()
D) extend()
14. What is the output of [1, 2, 3] * 2?
A) [2, 4, 6]
B) [1, 2, 3, 1, 2, 3] ✓
C) [[1, 2, 3], [1, 2, 3]]
D) [1, 2, 3, 2]
15. Which data structure is ordered and immutable?
A) List
B) Tuple ✓
C) Dictionary
D) Set
16. How do you create a tuple with a single element?
A) t = (1)
B) t = 1
C) t = (1,) ✓
D) t = tuple(1)
17. Which data structure stores data in key-value pairs?
A) List
B) Tuple
C) Dictionary ✓
D) Set
18. How do you retrieve the value for the key "name" from a dictionary person?
A) person["name"] ✓
B) person("name")
, C) person.key("name")
D) person.getKey("name")
19. Which method returns a list of all keys in a dictionary?
A) dict.keys() ✓
B) dict.items()
C) dict.values()
D) dict.all()
20. Which data structure is unordered, mutable, and does not allow duplicate elements?
A) List
B) Tuple
C) Dictionary
D) Set ✓
21. What will my_set = {1, 2, 2, 3} result in?
A) {1, 2, 2, 3}
B) {1, 2, 3} ✓
C) {1, 3}
D) An Error
22. Which list method removes and returns the last item?
A) remove()
B) pop() ✓
C) delete()
D) clear()
23. What is the purpose of the in keyword when used with a list?
A) To add an element
B) To check for membership ✓
C) To remove an element
D) To sort the list
Category: Control Flow (Conditionals & Loops)
24. Which keyword is used to start an if statement?
A) if ✓
B) else
C) when
C) condition