2026 UPDATED OA
Complete Practice Questions 1-200
SECTION 1: PYTHON BASICS & SYNTAX (Questions 1-30)
QUESTION 1
What is the correct way to print "Hello World" in Python?
A. print("Hello World")
B. printf("Hello World")
C. echo "Hello World"
D. console.log("Hello World")
Correct Answer: A. print("Hello World")
*Rationale: * In Python, print() is the built-in function used to output text to the
console. printf() is used in C, echo is used in PHP and shell scripting,
and console.log() is used in JavaScript.
QUESTION 2
Which of the following is a valid variable name in Python?
A. 2nd_number
B. my_var
,C. my-var
D. class
Correct Answer: B. my_var
*Rationale: * Python variable names must start with a letter or underscore, followed by
letters, numbers, or underscores. They cannot start with a number (A), cannot contain
hyphens (C), and cannot be Python reserved keywords such as class (D).
QUESTION 3
What data type is the value 3.14 in Python?
A. int
B. float
C. str
D. bool
Correct Answer: B. float
*Rationale: * In Python, numbers with decimal points are float data types. Integers
have no decimal point. 3.14 is a float.
QUESTION 4
Which operator is used to concatenate strings in Python?
A. +
B. *
,C. &
D. |
*Correct Answer: A. +
*Rationale: * The + operator is used to concatenate (join) strings together in Python. For
example, "Hello " + "World" results in "Hello World".
QUESTION 5
What is the result of 5 // 2 in Python?
A. 2.5
B. 2
C. 3
D. 2.0
*Correct Answer: B. 2
*Rationale: * The // operator performs floor division, which returns the integer
quotient, discarding the remainder. 5 // 2 = 2.
QUESTION 6
What is the result of 5 % 2 in Python?
A. 1
B. 2
, C. 2.5
D. 0
*Correct Answer: A. 1
*Rationale: * The % operator returns the remainder of a division operation. 5 % 2 = 1
because 5 divided by 2 equals 2 with a remainder of 1.
QUESTION 7
Which of the following is the correct way to comment multiple lines in Python?
A. /* This is a comment */
B. // This is a comment
C. # This is a comment
D. """ This is a comment """
*Correct Answer: D. """ This is a comment """
*Rationale: * In Python, single-line comments use #. Multi-line comments can be
created using triple quotes """ or '''. Options A and B are used in other programming
languages like C and JavaScript.
QUESTION 8
What is the output of type(True) in Python?
A. <class 'int'>
B. <class 'bool'>