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 Intro to Python NKO2 OA | 300 Practice Questions with Verified Answers & Rationales | Python Fundamentals, Data Types, Control Flow, Functions, File I/O, Exception Handling | 2026 Update | Graded A+

Rating
-
Sold
-
Pages
87
Grade
A+
Uploaded on
16-04-2026
Written in
2025/2026

Pass the WGU D335 Introduction to Programming in Python (NKO2) Objective Assessment (2026) with this comprehensive 300-question study guide. This document includes real exam-style questions, verified correct answers (graded A+) , and detailed rationales explaining the Python programming concepts behind each answer. Topics Covered – All D335 Competencies: Python Fundamentals & Syntax (25%) (variables, identifiers, reserved words, print(), input(), type(), comments, whitespace, syntax/runtime/logic errors, NameError, TypeError, ValueError, assignment operator, literals, int(), str(), float(), string concatenation, escape sequences (n, t), raw strings, len(), indexing/slicing, ord(), chr(), operator precedence, //, %, **, +=, f-strings, format specifiers, abs(), round(), enumerate(), bool(), truthy/falsy, id(), mutability/immutability, name, if name == "main", range()) Data Types & Structures (25%) (lists – creation, indexing, slicing, append(), pop(), remove(), sort(), sorted(), reverse, list comprehensions; tuples – immutability, creation; sets – uniqueness, add(), remove(); dictionaries – key-value pairs, keys(), values(), items(), get(), in operator, dictionary comprehensions; nested lists, shallow vs. deep copy, containers, namedtuple, KeyError, zip(), map(), filter(), lambda functions) Control Flow & Loops (20%) (if/elif/else statements, for loops (range, iterating sequences), while loops, break, continue, pass, nested loops, infinite loops, else clause in loops, ternary conditional operator, all(), any(), min(), max(), sum()) Functions & Modules (15%) (function definition – def, parameters vs. arguments, return values, default parameters, keyword arguments, *args, **kwargs, local vs. global variables, global keyword, nonlocal keyword, scope, docstrings, import statements, from/import, aliases (as), modules (math, random, datetime, os, sys, json), packages, , (), (), rial(), nt(), m(), e(), le(), (), d(), ir(), , (), ()) File I/O & Exception Handling (10%) (open() – modes: 'r', 'w', 'a', 'r+', 'w+'; read(), readline(), readlines(), write(), seek(), tell(), with statement, csv module – r, r, csv.DictReader, csv.DictWriter; try/except/else/finally blocks, multiple except blocks, catching multiple exception types, raise, assert, exception chaining, FileNotFoundError) Problem Solving & Algorithms (5%) (computational thinking, IPO (Input-Process-Output), lab walkthroughs, Mad Libs, factorial, square root, unit conversion (kg to lbs), trip cost calculation, variable swapping, reverse binary, golf score calculation (eagle/birdie/par/bogey), integer string validation, trapezoid area, student ID formatting, max() comparison, index error handling, stock purchase cost, quantity-based discounts, CSV dictionary reading) Perfect for: WGU students taking D335 Introduction to Programming in Python WGU term exam preparation (NKO2 OA) Python beginners and intermediate learners General Python programming review Updated for the 2025–2026 WGU term 300 verified answers (100% accurate)

Show more Read less
Institution
WGU D335 Intro To Python
Course
WGU D335 Intro to Python

Content preview

WGU D335 Intro to Python Objective
Assessment (NKO2) Study Guide Complete
OA Exam Questions and Answers | 2026
Updated | 100% Correct

EXAM STRUCTURE & INSTRUCTIONS
Course: WGU D335 Introduction to Programming in Python
Assessment: Objective Assessment (OA) - NKO2
Format: Multiple Choice, Coding Problems, Fill-in-the-Blank
Content Areas:
Python Fundamentals & Syntax (25%)
Data Types & Structures (25%)
Control Flow & Loops (20%)
Functions & Modules (15%)
File I/O & Exception Handling (10%)
Problem Solving & Algorithms (5%)
Instructions: Select the single best answer for each question. For coding
problems, write code that produces the exact specified output.


DOMAIN I: Python Fundamentals & Syntax (Questions 1-60)
1. A program consists of which three basic instruction types?
A) Read, Write, Execute
B) Input, Process, Output
C) Compile, Link, Run

,D) Define, Call, Return
✅ Correct Answer: B - Input, Process, Output
📖 Rationale: Every program follows the IPO model: it takes input (from
keyboard, file, etc.), processes that data (computations, logic), and produces
output (to screen, file, etc.) .
2. What is a variable in Python?
A) A fixed value that cannot change
B) A named reference to a value stored in memory
C) A type of loop structure
D) A function that prints output
✅ Correct Answer: B - A named reference to a value stored in memory
📖 Rationale: A variable is a named item used to hold a value. It acts as a
reference or label that points to an object in memory. Variables can be
reassigned to different values .
3. What is an algorithm?
A) A type of Python data structure
B) A sequence of instructions that solves a problem
C) A built-in Python function
D) An error in program execution
✅ Correct Answer: B - A sequence of instructions that solves a problem
📖 Rationale: An algorithm is a step-by-step sequence of instructions
designed to solve a specific problem or accomplish a task .
4. What does the print() function do in Python?
A) Reads input from the user
B) Displays output to the screen and starts a new line
C) Opens a file for reading

,D) Converts a value to a string
✅ Correct Answer: B - Displays output to the screen and starts a new line
📖 Rationale: The print() function outputs text or variable values to the
console. By default, it adds a newline character at the end .
5. How do you denote a comment in Python?
A) // comment
B) /* comment */
C) # comment or """ multi-line comment """
D) <!-- comment -->
✅ **Correct Answer: C - # comment or """ multi-line comment """📖
*Rationale:* Single-line comments begin with#. Multi-line comments can be
enclosed in triple quotes ("""or'''`). Comments are ignored by the
interpreter .
6. What is the purpose of the input() function?
A) To display output to the screen
B) To get text input from the user
C) To convert data types
D) To open a file
✅ Correct Answer: B - To get text input from the user
📖 Rationale: The input() function reads a line of text from the user and
returns it as a string. It can optionally display a prompt string .
7. What does the type() function return?
A) The size of a variable in memory
B) The data type of a variable or value
C) The value of a variable

, D) The memory address of a variable
✅ Correct Answer: B - The data type of a variable or value
📖 Rationale: The built-in type() function returns the type of an object, such
as ,, or `` .
8. What is a syntax error?
A) A violation of the programming language's rules for symbols and
structure
B) An error that occurs during program execution
C) A logical flaw that produces wrong output
D) An error caused by incorrect indentation
✅ Correct Answer: A - A violation of the programming language's rules for
symbols and structure
📖 Rationale: Syntax errors occur when code violates the grammatical rules
of Python. The interpreter catches these before execution begins .
9. What is a runtime error?
A) A violation of language syntax
B) An error that occurs when the program attempts an impossible operation
C) A flaw in program logic
D) An indentation mistake
✅ Correct Answer: B - An error that occurs when the program attempts an
impossible operation
📖 Rationale: Runtime errors (exceptions) occur during program execution
when an operation cannot be completed, such as dividing by zero .
10. What is a NameError?
A) Using an invalid value in an operation
B) Trying to use a variable that does not exist

Written for

Institution
WGU D335 Intro to Python
Course
WGU D335 Intro to Python

Document information

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

Subjects

$28.49
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.
PremiumExamBank Chamberlain College Of Nursng
Follow You need to be logged in order to follow users or courses
Sold
317
Member since
2 year
Number of followers
65
Documents
5370
Last sold
21 hours ago
TEST BANKS AND ALL KINDS OF EXAMS SOLUTIONS

TESTBANKS, SOLUTION MANUALS &amp; ALL EXAMS SHOP!!!! TOP 5_star RATED page offering the very best of study materials that guarantee Success in your studies. Latest, Top rated &amp; Verified; Testbanks, Solution manuals &amp; Exam Materials. You get value for your money, Satisfaction and best customer service!!! Buy without Doubt..

4.8

1042 reviews

5
929
4
73
3
25
2
10
1
5

Recently viewed by you

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