Getting Started with Python
Class 11 Computer Science — Chapter 5
Most Important & Frequently Repeated MCQs, with Answers and Explanations
This set covers the core exam-relevant concepts of Chapter 5: Python overview, interactive vs. script mode,
keywords and identifiers, variables and data types, operators and expressions, comments, input/output
functions, type conversion, and errors & debugging. Each question includes the correct answer and a short
explanation for quick revision.
1. Python Basics: Interpreter, Compiler & Modes of Working
Q1. Python is best described as a:
A) A low-level assembly language
B) High-level, general-purpose, interpreted programming language
C) Markup language used only for web pages
D) Hardware description language
Correct Answer: B) High-level, general-purpose, interpreted programming language
Why: Python is a high-level, general-purpose language whose code is generally executed line-by-line by an
interpreter, making it easier to read, write, and debug than low-level languages.
Q2. Which of the following converts source code into machine code one instruction at a
time, immediately executing each line?
A) Compiler
B) Interpreter
C) Assembler
D) Linker
Correct Answer: B) Interpreter
Why: An interpreter translates and executes code line by line, unlike a compiler which translates the entire
program at once before execution.
Q3. Which mode of working in Python allows you to type a statement and see its result
immediately, without saving it to a file?
A) Script mode
B) Interactive mode
C) Batch mode
D) Compiled mode
Correct Answer: B) Interactive mode
Why: In interactive mode (the >>> prompt in IDLE's shell), each statement is executed and its result shown
instantly, but nothing is saved automatically.
Q4. A Python program saved with a .py extension and executed all at once is run in:
A) Interactive mode
B) Script mode
C) Debug mode
D) Shell mode
Correct Answer: B) Script mode
Why: Script mode involves writing a full program in a file (with a .py extension) and running the entire file at
once, which is useful for reusable programs.
Q5. Which of these is the default Integrated Development Environment (IDE) that comes
bundled with Python?
A) PyCharm
B) IDLE
C) Jupyter
D) Eclipse
Correct Answer: B) IDLE
Why: IDLE (Integrated Development and Learning Environment) is installed automatically with Python and
supports both interactive and script modes.
2. Keywords & Identifiers
Q6. Which of the following is a Python keyword?
A) value
B) Total
C) while
D) num1
Correct Answer: C) while
Why: 'while' is a reserved keyword used to start a loop; keywords cannot be used as identifier names.
Q7. Which of the following is an invalid Python identifier?
A) _marks
B) totalMarks
C) 2ndYear
D) roll_no
Correct Answer: C) 2ndYear
Why: An identifier cannot begin with a digit. '2ndYear' starts with '2', making it invalid; identifiers must start with
a letter or underscore.
Q8. Which statement about Python identifiers is correct?
A) They can contain spaces
B) They are case-sensitive
C) They can start with a digit
D) They can be the same as a keyword
Correct Answer: B) They are case-sensitive
Why: Python identifiers are case-sensitive, so 'Marks' and 'marks' are treated as two different names. Identifiers
cannot contain spaces, start with digits, or match reserved keywords.
Q9. How many total lowercase Python keywords are there approximately in Python 3 (as
commonly taught at this level)?
A) About 10
B) About 35
C) About 100
D) About 500
Correct Answer: B) About 35
Why: Python 3 has around 33–35 reserved keywords such as if, else, for, while, def, class, True, False, None,
etc., taught as a fixed list at this level.
Q10. Which of the following is NOT a valid Python identifier?
A) Total_Marks
B) _Percentage
C) Hundred$
D) average1
Correct Answer: C) Hundred$
Why: Identifiers cannot include special characters like $. Only letters, digits, and underscores are allowed, and
the name must not start with a digit.
3. Variables, Values & Data Types
Q11. In Python, a variable is best defined as:
A) A fixed value that never changes
B) A named location in memory used to store a value
C) A type of loop
D) A built-in function
Correct Answer: B) A named location in memory used to store a value
Why: A variable is simply a name bound to a value stored in memory; in Python it is created the moment a
value is first assigned to it.
Q12. Which of the following is an immutable data type in Python?
A) List
B) Dictionary
C) Tuple
D) Set
Correct Answer: C) Tuple
Why: Tuples are immutable, meaning their contents cannot be changed after creation. Lists, dictionaries, and
sets are mutable.
Q13. What will be the data type of the value produced by: x = 10 / 2 ?
A) int
B) float
C) str
D) bool
Correct Answer: B) float
Why: The single division operator '/' always returns a float in Python 3, even when the division is exact (10 / 2
gives 5.0).
Q14. Which data type would Python assign to the variable created by: flag = True ?
A) int
B) str
C) bool
D) float
Correct Answer: C) bool
Why: True and False are values of the Boolean (bool) data type in Python.
Q15. Which of the following pairs correctly matches a value with its Python data type?
A) '25' → int
B) 25.0 → float
C) 25 → str
D) (25) → tuple
Correct Answer: B) 25.0 → float
Why: 25.0 has a decimal point, so Python treats it as a float. '25' in quotes is a string, and a single value in plain
parentheses like (25) is just an int, not a tuple (a trailing comma is needed for a one-element tuple).
Q16. Which of these data types is mutable?
A) int
B) str
C) tuple
D) list
Correct Answer: D) list
Why: Lists are mutable — their elements can be changed, added, or removed after creation, unlike int, str, and
tuple which are immutable.
4. Operators & Expressions
Q17. Which operator is used to perform exponentiation (raising a number to a power) in
Python?
A) ^
B) **
C) //
D) %
Correct Answer: B) **
Why: The double asterisk '**' is Python's exponentiation operator; for example, 2 ** 3 evaluates to 8.
Q18. What is the result of the expression 17 // 4 in Python?
A) 4.25
B) 4
C) 1
D) 5
Correct Answer: B) 4
Why: The '//' operator performs floor (integer) division, discarding the decimal part, so 17 // 4 evaluates to 4.
Q19. What does the expression 17 % 4 evaluate to?
A) 4
B) 1
C) 4.25
D) 0
Correct Answer: B) 1
Why: The modulus operator '%' returns the remainder of division; 17 divided by 4 leaves a remainder of 1.
Q20. Which of the following is a relational (comparison) operator in Python?
A) =
B) ==
C) +=
D) and
Correct Answer: B) ==
Why: '==' checks whether two values are equal and returns True or False, making it a relational operator. A
single '=' is assignment, not comparison.
Q21. Which logical operator returns True only if both operands are True?
A) or
B) not
C) and
D) xor
Correct Answer: C) and
Why: The 'and' operator evaluates to True only when both the operands on either side are True; Python has no
built-in 'xor' keyword operator.
Q22. What is the correct order of evaluation (highest to lowest precedence) among these
operators?
A) + , ** , *
B) ** , * , +
C) * , + , **
D) + , * , **
Correct Answer: B) ** , * , +
Why: In Python, exponentiation (**) has the highest precedence among these, followed by multiplication (*), and
then addition (+).
Q23. What will be the value of x after: x = 5 + 3 * 2 ?
A) 16
B) 11
C) 13
D) 10
Correct Answer: B) 11
Why: Following operator precedence, multiplication is evaluated before addition: 3 * 2 = 6, then 5 + 6 = 11.
5. Comments, Input/Output & Type Conversion
Q24. Which symbol is used to write a single-line comment in Python?
A) //
B) #
C) /*
D) --
Correct Answer: B) #
Why: The hash symbol '#' marks the start of a single-line comment; everything after it on that line is ignored by
the interpreter.
Q25. Which built-in function is used to display output on the screen in Python?
A) input()
B) print()
C) display()
D) echo()
Correct Answer: B) print()
Why: The print() function outputs text or values to the console/screen.
Q26. What data type does the input() function always return, before any conversion?
A) int
B) float
C) str
D) bool
Correct Answer: C) str
Why: input() always reads what the user types as a string, regardless of whether the user enters numbers or
text; explicit conversion is needed to treat it as a number.
Q27. Which function would you use to convert a string like '25' into an integer?
A) str()
B) float()
C) int()
D) input()
Correct Answer: C) int()
Why: The int() function explicitly converts a valid numeric string (or float) into an integer, e.g. int('25') gives 25.
Q28. What is the term for a data type conversion that Python performs automatically,
without the programmer writing any conversion function?
A) Explicit conversion
B) Type casting
C) Implicit conversion
D) Manual conversion
Correct Answer: C) Implicit conversion
Why: Implicit type conversion happens automatically, such as when Python converts an int to a float during a
mixed arithmetic operation, without the programmer calling a conversion function.
Q29. What will be the output of: print(int('7') + 3) ?
A) '73'
B) 10
C) Error
D) 7.3
Correct Answer: B) 10
Why: int('7') explicitly converts the string '7' to the integer 7, so 7 + 3 correctly evaluates to 10.
6. Errors & Debugging
Q30. What is 'debugging' in the context of programming?
A) Writing comments in code
B) The process of finding and fixing errors (bugs) in a program
C) Compiling a program into machine code
D) Deleting unused variables
Correct Answer: B) The process of finding and fixing errors (bugs) in a program
Why: Debugging is the systematic process of locating and correcting mistakes, or 'bugs', in a program so that it
runs correctly.
Q31. An error caused by violating the grammar/rules of the Python language, such as a
missing colon, is called a:
A) Runtime error
B) Logical error
C) Syntax error
D) Semantic error
Correct Answer: C) Syntax error
Why: A syntax error occurs when code does not follow the correct rules of the language, such as forgetting a
colon after an if statement; it is detected before the program runs.
Q32. An error that occurs while the program is running, such as dividing a number by zero,
is called a:
A) Syntax error
B) Runtime error
C) Indentation error
D) Compilation error
Correct Answer: B) Runtime error
Why: A runtime error occurs during program execution, even though the code is syntactically correct — for
example, attempting to divide by zero.
Q33. A program that runs without any error message but produces an incorrect result has a:
A) Syntax error
B) Runtime error
C) Logical error
D) Import error
Correct Answer: C) Logical error
Why: A logical error does not stop the program from running or throw an error message, but causes incorrect
output because the underlying logic is flawed.
Total Questions: 33 | Prepared for CBSE Class 11 Computer Science, Chapter 5: Getting Started with Python