EXAM 300 ACTUAL QUESTIONS AND CORRECT
ANSWERS WITH RATIONALE LATEST UPDATE
ALREADY GRADED A+ ASSURED PASS
This comprehensive 300-question examination resource covers the foundational
Python programming concepts tested on the WGU E010 Objective Assessment.
Organized into seven sections, it progresses from variables and data types through
conditional statements, loops, lists, dictionaries, tuples, sets, and functions. Each
question includes multiple-choice options, correct answers, and detailed rationales
explaining Python syntax, semantics, and common pitfalls. The questions
emphasize practical coding knowledge, including type conversion, list and
dictionary operations, loop control, function definitions, and variable scope. This
evidence-based resource supports exam preparation by reinforcing core
programming competencies required for success on the WGU E010 and D335
Python programming assessments.
Section 1: Python Fundamentals and Syntax (Questions 1-50)
Question 1
What is the correct way to create a variable named age with the value 25 in
Python?
A) age == 25
B) age := 25
C) age = 25
D) int age = 25
Answer: C
,Rationale: In Python, variables are created using the assignment operator (=) with
the variable name on the left and the value on the right. The double equals (==) is
used for comparison, not assignment. The colon equals (:=) is the walrus operator
used in assignment expressions. Python does not require type declarations like int
age = 25, which is syntax from languages such as Java or C++.
---
Question 2
Which of the following is a valid variable name in Python?
A) 2_variable
B) my-variable
C) _myVariable
D) my variable
Answer: C
Rationale: Variable names in Python must start with a letter or underscore, cannot
start with a digit, and cannot contain spaces or hyphens. The underscore is
permitted, making _myVariable valid. 2_variable starts with a digit. my-variable
contains a hyphen. my variable contains a space .
---
Question 3
Which symbol begins a single-line comment in Python?
A) //
B) #
C) /*
D) "
Answer: B
Rationale: The hash symbol (#) begins a single-line comment in Python.
Everything after the # on that line is ignored by the interpreter. In many other
languages, // is used for single-line comments, but Python uses #. Block comments
,in Python are not supported with /* */; triple-quoted strings are sometimes used as
docstrings but are not technically comments .
---
Question 4
Which data type is the value 3.14 in Python?
A) Integer
B) Float
C) String
D) Boolean
Answer: B
Rationale: Any number with a decimal point is a floating-point number (float) in
Python. Integers (int) are whole numbers without a decimal point. The value 3.14
contains a decimal point, making it a float. Strings are sequences of characters
enclosed in quotes, and Boolean values are True or False .
---
Question 5
What is the output of print(type())?
A) <class 'int'>
B) <class 'float'>
C) <class 'double'>
D) <class 'str'>
Answer: B
Rationale: In Python, the / operator performs true division and always returns a
float, even when the numbers divide evenly. evaluates to 5.0, which is a
float. The type() function confirms the result is a float. Python does not have a
double data type separate from float .
---
Question 6
, Which of the following is a Boolean value in Python?
A) "True"
B) true
C) True
D) 1
Answer: C
Rationale: Python's Boolean values are True and False, both capitalized. "True" is
a string because it is enclosed in quotes. true is not a valid keyword because
Python is case-sensitive. While 1 evaluates to True in a Boolean context, it is an
integer, not a Boolean value itself .
---
Question 7
What is the output of print(3 ** 3)?
A) 9
B) 27
C) 6
D) 12
Answer: B
Rationale: The ** operator performs exponentiation in Python. 3 ** 3 means 3
raised to the power of 3, which is 3 × 3 × 3 = 27. The ^ operator is used for bitwise
XOR, not exponentiation .
---
Question 8
What is the result of 15 % 4?
A) 3
B) 3.75
C) 4
D) 15