Getting Started with Python — Full Practice Set
Class 11 Computer Science — Chapter 5
Complete Topic-wise MCQ Bank for Chapter Test Preparation (Answers at the end)
This practice set contains 52 MCQs covering every topic of Chapter 5 as per the NCERT textbook — Python
overview and features, modes of working, keywords, identifiers, literals (numeric, string, boolean, None, and
literal collections), operators and punctuators, variables and data types, mutable/immutable types,
arithmetic/relational/logical/assignment operators, expressions and statements, comments and indentation,
input/output functions, type conversion, and errors & debugging. Each topic has at least 3 questions.
Answers and explanations are provided together at the end of this document.
1. Introduction to Python & Its Features
Q1. Who is credited with the creation of the Python programming language?
A) Dennis Ritchie
B) Guido van Rossum
C) James Gosling
D) Bjarne Stroustrup
Q2. Which of the following is NOT a feature of Python?
A) It is free and open source
B) It is simple and easy to learn
C) It works only on the Windows operating system
D) It is an interpreted language
Q3. Python is described as a case-sensitive language because:
A) It requires a semicolon at the end of every line
B) 'Total' and 'total' are treated as two different identifiers
C) It only accepts uppercase letters
D) It ignores the case of variable names
2. Modes of Working in Python
Q4. Which mode of working is best suited for a program that needs to be saved and run
multiple times?
A) Interactive mode
B) Script mode
C) Debug mode
D) Command mode
Q5. In IDLE, which function key is commonly used to run a program written in script mode?
A) F2
B) F5
C) F9
D) F12
Q6. A key limitation of the interactive mode is that:
A) It cannot perform arithmetic calculations
B) The statements typed cannot be saved for future use
C) It requires a working internet connection
D) It can only display text, not numbers
3. Keywords
Q7. Which of the following is a Python keyword used to define a function?
A) func
B) define
C) def
D) function
Q8. Which of the following is NOT a Python keyword?
A) import
B) return
C) result
D) elif
Q9. Which of these words is a valid Python keyword?
A) total
B) None
C) marks1
D) value
Q10. Keywords in Python are written in lowercase, except for:
A) print and input
B) True, False, and None
C) def and class
D) import and from
4. Identifiers
Q11. Which of the following is a valid Python identifier?
A) 3rd_sem
B) class
C) _average
D) total-marks
Q12. Which of the following rules about Python identifiers is TRUE?
A) Identifiers can start with a digit if followed by letters
B) Identifiers can contain the underscore character
C) Identifiers can include the '@' symbol
D) Identifiers can be the same as a keyword
Q13. Which of the following is an invalid identifier because it matches a reserved keyword?
A) True
B) true
C) TRUE
D) truevalue
Q14. Are 'Marks' and 'marks' treated as the same identifier in Python?
A) Yes, always the same
B) No, they are different because Python is case-sensitive
C) Yes, but only inside functions
D) No, because one of them is a string
5. Literals: Numeric and String
Q15. Which of the following represents an integer literal written in octal form?
A) 0o14
B) 14.0
C) "14"
D) 0x14
Q16. Which of the following is a floating-point literal written in exponent form?
A) 25
B) 0.125E25
C) "25.0"
D) 25j
Q17. A string enclosed in triple quotes (''' ''' or """ """) is generally used to represent:
A) A numeric literal
B) A multi-line string
C) A boolean value
D) A keyword
Q18. Which of the following is a validly written string literal in Python?
A) 'Computer Science
B) "Computer Science"
C) Computer Science
D) #Computer Science
6. Literals: Boolean, None & Literal Collections
Q19. Which literal in Python represents the absence of a value?
A) Zero
B) Empty
C) None
D) Null
Q20. How many values can a Boolean literal take in Python?
A) One
B) Two — True and False
C) Three
D) An unlimited number
Q21. Which of the following is an example of a literal collection in Python?
A) 25
B) "Hello"
C) [1, 2, 3]
D) True
7. Operators & Punctuators (Tokens)
Q22. Which of the following is classified as a punctuator in Python?
A) +
B) and
C) : (colon)
D) 25
Q23. The basic lexical building blocks of a Python program — such as keywords, identifiers,
literals, operators, and punctuators — are collectively known as:
A) Statements
B) Tokens
C) Expressions
D) Functions
Q24. Which pair of symbols is used as punctuators to enclose the elements of a list?
A) ( )
B) { }
C) [ ]
D) < >
8. Variables & Data Types
Q25. In Python, a variable is created:
A) By declaring its type before assignment
B) The moment a value is assigned to it
C) Only inside a function
D) Only when using the keyword var
Q26. What is the data type of the value 3.14 in Python?
A) int
B) float
C) complex
D) str
Q27. Which of the following data types is used to store a whole number without any decimal
part?
A) float
B) int
C) complex
D) bool
Q28. Which of the following is a correctly written Python assignment statement?
A) 5 = num
B) num = 5
C) num == 5
D) num =: 5
9. Mutable & Immutable Data Types
Q29. Which of the following data types is immutable in Python?
A) List
B) Dictionary
C) String
D) Set
Q30. A mutable data type is one whose:
A) Value cannot be changed once created
B) Value can be changed after creation
C) Value must always be numeric
D) Value must be declared using 'const'
Q31. Which of the following collection types allows its individual elements to be modified after
creation?
A) Tuple
B) String
C) List
D) None of these can be modified
10. Arithmetic Operators
Q32. What is the result of the expression 15 % 4 in Python?
A) 3
B) 3.75
C) 4
D) 1
Q33. Which operator is used to obtain the quotient of a division while discarding the
remainder?
A) /
B) //
C) %
D) **
Q34. What is the result of the expression 2 ** 4?
A) 8
B) 16
C) 6
D) 4
11. Relational, Logical & Assignment Operators
Q35. Which operator is used to check whether two values are NOT equal in Python?
A) =
B) ==
C) !=
D) <>
Q36. What will the expression '10 > 5 and 3 > 7' evaluate to?
A) True
B) False
C) Error
D) None
Q37. Which of the following is a compound (shorthand) assignment operator in Python?
A) =
B) ==
C) +=
D) is
Q38. The logical operator 'or' returns True when:
A) Both operands are True
B) Both operands are False
C) At least one operand is True
D) Neither operand has a value
12. Expressions & Statements
Q39. An expression in Python is best described as:
A) A complete program
B) A combination of operators and operands that produces a value
C) A comment explaining the code
D) A syntax error message
Q40. Which of the following best distinguishes a 'statement' from an 'expression' in Python?
A) A statement always produces a value while an expression does not
B) Every expression can be used as a statement, but not every statement is an expression
C) Statements and expressions mean exactly the same thing
D) Only expressions can be executed by the interpreter
Q41. Which of the following is an example of an assignment statement?
A) 8 * 2
B) result = 8 * 2
C) print(8 * 2)
D) 8 == 2
13. Comments & Indentation
Q42. Which symbol is used to begin a single-line comment in Python?
A) //
B) **
C) #
D) --
Q43. Python uses indentation primarily to:
A) Make the code look visually appealing
B) Define and separate blocks of code
C) Speed up program execution
D) Add comments to the code
Q44. What is likely to happen if the indentation within a Python code block is inconsistent?
A) Python automatically corrects it
B) Python raises an indentation error
C) Python ignores indentation completely
D) The program runs faster
14. Input and Output Functions
Q45. Which function is used to accept input from the user during program execution?
A) get()
B) input()
C) read()
D) accept()
Q46. What is the data type of the value returned by input(), before any explicit conversion is
applied?
A) int
B) float
C) str
D) bool
Q47. Which built-in function can evaluate a string as a Python expression and return its result?
A) input()
B) eval()
C) type()
D) str()
Q48. Which function is used to display output on the screen?
A) show()
B) print()
C) output()
D) display()
15. Type Conversion, Errors & Debugging
Q49. Converting the string "10" into an integer using int("10") is an example of:
A) Implicit type conversion
B) Explicit type conversion
C) A syntax error
D) A runtime error
Q50. Which type of error occurs due to a violation of the grammar or rules of the Python
language?
A) Logical error
B) Runtime error
C) Syntax error
D) Value error
Q51. A program that runs without crashing but produces the wrong output most likely
contains a:
A) Syntax error
B) Logical error
C) Indentation error
D) Import error
Q52. The process of identifying and correcting errors in a program is known as:
A) Compiling
B) Debugging
C) Interpreting
D) Formatting
Answer Key & Explanations
1. Introduction to Python & Its Features
Q1. Answer: B) Guido van Rossum — Python was created by Guido van Rossum and first released in 1991.
Q2. Answer: C) It works only on the Windows operating system — Python is portable and
platform-independent; it can run on Windows, Linux, macOS, and more, not just one OS.
Q3. Answer: B) 'Total' and 'total' are treated as two different identifiers — Python distinguishes between
uppercase and lowercase letters, so identifiers differing only in case are considered different.
2. Modes of Working in Python
Q4. Answer: B) Script mode — Script mode allows a program to be written in a .py file, saved, and executed
repeatedly without retyping it.
Q5. Answer: B) F5 — Pressing F5 (or Run > Run Module) executes the currently open script in IDLE.
Q6. Answer: B) The statements typed cannot be saved for future use — Interactive mode executes
statements immediately but does not save them, so they must be retyped to run again later.
3. Keywords
Q7. Answer: C) def — 'def' is the reserved keyword used to begin a function definition in Python.
Q8. Answer: C) result — 'result' is a commonly used variable name, not a reserved keyword. import, return,
and elif are all keywords.
Q9. Answer: B) None — 'None' is a reserved keyword representing the absence of a value; the others are
ordinary identifier names.
Q10. Answer: B) True, False, and None — True, False, and None are the only Python keywords that begin
with an uppercase letter.
4. Identifiers
Q11. Answer: C) _average — '_average' correctly starts with an underscore. '3rd_sem' starts with a digit,
'class' is a keyword, and 'total-marks' contains a hyphen, which is not allowed.
Q12. Answer: B) Identifiers can contain the underscore character — Underscores are allowed anywhere
in an identifier, including at the start. Digits, keywords, and special symbols like '@' are restricted or
disallowed.
Q13. Answer: A) True — 'True' exactly matches the reserved keyword, so it cannot be used as an identifier;
the others differ in case or spelling and are valid.
Q14. Answer: B) No, they are different because Python is case-sensitive — Because Python is
case-sensitive, identifiers that differ only in capitalisation are treated as completely separate names.
5. Literals: Numeric and String
Q15. Answer: A) 0o14 — Octal integer literals in Python are written with a '0o' prefix; '0x14' would instead
represent a hexadecimal literal.
Q16. Answer: B) 0.125E25 — A number followed by E or e and an exponent value, such as 0.125E25,
represents a floating-point literal in exponent (scientific) form.
Q17. Answer: B) A multi-line string — Triple-quoted strings allow text to span multiple lines and are
commonly used for multi-line strings or docstrings.
Q18. Answer: B) "Computer Science" — A string literal must be enclosed in a matching pair of quotes;
"Computer Science" is correctly opened and closed with double quotes.
6. Literals: Boolean, None & Literal Collections
Q19. Answer: C) None — 'None' is Python's special literal used to indicate that a variable has no value or that
something has not yet been created.
Q20. Answer: B) Two — True and False — Boolean literals in Python can only be True or False.
Q21. Answer: C) [1, 2, 3] — A list such as [1, 2, 3] is a literal collection — a group of values written directly in
the code. 25, "Hello", and True are single literals, not collections.
7. Operators & Punctuators (Tokens)
Q22. Answer: C) : (colon) — Punctuators are symbols used to structure code, such as the colon used before
an indented block. '+' is an operator, 'and' is a keyword, and 25 is a literal.
Q23. Answer: B) Tokens — Tokens are the smallest individual units of a Python program that the interpreter
recognises and processes.
Q24. Answer: C) [ ] — Square brackets [ ] are the punctuators used to enclose the elements of a Python list.
8. Variables & Data Types
Q25. Answer: B) The moment a value is assigned to it — Unlike some other languages, Python does not
require an explicit type declaration — a variable comes into existence as soon as a value is assigned to it.
Q26. Answer: B) float — Since 3.14 has a decimal point, Python classifies it as a floating-point (float) value.
Q27. Answer: B) int — The int data type is used for whole numbers, whether positive, negative, or zero.
Q28. Answer: B) num = 5 — In an assignment statement, the variable name is written on the left of '=' and the
value on the right, as in num = 5.
9. Mutable & Immutable Data Types
Q29. Answer: C) String — Strings cannot be changed once created — any operation that appears to modify a
string actually creates a new string object. Lists, dictionaries, and sets are all mutable.
Q30. Answer: B) Value can be changed after creation — Mutable data types, such as lists, allow their
contents to be changed after the object has been created.
Q31. Answer: C) List — Lists are mutable, so individual elements can be changed, added, or removed after
the list is created, unlike tuples and strings.
10. Arithmetic Operators
Q32. Answer: A) 3 — The modulus operator '%' returns the remainder of division; dividing 15 by 4 leaves a
remainder of 3.
Q33. Answer: B) // — The floor division operator '//' returns the integer quotient, discarding any remainder.
Q34. Answer: B) 16 — The '**' operator performs exponentiation, so 2 raised to the power 4 equals 16.
11. Relational, Logical & Assignment Operators
Q35. Answer: C) != — The '!=' operator checks for inequality between two values and returns True if they are
not equal.
Q36. Answer: B) False — The 'and' operator requires both conditions to be True. Since '3 > 7' is False, the
overall expression evaluates to False.
Q37. Answer: C) += — '+=' is a compound assignment operator that adds a value to a variable and reassigns
the result to it, e.g. x += 1.
Q38. Answer: C) At least one operand is True — The 'or' operator evaluates to True as long as at least one
of its operands is True.
12. Expressions & Statements
Q39. Answer: B) A combination of operators and operands that produces a value — An expression
combines values, variables, and operators, and evaluates to produce a single value.
Q40. Answer: B) Every expression can be used as a statement, but not every statement is an
expression — An expression evaluates to a value and can stand alone as a statement, but many statements
(like assignment or import statements) are not themselves expressions.
Q41. Answer: B) result = 8 * 2 — An assignment statement stores the result of an expression into a variable
using the '=' operator, as in result = 8 * 2.
13. Comments & Indentation
Q42. Answer: C) # — The hash symbol '#' marks the beginning of a comment; the interpreter ignores
everything after it on that line.
Q43. Answer: B) Define and separate blocks of code — Unlike many languages that use braces, Python
relies on consistent indentation to define which statements belong to a particular block.
Q44. Answer: B) Python raises an indentation error — Inconsistent indentation (such as mixing different
spacing) confuses the interpreter about block structure and results in an indentation error.
14. Input and Output Functions
Q45. Answer: B) input() — The input() function pauses the program and waits for the user to type a value,
which is then returned to the program.
Q46. Answer: C) str — input() always returns the value typed by the user as a string, regardless of whether it
looks like a number.
Q47. Answer: B) eval() — The eval() function takes a string, evaluates it as a Python expression, and returns
the resulting value.
Q48. Answer: B) print() — The print() function is used to display text or values on the screen/console.
15. Type Conversion, Errors & Debugging
Q49. Answer: B) Explicit type conversion — Explicit type conversion (type casting) happens when the
programmer deliberately uses a function such as int() to convert one data type into another.
Q50. Answer: C) Syntax error — A syntax error occurs when the code does not follow the correct rules of the
language, such as a missing colon, and is detected before the program runs.
Q51. Answer: B) Logical error — A logical error does not stop execution or display an error message, but the
flawed logic leads to an incorrect result.
Q52. Answer: B) Debugging — Debugging refers to the systematic process of finding and fixing bugs (errors)
in a program.
Total Questions: 52 | Full topic-wise coverage for CBSE Class 11 Computer Science, Chapter 5: Getting Started with
Python | Prepared for chapter test practice