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 2 out of 7 pages
Exam (elaborations)

WGU D335 Introduction to Programming in Python Objective Assessment Actual Exam – Western Governors University (WGU) – 2026/2027 Academic Year – Verified Questions and Answers for Computer Science and IT Students

Document preview thumbnail
Preview 2 out of 7 pages

This document contains verified questions and answers for the WGU D335 Introduction to Programming in Python Objective Assessment for the 2026/2027 academic year. It covers foundational Python programming concepts, including variables, data types, control structures, functions, loops, collections, file handling, exception handling, input and output, and basic problem-solving techniques. The material includes 15 official examination-style questions, with 12 correct selections required to achieve the 80% passing score, designed to reinforce introductory programming knowledge and support preparation for the WGU objective assessment.

Content preview

WGU D335 Introduction to
Programming in Python Objective
Assessment Actual Exam 2026/2027 |
Verified Questions
Western Governors University (WGU) | Verified Q&A |
Professional Computer Science and IT Students
15 Official Examination Questions | 12 Correct Selections Required (80% Passing Score)




This comprehensive examination set comprises exactly 15 original questions designed to
reinforce official Western Governors University (WGU) course objectives for actual exam
readiness and professional competency, adhering strictly to the standard WGU D335
Introduction to Programming in Python Objective Assessment blueprint. The examination
covers four primary domains: Python Basics and Syntax; Control Flow and Functions; Data
Structures (Lists, Dictionaries, Tuples); and Object-Oriented Programming and File I/O. In
accordance with official WGU D335 curriculum benchmarks, candidates must execute 15
questions and achieve a minimum of 12 correct selections to attain the required 80% passing
score. Each item in this verified collection addresses distinct Python operators, branching
constructs, data collection methods, and object-oriented principles to ensure thorough mastery
of professional software engineering competencies in 2026/2027.




Domain: Python Basics and Syntax
1. What is the output of the Python expression 2 ** 3 * 4 // 3?
A. 8
B. 10
C. 10.6667
D. 12
Correct Answer: B
Rationale: According to Python operator precedence rules, exponentiation (**) has the
highest precedence, followed by multiplication (*) and floor division (//), which are
processed from left to right. First, 2 ** 3 resolves to 8. Next, 8 * 4 resolves to 32. Finally,
floor division 32 // 3 resolves to the integer 10 without fractional remainder.

2. Given the variables item = "Monitor" and price = 249.5, which f-string syntax
correctly formats the price to display with exactly two decimal places as "The
Monitor costs $249.50"?

WGU D335 Introduction to Programming in Python Objective Assessment Actual Exam 2026/2027 |
Verified Questions

, A. f"The {item} costs ${price:.2f}"
B. f"The {item} costs ${price:2d}"
C. f"The {item} costs ${round(price, 2)}"
D. f"The {item} costs ${price:%2f}"
Correct Answer: A
Rationale: In Python f-strings, format specifiers are introduced after a colon (:) within
braces. The specifier .2f formats a floating-point number as a fixed-point decimal string
with exactly two digits after the decimal point, appending trailing zeros if necessary to
yield "$249.50".

3. What occurs when executing val = int(input("Enter value: ")) if the user types
45.8 at the console prompt?
A. val is assigned the integer 45 by truncating the decimal portion
B. val is assigned the integer 46 by rounding to the nearest whole number
C. Python raises a ValueError because int() cannot directly convert a string containing a
decimal point into an integer
D. Python converts the string to a floating-point number automatically
Correct Answer: C
Rationale: The built-in function input() returns string data. Calling int("45.8") raises a
ValueError because the string literal contains a decimal point, which is not a valid base-10
integer representation. Converting a decimal string to an integer requires calling float()
first, such as int(float("45.8")).

4. What value is assigned to result after executing result = (5 > 10) and ( ==
0)?
A. True
B. False
C. ZeroDivisionError is raised immediately
D. None
Correct Answer: B
Rationale: Python's logical and operator utilizes short-circuit processing. When executing
(5 > 10) and ( == 0), the left operand (5 > 10) resolves to False. Because False and
<expression> is certain to be False, Python skips processing of the right operand ( ==
0), preventing a ZeroDivisionError and assigning False to result.

Domain: Control Flow and Functions
5. What is printed to the console when the following code block executes with
score = 85?

score = 85
if score >= 90:
print("A")
elif score >= 80:
print("B")
elif score >= 85:


WGU D335 Introduction to Programming in Python Objective Assessment Actual Exam 2026/2027 |
Verified Questions

Document information

Uploaded on
July 31, 2026
Number of pages
7
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.00

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.
BestSellerStuvia
3.6
(676)
Sold
4795
Followers
2080
Items
6200
Last sold
7 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