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
Exam (elaborations)

WGU D335 INTRODUCTION TO PROGRAMMING IN PYTHON OBJECTIVE ASSESSMENT 2026 | PRACTICE QUESTIONS WITH VERIFIED ANSWERS & DETAILED RATIONALES | LATEST VERSION

Rating
-
Sold
-
Pages
103
Grade
A+
Uploaded on
16-03-2026
Written in
2025/2026

Follow the store for more updated WGU study guides and programming exam prep resources. Comprehensive WGU D335 Python Study Guide (2026) designed to help students confidently prepare for the Objective Assessment. Includes original practice questions with correct answers and detailed rationales, helping you understand programming logic instead of memorizing solutions. Covers essential Python fundamentals required for success in the course. Ideal for WGU students who want structured revision, concept clarity, and hands-on understanding of Python programming. Strengthens problem-solving skills, coding logic, and foundational programming knowledge. AREAS COVERED Python Syntax and Structure Variables and Data Types Conditional Statements (if/else) Loops (for, while) Functions and Parameters Lists, Dictionaries, and Basic Data Structures Debugging and Error Handling Problem-Solving with Python

Show more Read less
Institution
WGU D335 INTRODUCTION TO PROGRAMMING IN PYTHON
Course
WGU D335 INTRODUCTION TO PROGRAMMING IN PYTHON

Content preview

WGU D335 INTRODUCTION TO PROGRAMMING
IN PYTHON OBJECTIVE ASSESSMENT 2026 |
PRACTICE QUESTIONS WITH VERIFIED
ANSWERS & DETAILED RATIONALES | LATEST
VERSION
WGU D335 — INTRODUCTION TO PROGRAMMING IN PYTHON
OBJECTIVE ASSESSMENT

PRACTICE QUESTIONS WITH VERIFIED ANSWERS & DETAILED RATIONALE |
LATEST VERSION
400 Multiple Choice Questions




SECTION 1: PYTHON FUNDAMENTALS



Q1. What is Python primarily classified as?
A) A compiled, statically typed language B) A markup language C) A low-level
machine language D) An interpreted, high-level, general-purpose
programming language E) A hardware description language

✔ CORRECT ANSWER: D RATIONALE: Python is an interpreted language,
meaning code is executed line by line by the Python interpreter. It is high-level because
it abstracts away memory management and hardware details, and general-purpose
because it supports web development, data science, automation, AI, and more.



Q2. Which symbol is used to write a single-line comment in Python?

A) // B) /* */ C) # D) -- E) $$

✔ CORRECT ANSWER: C RATIONALE: In Python, the hash symbol # begins a
single-line comment. Everything after # on that line is ignored by the interpreter. // is
used in languages like JavaScript and C++.


Q3. What will print(type(5)) output?

, A) <class 'float'> B) <class 'str'> C) <class 'int'> D) <class 'number'> E)
<class 'double'>

✔ CORRECT ANSWER: C RATIONALE: The integer literal 5 belongs to the int
class in Python. type() returns the data type of a value, and Python uses <class 'int'> as
its representation for integers.



Q4. Which of the following is a valid Python variable name?

A) 2variable B) my-variable C) class D) my_variable E) my variable

✔ CORRECT ANSWER: D RATIONALE: Python variable names must begin with
a letter or underscore, followed by letters, digits, or underscores. 2variable starts with a
digit, my-variable contains a hyphen, class is a reserved keyword, and my variable
contains a space.


Q5. What does the print() function do in Python?

A) Reads input from the user B) Saves data to a file C) Outputs text or
values to the console D) Declares a variable E) Compiles the program

✔ CORRECT ANSWER: C RATIONALE: The print() function outputs its
arguments to standard output (the console). It is one of Python's built-in functions and is
commonly used for displaying results, debugging, and user interaction.


Q6. Which of the following correctly assigns the value 10 to a variable named x?

A) x == 10 B) 10 = x C) x = 10 D) int x = 10 E) var x = 10

✔ CORRECT ANSWER: C RATIONALE: In Python, the single = is the
assignment operator. The variable name goes on the left and the value on the right. ==
is for comparison, and Python does not require type declarations like int.



Q7. What is the output of print() in Python 3?

A) 3 B) 3.0 C) 3.3333333333333335 D) 3.33 E) Error

,✔ CORRECT ANSWER: C RATIONALE: In Python 3, the / operator always
performs true (float) division, returning a float. The result is 3.3333333333333335 due to
floating-point representation. To get integer division, use //.


Q8. What operator is used for integer (floor) division in Python?

A) / B) % C) // D) div E) \

✔ CORRECT ANSWER: C RATIONALE: The // operator performs floor division,
discarding the decimal part and returning an integer result. For example, 10 // 3 returns
3. The % operator returns the remainder (modulus).



Q9. What does the modulus operator % return?

A) The quotient of division B) The remainder of division C) The power of a
number D) The square root E) The floor of division

✔ CORRECT ANSWER: B RATIONALE: The % operator returns the remainder
after dividing one number by another. For example, 10 % 3 returns 1 because 10
divided by 3 is 3 with a remainder of 1. It is commonly used to check even/odd
numbers.


Q10. What is the output of print(2 ** 4)?

A) 6 B) 8 C) 16 D) 24 E) 2

✔ CORRECT ANSWER: C RATIONALE: The ** operator is the exponentiation
(power) operator in Python. 2 ** 4 means 2 raised to the power of 4, which is 2×2×2×2 =
16.


Q11. Which function is used to accept user input in Python?

A) read() B) scan() C) get() D) input() E) fetch()

✔ CORRECT ANSWER: D RATIONALE: input() reads a line of text from the user
via the console and returns it as a string. For example, name = input("Enter your name:
") prompts the user and stores their response.

, Q12. What data type does input() always return?

A) int B) float C) str D) bool E) list

✔ CORRECT ANSWER: C RATIONALE: Regardless of what the user types,
input() always returns the value as a string (str). If a numeric value is needed, you must
convert it explicitly using int() or float().



Q13. How do you convert the string "42" to an integer?

A) str(42) B) int("42") C) float("42") D) convert("42") E) parse("42")

✔ CORRECT ANSWER: B RATIONALE: The int() function converts a compatible
string or float to an integer. int("42") returns the integer 42. float("42") would return 42.0,
and str(42) converts an integer back to string.



Q14. Which of the following is NOT a built-in Python data type?

A) int B) str C) bool D) char E) float

✔ CORRECT ANSWER: D RATIONALE: Python does not have a char data type
(unlike C or Java). Individual characters are simply strings of length 1. Python's built-in
types include int, float, str, bool, list, tuple, set, and dict.



Q15. What is the Boolean value of an empty string "" in Python?

A) True B) False C) None D) 0 E) Error

✔ CORRECT ANSWER: B RATIONALE: In Python, empty containers and zero-
like values evaluate to False. An empty string "", empty list [], 0, 0.0, and None are all
considered falsy. Any non-empty string or non-zero number is truthy.


Q16. What is the correct way to write a multi-line string in Python?

A) Using single quotes '...' B) Using double quotes "..." C) Using triple
quotes """...""" or '''...''' D) Using backslashes at each line end E) Using \n
characters only

Written for

Institution
WGU D335 INTRODUCTION TO PROGRAMMING IN PYTHON
Course
WGU D335 INTRODUCTION TO PROGRAMMING IN PYTHON

Document information

Uploaded on
March 16, 2026
Number of pages
103
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$14.99
Get access to the full document:

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

Get to know the seller

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.
PROFESSORKENNY Wgu
Follow You need to be logged in order to follow users or courses
Sold
1064
Member since
9 months
Number of followers
14
Documents
3493
Last sold
2 days ago
Professor Kenny Store

Top-quality, exam-focused study materials designed to help you pass with confidence. Each document is carefully structured, up-to-date, and aligned with real exam standards — featuring verified questions, accurate answers, and clear explanations that save you time and improve results. REFER 3 PEOPLE AND GET 1 DOCUMENT FREE... OR BUY 3 GET 1 FREE Perfect for finals, certification exams, and licensure test preparation, these resources are built for serious students who want higher scores and faster success. FOLLOW OUR STORE AND LEAVE A REVIEW!

Read more Read less
3.9

19 reviews

5
9
4
3
3
5
2
0
1
2

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