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

WGU D335 OA: Introduction to Programming in Python Objective Assessment Questions and Answers| Latest Update| Guaranteed Pass

Document preview thumbnail
Preview 4 out of 89 pages

This comprehensive exam guide contains verified multiple-choice questions for the WGU D335 Introduction to Programming in Python Objective Assessment (OA – NKO2), with each question including the correct answer in bold italic format and detailed rationales covering Python fundamentals, data types, control flow, functions, file I/O, and exception handling. This study guide features questions verified from actual exam patterns and the platform used by WGU students.

Content preview

WGU D335 OA: Introduction to Programming in Python
Objective Assessment Questions and Answers| Latest
Update| Guaranteed Pass

QUESTION 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
ANSWER: B) Input, Process, Output
EXPLANATION: 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.).


QUESTION 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
ANSWER: B) A named reference to a value stored in memory

,EXPLANATION: 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.


QUESTION 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
ANSWER: B) A sequence of instructions that solves a problem
EXPLANATION: An algorithm is a step-by-step sequence of instructions
designed to solve a specific problem or accomplish a task.


QUESTION 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
ANSWER: B) Displays output to the screen and starts a new line
EXPLANATION: The print() function outputs text or variable values to the
console. By default, it adds a newline character at the end.

,QUESTION 5
How do you denote a comment in Python?
A) // comment
B) /* comment */
C) # comment or """multi-line comment"""
D) <!-- comment -->
ANSWER: C) # comment or """multi-line comment"""
EXPLANATION: Single-line comments begin with #. Multi-line comments can
be enclosed in triple quotes (""" or '''). Comments are ignored by the
interpreter.


QUESTION 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
ANSWER: B) To get text input from the user
EXPLANATION: The input() function reads a line of text from the user and
returns it as a string. It can optionally display a prompt string.


QUESTION 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
ANSWER: B) The data type of a variable or value
EXPLANATION: The built-in type() function returns the type of an object,
such as <class 'int'>, <class 'str'>, etc.


QUESTION 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
ANSWER: A) A violation of the programming language's rules for symbols
and structure
EXPLANATION: Syntax errors occur when code violates the grammatical
rules of the programming language.


QUESTION 9
What data type is produced by the expression: 3 + 4.0?

Document information

Uploaded on
September 12, 2026
Number of pages
89
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$48.99

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

Sold
0
Followers
0
Items
36
Last sold
-



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