Assessment | 100 Updated & Actual
Questions and 100% Correct Answers |
2026/2027
SECTION 1: Python Basics & Syntax (Q1–25)
1. Which symbol is used for comments in Python?
A. //
B. /* */
C. #
D. --
Answer: C
Explanation: Python uses # for single-line comments.
2. Which function outputs text to the console?
A. echo()
B. print()
C. output()
D. write()
Answer: B
Explanation: print() displays output in Python.
3. Which of the following is a valid variable name?
,A. 2value
B. my-value
C. my_value
D. class
Answer: C
Explanation: Variable names cannot start with numbers or be
keywords.
4. What is the output of the following code?
print(type(10))
A. int
B. integer
C. <class 'int'>
D. number
Answer: C
Explanation: Python displays data types using class notation.
5. Which data type stores text?
A. int
B. float
C. str
D. bool
Answer: C
6. What is the value of x after execution?
x=5
, x += 3
A. 5
B. 3
C. 8
D. Error
Answer: C
7. Which operator checks equality?
A. =
B. ==
C. !=
D. :=
Answer: B
8. What does input() return?
A. Integer
B. Float
C. String
D. Boolean
Answer: C
Explanation: input() always returns a string.
9. How do you convert a string to an integer?
A. integer(x)
B. int(x)
C. str(x)