WGU E010 FOUNDATIONS OF PROGRAMMING
(PYTHON) EXAMINATION COMPLETE QUESTIONS AND
DETAILED SOLUTIONS LATEST UPDATE THIS YEAR JUST
RELEASED
Exam Coverage Areas
1. Python Syntax and Program Structure — Variables, statements, indentation, comments, naming
conventions, and basic program organization.
2. Data Types and Variables — Integers, floats, strings, Booleans, type conversion, and variable assignment.
3. Operators and Expressions — Arithmetic, comparison, logical, assignment, membership, and identity
operators.
4. Conditional Logic — if, elif, else, nested conditions, Boolean expressions, and decision-making.
5. Loops and Iteration — for, while, range(), loop control, nesting, and iteration patterns.
6. Strings and Collections — String operations, lists, tuples, dictionaries, indexing, slicing, and common
methods.
7. Functions — Defining functions, parameters, arguments, return values, scope, and reusable code.
8. Input, Output, and Error Handling — User input, formatted output, exceptions, and defensive
programming.
9. Algorithmic Thinking and Problem Solving — Tracing code, pseudocode concepts, decomposition,
debugging, and computational reasoning.
10. Basic Python Programming Practices — Readability, modularity, testing, documentation, and avoiding
common programming errors.
1.
Which statement most accurately describes the primary purpose of a variable in a
Python program when storing information for later processing?
A. It permanently saves information to the computer's hard drive
B. It provides a name that refers to a stored value
C. It automatically converts every value into a string
D. It forces Python to execute the associated statement repeatedly
Answer: B
Rationale: A variable provides a name that can refer to a value. Variables make
programs easier to read and allow stored data to be reused and modified.
,2.
Which Python statement correctly creates a variable named score and assigns the
integer value 95 to it?
A. integer score = 95
B. score == 95
C. score = 95
D. set score to 95
Answer: C
Rationale: Python uses the assignment operator = to assign a value to a variable.
== is used for comparison rather than assignment.
3.
A programmer wants to store the word Python as text in a variable. Which
statement correctly performs this assignment?
A. language = Python
B. language = "Python"
C. language == "Python"
D. string language = "Python"
Answer: B
Rationale: Text values must be represented as strings using quotation marks.
language = "Python" correctly assigns a string.
4.
,Why is indentation particularly important in Python programs compared with
many programming languages that use braces?
A. Indentation determines variable data types automatically
B. Indentation defines blocks of related statements
C. Indentation converts comments into executable instructions
D. Indentation determines whether numbers are integers or floats
Answer: B
Rationale: Python uses indentation to define code blocks for structures such as
functions, loops, and conditional statements.
5.
Which variable name follows common Python naming conventions and is also a
valid Python identifier?
A. student-name
B. 2nd_score
C. student_score
D. class
Answer: C
Rationale: Python variable names may contain letters, digits, and underscores but
cannot begin with a digit or use reserved keywords. student_score follows
standard snake_case conventions.
6.
What value is produced by the following Python expression?
7+3*2
, A. 20
B. 17
C. 13
D. 10
Answer: C
Rationale: Multiplication has precedence over addition. Python evaluates 3 * 2
first, producing 6, and then adds 7 to obtain 13.
7.
What is the primary purpose of a comment beginning with # in a Python
program?
A. To create a loop
B. To define a variable
C. To provide explanatory text ignored during execution
D. To force Python to display documentation
Answer: C
Rationale: A # comment is ignored by Python during execution and is commonly
used to explain code or document programming decisions.
8.
Which statement correctly demonstrates reassignment of a variable in Python?
A. count = 10 followed by count = 20
B. count == 10 followed by count == 20
C. variable count 10 followed by variable count 20
D. count :=:= 20
(PYTHON) EXAMINATION COMPLETE QUESTIONS AND
DETAILED SOLUTIONS LATEST UPDATE THIS YEAR JUST
RELEASED
Exam Coverage Areas
1. Python Syntax and Program Structure — Variables, statements, indentation, comments, naming
conventions, and basic program organization.
2. Data Types and Variables — Integers, floats, strings, Booleans, type conversion, and variable assignment.
3. Operators and Expressions — Arithmetic, comparison, logical, assignment, membership, and identity
operators.
4. Conditional Logic — if, elif, else, nested conditions, Boolean expressions, and decision-making.
5. Loops and Iteration — for, while, range(), loop control, nesting, and iteration patterns.
6. Strings and Collections — String operations, lists, tuples, dictionaries, indexing, slicing, and common
methods.
7. Functions — Defining functions, parameters, arguments, return values, scope, and reusable code.
8. Input, Output, and Error Handling — User input, formatted output, exceptions, and defensive
programming.
9. Algorithmic Thinking and Problem Solving — Tracing code, pseudocode concepts, decomposition,
debugging, and computational reasoning.
10. Basic Python Programming Practices — Readability, modularity, testing, documentation, and avoiding
common programming errors.
1.
Which statement most accurately describes the primary purpose of a variable in a
Python program when storing information for later processing?
A. It permanently saves information to the computer's hard drive
B. It provides a name that refers to a stored value
C. It automatically converts every value into a string
D. It forces Python to execute the associated statement repeatedly
Answer: B
Rationale: A variable provides a name that can refer to a value. Variables make
programs easier to read and allow stored data to be reused and modified.
,2.
Which Python statement correctly creates a variable named score and assigns the
integer value 95 to it?
A. integer score = 95
B. score == 95
C. score = 95
D. set score to 95
Answer: C
Rationale: Python uses the assignment operator = to assign a value to a variable.
== is used for comparison rather than assignment.
3.
A programmer wants to store the word Python as text in a variable. Which
statement correctly performs this assignment?
A. language = Python
B. language = "Python"
C. language == "Python"
D. string language = "Python"
Answer: B
Rationale: Text values must be represented as strings using quotation marks.
language = "Python" correctly assigns a string.
4.
,Why is indentation particularly important in Python programs compared with
many programming languages that use braces?
A. Indentation determines variable data types automatically
B. Indentation defines blocks of related statements
C. Indentation converts comments into executable instructions
D. Indentation determines whether numbers are integers or floats
Answer: B
Rationale: Python uses indentation to define code blocks for structures such as
functions, loops, and conditional statements.
5.
Which variable name follows common Python naming conventions and is also a
valid Python identifier?
A. student-name
B. 2nd_score
C. student_score
D. class
Answer: C
Rationale: Python variable names may contain letters, digits, and underscores but
cannot begin with a digit or use reserved keywords. student_score follows
standard snake_case conventions.
6.
What value is produced by the following Python expression?
7+3*2
, A. 20
B. 17
C. 13
D. 10
Answer: C
Rationale: Multiplication has precedence over addition. Python evaluates 3 * 2
first, producing 6, and then adds 7 to obtain 13.
7.
What is the primary purpose of a comment beginning with # in a Python
program?
A. To create a loop
B. To define a variable
C. To provide explanatory text ignored during execution
D. To force Python to display documentation
Answer: C
Rationale: A # comment is ignored by Python during execution and is commonly
used to explain code or document programming decisions.
8.
Which statement correctly demonstrates reassignment of a variable in Python?
A. count = 10 followed by count = 20
B. count == 10 followed by count == 20
C. variable count 10 followed by variable count 20
D. count :=:= 20