FULLY SOLVED 2026/2027 | Very Similar to OA | Western
Governors University | Pass Guaranteed - A+ Graded
Section 1: Variables, Data Types, Type Conversion & Input/Output
(Questions 1-12)
Question 1
Consider the following Python code:
PythonCopy
x = 42
y = "42"
z = 42.0
w = True
Which statement correctly identifies the data types of x, y, z, and w respectively?
A. str, int, float, bool
B. int, str, float, bool
C. int, str, int, int
D. float, str, float, str
Correct Answer: B
Rationale: x = 42 is an integer (int), y = "42" is a string (str), z = 42.0 is a
floating-point number (float), and w = True is a boolean (bool). Option A reverses x
,and y; Option C incorrectly types z as int and w as int; Option D incorrectly types x as
float and w as str.
Question 2
What is the output of the following Python code?
PythonCopy
a = 5
b = 2
result = a / b
print(type(result))
A. <class 'int'>
B. <class 'float'>
C. <class 'str'>
D. <class 'bool'>
Correct Answer: B
Rationale: In Python 3, the / operator always performs true division and returns a
float, even when dividing two integers. evaluates to 2.5, which is a float.
Option A is incorrect because / never returns int in Python 3 (use // for floor division);
Option C and D are incorrect as the result is numeric, not str or bool.
Question 3
What is the output of the following Python code?
PythonCopy
num = "100"
result = int(num) + 50
,print(result)
A. "10050"
B. 150
C. TypeError
D. "150"
Correct Answer: B
Rationale: int(num) explicitly casts the string "100" to the integer 100, then adds 50
to produce 150 (an integer). Option A would result from string concatenation (num +
"50"); Option C is incorrect because int() successfully converts the numeric string;
Option D is incorrect because the result is an integer, not a string.
Question 4
What is the output of the following Python code?
PythonCopy
value = input("Enter a number: ")
# User enters: 25
result = value * 3
print(result)
A. 75
B. 252525
C. TypeError
D. "75"
Correct Answer: B
Rationale: input() always returns a string. When the user enters 25, value becomes
"25". The * operator on a string performs repetition, so "25" * 3 produces
, "252525". Option A would require int(value) * 3; Option C is incorrect because
string repetition is valid; Option D incorrectly shows the result as a numeric string.
Question 5
What is the output of the following Python code?
PythonCopy
print(10 + 5.5)
A. 15
B. 15.5
C. TypeError
D. "10 + 5.5"
Correct Answer: B
Rationale: When an int and a float are combined with +, Python performs implicit
type conversion (the int is promoted to float), resulting in 15.5 (a float). Option A
is incorrect because the decimal is preserved; Option C is incorrect because Python
allows mixed numeric arithmetic; Option D is incorrect because the expression is
evaluated, not printed as a string.
Question 6
What is the output of the following Python code?
PythonCopy
x = "3.14"
y = float(x)
z = int(y)
print(z)