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 3 out of 29 pages
Exam (elaborations)

WGU E010 Objective Assessment Foundations of Programming (Python) Actual Questions with Answers| Latest Update| Guaranteed Pass

Document preview thumbnail
Preview 3 out of 29 pages

covers foundational Python programming concepts including operators, data types, variables, conditionals, loops, lists, tuples, dictionaries, strings, functions, exceptions, file handling, classes, object-oriented programming, modules, Boolean logic, and list operations. It contains Actual exam questions with answers and rationales, including code-output questions and core Python syntax and programming concepts.

Content preview

WGU E010 Objective Assessment
Foundations of Programming (Python)
Actual Questions with Answers| Latest Update| Guaranteed Pass

,1. What is the output of the following code?

x = 5
y = 2
print(x // y)
A. 2.5
B. 2
C. 3
D. 2.0
Answer: B
Rationale: The // operator performs floor (integer) division, which divides and
rounds down to the nearest whole number. 5 // 2 equals 2, discarding the
remainder. The / operator would return 2.5 (true division).



2. Which data type is immutable in Python?
A. list
B. dictionary
C. tuple
D. set
Answer: C
Rationale: Tuples are immutable, meaning their contents cannot be changed
after creation. Lists, dictionaries, and sets are all mutable and can be modified
in place after creation.



3. What will the following code print?

fruits = ['apple', 'banana', 'cherry']
print(fruits[-1])
A. apple
B. banana
C. cherry

, D. IndexError
Answer: C
Rationale: Negative indexing counts from the end of the list, where -1 refers to
the last element. fruits[-1] returns 'cherry', the last item in the list.



4. Which keyword is used to define a function in Python?
A. function
B. def
C. func
D. define
Answer: B
Rationale: The 'def' keyword is used to define a function in Python, followed by
the function name, parentheses for parameters, and a colon, e.g., def
my_function():.



5. What is the result of the expression 3 ** 2 in Python?
A. 6
B. 9
C. 5
D. 1
Answer: B
Rationale: The ** operator represents exponentiation. 3 ** 2 means 3 raised to
the power of 2, which equals 9.



6. What is the correct way to create a comment in Python?
A. // This is a comment
B. /* This is a comment */
C. # This is a comment
D.

Document information

Uploaded on
August 20, 2026
Number of pages
29
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$12.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.
KelvinBrooks
4.3
(96)
Sold
864
Followers
11
Items
5892
Last sold
4 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