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

WGU E010 Foundations of Programming (Python) – 2026 UPDATED OA | 100 Questions & Answers | GUARANTEED PASS Study Guide.

Document preview thumbnail
Preview 4 out of 68 pages

WGU E010 Foundations of Programming (Python) – 2026 UPDATED OA | 100 Questions & Answers | GUARANTEED PASS Study Guide.

Content preview

1



WGU E010 Foundations of Programming
(Python) – 2026 UPDATED OA | 100 Questions
& Answers | GUARANTEED PASS Study Guide.


100-Question Practice Exam

1. Which of the following best describes Python?
A. A compiled language that requires a separate build step
B. An interpreted, high-level, general-purpose programming language
C. A low-level assembly language used for system programming
D. A markup language used for structuring web pages

Answer: B. An interpreted, high-level, general-purpose programming language
Rationale: Python is an interpreted language, meaning code is executed line-by-line without a separate
compilation step. It is high-level (abstracting away hardware details) and general-purpose (suitable for
many applications like web development, data science, and automation).



2. What is the primary purpose of a variable in Python?
A. To store a value in memory for later use
B. To define a new function
C. To create a loop structure
D. To import external modules

Answer: A. To store a value in memory for later use
Rationale: Variables act as named containers that hold data. You can assign a value to a variable and
then refer to it by name throughout your code, allowing you to store, retrieve, and manipulate data
efficiently.



3. Which of the following is a valid variable name in Python?
A. 2nd_place
B. my-variable
C. _private_var
D. class

Answer: C. _private_var
Rationale: Variable names can start with a letter or underscore (_), followed by letters, numbers, or

,2


underscores. They cannot start with a number (A), contain hyphens (B), or be reserved keywords
like class (D).



4. What will be the output of the following code?

python

x=5

y=2

print(x // y)

A. 2.5
B. 2
C. 1
D. 10

Answer: B. 2
Rationale: The // operator performs floor division (integer division), which returns the whole number
quotient without the remainder. 5 divided by 2 is 2.5, and the floor division result is 2.



5. What will be the output of the following code?

python

print(2 ** 3)

A. 5
B. 6
C. 8
D. 9

Answer: C. 8
*Rationale: The ** operator is the exponentiation operator. 2 ** 3 means 2 raised to the power of 3,
which is 2 × 2 × 2 = 8.*



6. What is the correct way to get input from a user and store it as a string?
A. input()
B. get_input()
C. read_line()
D. scan()

Answer: A. input()
Rationale: The built-in input() function reads a line of text from the user and returns it as a string. You
can optionally include a prompt string, e.g., name = input("Enter your name: ").

,3




7. What will be the data type of the variable age after this code runs?

python

age = input("Enter your age: ")

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

Answer: C. str
Rationale: The input() function always returns a string, regardless of what the user types. If you need to
perform mathematical operations on the input, you must explicitly convert it using int() or float().



8. Which function converts a string to an integer?
A. str()
B. float()
C. int()
D. bool()

Answer: C. int()
Rationale: The int() function converts a compatible string or number to an integer. For
example, int("42") returns the integer 42.



9. What is the purpose of a comment in Python code?
A. To execute additional instructions
B. To make the code run faster
C. To explain the code and improve readability for humans
D. To define a new variable

Answer: C. To explain the code and improve readability for humans
Rationale: Comments are notes written for programmers. They are ignored by the Python interpreter and
have no effect on program execution. They help document the purpose of code, explain complex logic,
and make collaboration easier.



10. Which symbol is used for single-line comments in Python?
A. //
B. /* */
C. #
D. --

, 4


Answer: C. #
Rationale: Any text following the # symbol on the same line is treated as a comment and ignored by the
interpreter. For multi-line comments, you can use triple quotes (""" or ''').



11. What will be the output of the following code?

python

print(type(3.14))

A. <class 'int'>
B. <class 'float'>
C. <class 'str'>
D. <class 'bool'>

Answer: B. <class 'float'>
*Rationale: The number 3.14 contains a decimal point, making it a floating-point number (float).
The type() function returns the data type of the given value.*



12. Which of the following is a Boolean value?
A. "True"
B. 1
C. True
D. "False"

Answer: C. True
Rationale: Boolean values are True and False (capitalized, without quotes). They represent logical truth
values. "True" is a string, and 1 is an integer.



13. What is the result of the expression 10 % 3?
A. 3
B. 1
C. 3.33
D. 0

Answer: B. 1
Rationale: The modulo operator (%) returns the remainder of a division. 10 divided by 3 is 3 with a
remainder of 1.



14. What will be the output of the following code?

python

Document information

Uploaded on
April 14, 2026
Number of pages
68
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$23.49

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.
NursingTotur2
3.3
(87)
Sold
606
Followers
39
Items
6259
Last sold
13 hours ago


Reviews from verified buyers

1 month ago

Thank you so much for the rating! I truly appreciate your support and feedback — it means a lot. If you’d like to see more high-quality nursing resources and updates, feel free to follow Nursing Tutor 2 here: https://www.stuvia.com/user/NursingTotur2 Thanks again, and wishing you all the best in your studies!

Thank you so much for the rating! I truly appreciate your support and feedback — it means a lot. If you’d like to see more high-quality nursing resources and updates, feel free to follow Nursing Tutor 2 here: https://www.stuvia.com/user/NursingTotur2 Thanks again, and wishing you all the best in your studies!




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