COMPLETE EXAM QUESTIONS AND VERIFIED ANSWERS |
2026–2027 LATEST UPDATE | GUARANTEED PASS | DETAILED
RATIONALES | FULL STUDY GUIDE | EXAM PREP | PRACTICE
TEST | CERTIFICATION PREPARATION
SECTION ONE — QUESTIONS 1–100
1. A program consists of which three basic instruction types?
A) Read, Write, Execute
B) Input, Process, Output
C) Define, Call, Return
D) Compile, Link, Run
Correct Answer: B) Input, Process, Output
Every program follows the IPO model: it takes input from sources like keyboard or files, processes that
data through computations and logic, and produces output to screen or files. This fundamental
framework applies across all programming paradigms. Options A, C, and D describe specific
operations or phases rather than the universal program structure.
2. What is a variable in Python?
A) A fixed value that cannot be changed
B) A named reference that holds a value in memory
C) A type of function
D) A reserved keyword
Correct Answer: B) A named reference that holds a value in memory
Variables are named containers that store references to objects in memory. They allow programmers
to label and manipulate data throughout a program. Unlike constants, variables can be reassigned.
Option A describes constants, while C and D confuse variables with other Python constructs.
3. Which data type would be most appropriate to store a person's age in years?
A) float
B) str
C) int
D) bool
Correct Answer: C) int
The int data type stores whole numbers without decimal points, making it ideal for countable
quantities like age. While float could technically hold a whole number, it introduces unnecessary
decimal precision. String would prevent mathematical operations, and bool only represents True or
False values.
4. What does the type() function return when called on a variable?
A) The value stored in the variable
B) The data type of the variable
, C) The memory address of the variable
D) The name of the variable
Correct Answer: B) The data type of the variable
The type() function is a built-in Python function that returns the class type of the object passed to it.
For example, type(42) returns int. This is useful for debugging and validating data. Options A, C, and
D describe other attributes that type() does not provide.
5. Which statement correctly creates a comment in Python?
A) // This is a comment
B) /* This is a comment */
C) # This is a comment
D) -- This is a comment
Correct Answer: C) # This is a comment
Python uses the hash symbol to denote single-line comments. Everything following the # on that line
is ignored by the interpreter. Multi-line comments can be created using triple quotes. Options A, B,
and D represent comment syntax from other languages like JavaScript, C, and SQL.
6. What is the output of the following code: print(10 // 3)?
A) 3.3333
B) 3
C) 4
D) 1
Correct Answer: B) 3
The // operator performs floor division, which divides two numbers and rounds down to the nearest
integer. In this case, 10 divided by 3 equals 3.333, which floors to 3. The single / operator would
return 3.3333 as a float, while the % operator would return the remainder of 1.
7. Which operator is used for exponentiation in Python?
A) ^
B) **
C) ^^
D) pow
**Correct Answer: B) **
The ** operator raises a number to a power. For example, 2 ** 3 evaluates to 8. The ^ operator
performs bitwise XOR, not exponentiation. Option D, pow, is a built-in function but not an operator,
and ^^ is not valid Python syntax.
8. What is the correct way to convert a string "25" to an integer?
A) int("25")
B) str(25)
C) float("25")
D) "25".to_int()
Correct Answer: A) int("25")
, The int() function converts a string containing digits into an integer value. This is essential when
processing user input, which is always received as a string. Option B converts to string, C converts to
float, and D is not valid Python syntax.
9. Which of the following is a valid variable name in Python?
A) 2nd_place
B) total-count
C) user_name
D) class
Correct Answer: C) user_name
Variable names must begin with a letter or underscore, can contain letters, numbers, and
underscores, and cannot be reserved keywords. Option A starts with a number, B contains a hyphen,
and D uses "class," which is a reserved keyword in Python.
10. What is the result of the expression 7 % 2?
A) 3.5
B) 3
C) 1
D) 0
Correct Answer: C) 1
The % operator returns the remainder of division. When 7 is divided by 2, the quotient is 3 with a
remainder of 1. This operator is commonly used to check divisibility or determine if a number is even
or odd. The // operator would return 3.
11. Which function is used to get input from the user in Python?
A) get()
B) read()
C) input()
D) scan()
Correct Answer: C) input()
The input() function reads a line of text entered by the user and returns it as a string. Any data
received through input() must be converted to the appropriate type if numeric operations are needed.
Options A, B, and D are functions from other languages or do not exist in Python.
12. What is the default data type returned by the input() function?
A) int
B) float
C) str
D) bool
Correct Answer: C) str
Regardless of what the user types, input() always returns a string. To use the input as a number,
explicit conversion with int() or float() is required. This design prevents type errors and gives
programmers control over data interpretation.
13. Which of the following correctly assigns the value 5 to a variable named count?
A) count == 5