Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 32 pages
Exam (elaborations)

WGU D335 INTRODUCTION TO PROGRAMMING IN PYTHON OBJECTIVE ASSESSMENT – WESTERN GOVERNORS ] ACTUAL QUESTIONS AND CORRECT ANSWERS (VERIFIED ANSWERS) PLUS RATIONALES 2026 Q&A | INSTANT DOWNLOAD PDF.

Document preview thumbnail
Preview 4 out of 32 pages

WGU D335 INTRODUCTION TO PROGRAMMING IN PYTHON OBJECTIVE ASSESSMENT – WESTERN GOVERNORS ] ACTUAL QUESTIONS AND CORRECT ANSWERS (VERIFIED ANSWERS) PLUS RATIONALES 2026 Q&A | INSTANT DOWNLOAD PDF.

Content preview

WGU D335 INTRODUCTION TO PROGRAMMING IN PYTHON
OBJECTIVE ASSESSMENT – WESTERN GOVERNORS ] ACTUAL
QUESTIONS AND CORRECT ANSWERS (VERIFIED ANSWERS)
PLUS RATIONALES 2026 Q&A | INSTANT DOWNLOAD PDF.


Core Domains
Python Fundamentals and Syntax
Variables, Data Types, and Operators
Control Structures: Conditionals and Loops
Functions, Parameters, and Return Values
Strings, Lists, Tuples, and Dictionaries
File Input/Output and Exception Handling
Object-Oriented Programming: Classes and Objects
Standard Library Modules and Documentation
Introduction
This comprehensive objective assessment evaluates the student’s proficiency in
the foundational concepts of Python programming as covered in WGU D335. The
examination tests the ability to write, debug, and analyze Python code using core
language constructs including variables, data types, operators, control flow,
functions, built-in data structures, file operations, and introductory object-
oriented programming. Questions are presented as multiple-choice and code-
interpretation items that mirror real-world scripting tasks. Emphasis is placed on
practical application of Python syntax, logical problem-solving, and best practices
in writing clean and efficient code. Success demonstrates readiness to advance
into intermediate programming courses and apply Python skills to academic and
entry-level professional projects.
SECTION ONE: QUESTIONS 1–100
Question 1
What is the output of the following Python code?
python
x=5

,y=2
print(x // y)
A. 2.5
B. 2
C. 2.0
D. 1
B. 2
RATIONALE: The // operator performs floor division, which divides and
truncates the decimal part, returning an integer. 5 // 2 equals 2. Regular
division / would return 2.5. % is modulo. So the result is 2.
Question 2
Which of the following correctly creates a list in Python?
A. list = {1, 2, 3}
B. list = (1, 2, 3)
C. list = [1, 2, 3]
D. list = "1, 2, 3"
C. list = [1, 2, 3]
RATIONALE: Lists are defined using square brackets []. Curly braces {} create
a set or dictionary, parentheses () create a tuple, and quotes create a string. So C
is correct.
Question 3
In Python, which keyword is used to define a function?
A. function
B. def
C. define
D. func
B. def
RATIONALE: Functions are defined using the def keyword, followed by the
function name and parentheses. For example: def my_func():. The other terms
are not valid Python keywords for function definition.
Question 4
What is the value of result after executing the following code?

,python
x = 10
if x > 5:
result = "Greater"
else:
result = "Less or Equal"
A. "Greater"
B. "Less or Equal"
C. None
D. Error
A. "Greater"
RATIONALE: x is 10, which is greater than 5, so the if condition is true,
and result is assigned "Greater". The else block is skipped.
Question 5
Which of the following is an immutable data type in Python?
A. List
B. Dictionary
C. Set
D. Tuple
D. Tuple
RATIONALE: Tuples are immutable, meaning their elements cannot be
changed after creation. Lists, dictionaries, and sets are mutable.
Question 6
What will len("Hello World") return?
A. 10
B. 11
C. 12
D. 5
B. 11
RATIONALE: The len() function counts the number of characters in the string,

, including spaces. "Hello World" has 11 characters (5 for Hello, 1 space, 5 for
World).
Question 7
Which operator is used for exponentiation in Python?
A. ^
B. **
C. *
D. %
B. **
RATIONALE: ** raises a number to a power (e.g., 2**3 = 8). ^ is the bitwise
XOR operator, * multiplication, % modulo.
Question 8
What does the range(5) function generate?
A. Numbers 1 to 5
B. Numbers 0 to 5
C. Numbers 0 to 4
D. Numbers 1 to 4
C. Numbers 0 to 4
RATIONALE: range(5) generates a sequence from 0 up to (but not including)
5, i.e., 0, 1, 2, 3, 4. range(1,5) would produce 1 to 4.
Question 9
How do you access the value associated with the key "name" in a
dictionary person = {"name": "Alice", "age": 30}?
A. person["Alice"]
B. person.name
C. person["name"]
D. person(name)
C. person["name"]
RATIONALE: Dictionary values are accessed using square brackets with the
key as a string. person["name"] returns "Alice". Dot notation is not used for
dictionaries; that's for objects.

Document information

Uploaded on
August 12, 2026
Number of pages
32
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$23.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
NursingTotur2
3.3
(87)
Sold
606
Followers
39
Items
6259
Last sold
13 hours ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions