Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 44 pages
Exam (elaborations)

WGU E010 Foundations of Programming (Python) OA Final Exam | Complete Exam with Actual Questions & Correct Verified Answers (Rationales Included) | Latest Update 2026/2027 – Already Graded A+

Document preview thumbnail
Preview 4 out of 44 pages

Pass the WGU E010 Foundations of Programming (Python) OA with this complete 2026/2027 exam bank featuring actual questions, verified correct answers, and detailed rationales. Covers Python basics, operators & precedence, data types, loops (for/while), strings, lists, tuples, dictionaries, sets, functions, exception handling (try/except/finally), file I/O, math functions, Boolean logic, and classes. Fully updated and already Graded A+ — the essential resource for mastering the WGU Python OA.

Content preview

WGU E010 Foundations of Programming (Python) OA
Final Exam | Complete Exam with Actual Questions and
Correct Verified Answers (Rationales Included) | Latest
Update 2026/2027 - Already Graded A+


Question 1
What is the output of the following code? print(3 + 2 * 4)
A. 24
B. 11
C. 20
D. 14
Answer: B
Rationale: Operator precedence: multiplication before addition. 2 * 4 = 8, then 3 + 8 =
11.


Question 2
What is the correct way to output the string "Hello, World!" in Python?
A. echo "Hello, World!"
B. printf("Hello, World!")
C. print("Hello, World!")
D. console.log("Hello, World!")
Answer: C
Rationale: In Python, the built-in print() function outputs text to the console. The
other options are used in other languages.


Question 3
What is the output of the following code? print(5 == 5)
A. True
B. 10
C. False
D. 5



pg. 1

,Answer: A
Rationale: The == operator checks for equality. 5 == 5 is True.


Question 4
What is the output of the following code? print(type(3.14))
A. <class 'str'>
B. <class 'float'>
C. <class 'int'>
D. <class 'double'>
Answer: B
Rationale: In Python, numbers with decimal points are float type. 3.14 is a floating-
point number.


Question 5
What is the output of the following code? x = 5; x += 3; print(x)
A. 15
B. 3
C. 5
D. 8
Answer: D
Rationale: The += operator adds the right operand to the left operand and assigns the
result. x += 3 is equivalent to x = x + 3, so 5 + 3 = 8.


Question 6
What is the output of the following code? for i in range(3): print(i, end=" ")
A. 0 1 2 3
B. 1 2 3
C. 0 1 2
D. 1 2 3 4
Answer: C
Rationale: range(3) generates numbers from 0 to 2 (exclusive of 3). The loop prints 0,
1, 2.




pg. 2

,Question 7
What is the output of the following code? print("Hello"[::-1])
A. olleH
B. elloH
C. Hello
D. H
Answer: A
Rationale: The slice [::-1] reverses a string by stepping backwards through it.


Question 8
What is the result of int("3.14")?
A. 4
B. 3.14
C. 3
D. Error
Answer: D
Rationale: int() cannot convert a string representing a float with a decimal point
directly. It will raise a ValueError.


Question 9
Which type of loop is best used when the number of iterations is unknown?
A. for loop
B. while loop
C. nested loop
D. for-each loop
Answer: B
Rationale: A while loop runs until a condition becomes False, making it ideal when the
number of iterations is not known in advance.


Question 10
What is the output of the following code? my_list = [1, 2, 3]; my_list.append(4);
print(my_list)
A. [4, 1, 2, 3]
B. [1, 2, 3]

pg. 3

, C. [1, 2, 3, 4]
D. Error
Answer: C
Rationale: The append() method adds an element to the end of a list.


Question 11
What is the output of the following code? def add(a, b): return a + b; print(add(3, 4))
A. None
B. Error
C. 34
D. 7
Answer: D
Rationale: The function add takes two arguments and returns their sum. 3 + 4 = 7.


Question 12
What is the output of the following code? print(10 // 3)
A. 3.0
B. 4
C. 3.33
D. 3
Answer: D
Rationale: Floor division (//) returns the integer quotient. 10 // 3 = 3.


Question 13
Which of the following is a mutable data structure?
A. list
B. int
C. string
D. tuple
Answer: A
Rationale: Lists are mutable and can be modified after creation. Tuples, strings, and
integers are immutable.




pg. 4

Document information

Uploaded on
August 19, 2026
Number of pages
44
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$21.50

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.
ExamsWizard
4.1
(35)
Sold
150
Followers
12
Items
980
Last sold
18 hours 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