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

WGU E010 Objective Assessment 2 Foundations of Programming Python 2026/2027 – Questions and Answers | 100% Verified | Detailed Rationales – Pass Guaranteed – A+ Graded

Document preview thumbnail
Preview 4 out of 127 pages

WGU E010 Objective Assessment 2 Foundations of Programming Python 2026/2027 – Questions and Answers | 100% Verified | Detailed Rationales – Pass Guaranteed – A+ Graded

Content preview

WGU E010 Objective Assessment 2
Foundations of Programming Python
2026/2027 – Questions and Answers |
100% Verified | Detailed Rationales –
Pass Guaranteed – A+ Graded


Question 1: Data Types & Operations

What is the output of the following code?
python
x = "5"
y = 2
print(x * y)

A) 10
B) Error
C) "55"
D) "5 5"

Correct Answer: C) "55"

Rationale: In Python, the * operator, when used with a string and
an integer, performs repetition. The string "5" is repeated 2 times,
resulting in "55". This is different from arithmetic multiplication,
which would occur if both operands were numbers .

,Question 2: Control Flow

What is the output of the following code?
python
for i in range(1, 6, 2):
print(i, end=" ")

A) 1 2 3 4 5
B) 1 3 5
C) 2 4 6
D) 1 3 5 7

Correct Answer: B) 1 3 5

Rationale: The range(1, 6, 2) function generates a sequence
starting at 1, stopping before 6, and incrementing by a step of 2.
The values produced are 1, 3, and 5 .




Question 3: Functions & Scope

Which keyword is used to define a function in Python?

A) func
B) define
C) def
D) function

Correct Answer: C) def

,Rationale: The def keyword is the correct and only way to start a
function definition in Python. It is followed by the function name,
parentheses (), and a colon : .




Question 4: Loop Control

What does the continue statement do inside a loop in
Python?

A) Terminates the loop entirely
B) Skips the rest of the current iteration and moves to the next
one
C) Pauses the program
D) Restarts the loop from the beginning

Correct Answer: B) Skips the rest of the current iteration and
moves to the next one

Rationale: The continue statement immediately stops the
current iteration of the loop and jumps to the next iteration. It
does not exit the loop; that is the job of the break statement .




Question 5: Data Structures

Given the code for item in my_list:, what
does item represent?

, A) The index of the current element
B) The current element being processed
C) The length of the list
D) The entire list

Correct Answer: B) The current element being processed

Rationale: In a Python for loop, the variable (here item) is
assigned the value of each element in the iterable (here my_list)
one at a time, from the first to the last .




Question 6: Key Python Concepts

Which of the following is an immutable data type in Python?

A) list
B) dict
C) set
D) tuple

Correct Answer: D) tuple

Rationale: An immutable object cannot be changed after it is
created. Tuples are immutable. Lists (list), dictionaries (dict),
and sets (set) are all mutable, meaning their contents can be
modified .




Question 7: String Manipulation

Document information

Uploaded on
August 31, 2026
Number of pages
127
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$21.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
10
Followers
0
Items
840
Last sold
3 days 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