• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 66 pages
Exam (elaborations)

WGU E010 Foundations of Programming (Python) |OA| Objective Assessment | 100+ Questions & Answers | 2026 Updated Study Guide

Document preview thumbnail
Preview 4 out of 66 pages

WGU E010 Foundations of Programming (Python) |OA| Objective Assessment | 100+ Questions & Answers | 2026 Updated Study Guide

Content preview

WGU E010 Foundations of Programming (Python) OA |
100+ Questions & Answers | 2026 Updated Study Guide
Python Fundamentals & Syntax
Question 1

Which statement correctly describes the purpose of Python indentation?

A. It determines the data type of a variable
B. It defines blocks of code such as those inside loops and conditional statements
C. It converts strings into integers
D. It determines the order in which variables are created

Correct Answer: B. It defines blocks of code such as those inside loops and conditional
statements

Rationale:
Python uses indentation to define the beginning and end of code blocks. For example, statements
belonging to an if, for, or while block must be consistently indented. Unlike languages that
commonly use braces {}, Python relies on indentation as part of its syntax.



Question 2

Which line correctly assigns the integer value 25 to a variable named age?

A. integer age = 25
B. age == 25
C. age = 25
D. 25 = age

Correct Answer: C. age = 25

Rationale:
The assignment operator = assigns a value to a variable. Therefore, age = 25 stores the integer
25 in the variable age.

The == operator is used for comparison, not assignment.



Question 3

,What is displayed by the following code?

print("Python")
print("Programming")

A. Python Programming on one line
B. PythonProgramming on one line
C. Python followed by Programming on the next line
D. Nothing because two print statements cannot be used consecutively

Correct Answer: C. Python followed by Programming on the next line

Rationale:
By default, print() ends with a newline character. Therefore, each print() statement displays
its argument on a separate line.



Question 4

Which symbol begins a single-line comment in Python?

A. //
B. <!--
C. #
D. /*

Correct Answer: C. #

Rationale:
Python uses the hash symbol (#) to begin a single-line comment.

Example:

# This is a comment
print("Hello")

The Python interpreter ignores everything after # on that line.



Question 5

What will the following code display?

x = 10
x = 20

,print(x)

A. 10
B. 20
C. 30
D. An error because x cannot be reassigned

Correct Answer: B. 20

Rationale:
Python variables can be reassigned. The first statement assigns 10 to x, but the second statement
replaces that value with 20. Therefore, print(x) displays 20.




Variables & Data Types
Question 6

Which Python data type is used to represent a value such as 3.14?

A. int
B. str
C. float
D. bool

Correct Answer: C. float

Rationale:
A floating-point number represents a number containing a decimal component. For example:

price = 3.14

The variable price contains a float.



Question 7

What is the data type of the value "100"?

A. int
B. float
C. str
D. bool

, Correct Answer: C. str

Rationale:
Quotation marks indicate that 100 is being represented as text rather than as a numeric integer.

x = "100"

Here, x is a string.



Question 8

What is the output?

x = 7
y = 2
print(x + y)

A. 5
B. 9
C. 14
D. 72

Correct Answer: B. 9

Rationale:
Both variables contain integers. The + operator performs arithmetic addition:

7 + 2 = 9




Question 9

What is the output?

x = "7"
y = "2"
print(x + y)

A. 9
B. 72
C. 14
D. An error

Correct Answer: B. 72

Document information

Uploaded on
September 29, 2026
Number of pages
66
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$15.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

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.
professoraxel
3.8
(495)
Sold
2676
Followers
1587
Items
20728
Last sold
1 day ago



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