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
Time Allowed: 3 hours
Passing Score: Competency-based (approx. 70-80%)
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. What is the correct way to output "Hello World" in Python?
A) print("Hello World")
B) console.log("Hello World")
,C) printf("Hello World")
D) echo "Hello World"
✅ Correct Answer: A - print("Hello World")
📖 Rationale: print() is the built-in function used to output text to the
console. Other options are from other languages (JavaScript, C, PHP).
2. What is the correct way to get user input in Python?
A) input("Enter your name: ")
B) get_input("Enter your name: ")
C) read("Enter your name: ")
D) scan("Enter your name: ")
✅ Correct Answer: A - input("Enter your name: ")
📖 Rationale: The input() function reads a line from user input and returns it
as a string.
3. Which of the following is a valid variable name in Python?
A) 2myVar
B) my-var
C) _myVar
D) my var
✅ Correct Answer: C - _myVar
📖 Rationale: Variable names must start with a letter or
underscore. 2myVar starts with a digit; my-var contains a hyphen; my
var contains a space.
4. What is the data type of the value 3.14?
A) int
B) float
C) str
,D) bool
✅ Correct Answer: B - float
📖 Rationale: Numbers with decimal points are floating-point numbers
(floats). Integers are whole numbers.
5. What is the data type of the value 42?
A) int
B) float
C) str
D) bool
✅ Correct Answer: A - int
📖 Rationale: Whole numbers without decimal points are integers.
6. What is the data type of the value "Hello"?
A) int
B) float
C) str
D) bool
✅ Correct Answer: C - str
📖 Rationale: Text enclosed in quotes is a string (str).
7. What is the data type of the value True?
A) int
B) float
C) str
D) bool
✅ Correct Answer: D - bool
📖 Rationale: True and False are Boolean values (bool).
, 8. What is the result of type(10) in Python?
A) ``
B) ``
C) ``
D) ✅ **Correct Answer: A -**
📖 Rationale: type() returns the data type of the value. 10 is an integer.
9. What is the result of type(3.14)?
A) ``
B) ``
C) ``
D) ✅ **Correct Answer: B -**
📖 Rationale: Numbers with decimals are floats.
10. What is the result of type("Python")?
A) ``
B) ``
C) ``
D) ✅ **Correct Answer: C -**
📖 Rationale: Text in quotes is a string.
11. What is the result of type(True)?
A) ``
B) ``
C) ``
D) ✅ **Correct Answer: D -**
📖 Rationale: True and False are Boolean values.