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

Programming (Python) Oa 2026 Midterm Exam Complete (100) Current Testing Questions And Correct Answers

Document preview thumbnail
Preview 4 out of 34 pages

Programming (Python) Oa 2026 Midterm Exam Complete (100) Current Testing Questions And Correct Answers

Content preview

Page 1 of 34



PROGRAMMING (PYTHON) OA 2026
MIDTERM EXAM COMPLETE (100) CURRENT
TESTING QUESTIONS AND CORRECT
ANSWERS
Ace the WGU E010 Foundations of Programming (Python) OA midterm Exam
with practice questions covering variables, data types, input/output, arithmetic
operators, strings, lists, dictionaries, conditionals, loops, functions, and basic
debugging. This study guide helps reinforce foundational coding concepts and
supports effective preparation for objective assessments. Designed to improve
problem-solving skills and boost confidence in Python programming.
Suitable for computer science, IT, and programming students.



Multiple choice.

Section 1: Variables, Data Types & Type Conversion

1. Which of the following is a valid variable name in Python?
A) 2ndVariable
B) my-var
C) _myVar
D) my var
Answer: C. _myVar
Explanation: Variable names cannot start with a digit (A), cannot
contain hyphens (B) or spaces (D). Underscore is allowed, including
at the beginning.

, Page 2 of 34


2. What is the data type of 3.14?
A) int
B) float
C) str
D) bool
Answer: B. float
Explanation: Numeric values with a decimal point are of type float.
Integers are whole numbers without a decimal point.
3. What is the output of print(type())?
A) <class 'int'>
B) <class 'float'>
C) <class 'double'>
D) <class 'complex'>
Answer: B. <class 'float'>
Explanation: In Python, the / operator always returns a floating-point result,
even when the division is exact.
4. Which of the following will convert the string "123" to an integer?
A) int("123")
B) str("123")
C) float("123")
D) bool("123")
Answer: A. int("123")

, Page 3 of 34


Explanation: The int() function converts a string (or other numeric
type) to an integer. "123" contains only digits, so conversion is valid.
5. What is the result of bool([]) in Python?
A) True
B) False
C) None
D) Error
Answer: B. False
Explanation: Empty sequences (lists, strings, tuples) and the number 0
evaluate to False in a Boolean context. Non-empty sequences evaluate
to True.


‘’z Section 2: Arithmetic & Comparison Operators
6. What is the output of print(3 + 5 * 2)?
A) 16
B) 13
C) 10
D) 11
Answer: B. 13
Explanation: Multiplication has higher precedence than addition. First 5 * 2
= 10, then 3 + 10 = 13.
7. What does the % operator do in Python?
A) Percent

, Page 4 of 34


B) Modulus – returns the remainder of division
C) Division
D) Exponentiation
Answer: B. Modulus – returns the remainder of division Explanation:
The modulus operator % gives the remainder after integer division. Example:
10 % 3 returns 1.
8. Which operator is used for floor division?
A) /
B) //
C) %
D) **
Answer: B. //
Explanation: Floor division (//) divides and rounds down to the nearest
integer. 10 // 3 equals 3.
9. What is the output of print(5 ** 2)?
A) 10
B) 7
C) 25
D) 32
Answer: C. 25
Explanation: ** is the exponentiation operator. 5 raised to the power of 2
equals 25.
10. Which comparison operator means “not equal to”?

Document information

Uploaded on
November 6, 2026
Number of pages
34
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$22.89

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
12
Followers
0
Items
1125
Last sold
2 weeks 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