PYTHON PROGRAMMING EXAMINATION PAPER
Course Level: Beginner to Intermediate
Total Questions: 50
Marks: 50 (1 mark each)
Duration: 90 minutes
Date: February 11, 2026
SECTION A: INTRODUCTION TO PYTHON PROGRAMMING LANGUAGE
Question 1
Which of the following is NOT a feature of Python? - A) Easy to learn and use - B)
Dynamically typed language - C) Requires explicit memory management like C++ - D)
Supports multiple programming paradigms
Correct Answer: C
Explanation: Python is known for automatic memory management through garbage
collection. Unlike C++, you don’t need to explicitly manage memory in Python, which is one
of its key features.
Question 2
Python was created by: - A) Guido van Rossum - B) Dennis Ritchie - C) Bjarne Stroustrup -
D) James Gosling
Correct Answer: A
Explanation: Guido van Rossum created Python in 1989 and was the chief developer until
2018. He is often called the “Benevolent Dictator for Life” in the Python community.
Question 3
Which flavor of Python is the most widely used and supported? - A) Jython - B) CPython - C)
IronPython - D) PyPy
Correct Answer: B
Explanation: CPython is the reference implementation of Python written in C. It is the most
popular and widely used version, supporting the latest Python features first.
Question 4
Jython is a flavor of Python that: - A) Runs on the Java Virtual Machine (JVM) - B) Is written in
C - C) Is optimized for performance with a JIT compiler - D) Runs on the .NET Framework
Correct Answer: A
Explanation: Jython allows Python code to run on the Java Virtual Machine, making it
possible to use Python with Java libraries and frameworks.
Question 5
Which Python flavor is specifically designed for the .NET Framework? - A) Jython - B)
IronPython - C) PyPy - D) Anaconda Python
Correct Answer: B
Explanation: IronPython is an implementation of Python that runs on Microsoft’s .NET
Framework and Mono, allowing integration with .NET libraries.
Question 6
PyPy is primarily known for: - A) Running on Java Virtual Machine - B) Providing better
performance through JIT compilation - C) Running on the .NET Framework - D) Being the
official Python implementation
Correct Answer: B
Explanation: PyPy uses a Just-In-Time (JIT) compiler to optimize performance, making it
significantly faster than CPython for many applications.
Question 7
What is the current stable major version of Python as of 2024? - A) Python 2.7 - B) Python
3.11 or later - C) Python 4.0 - D) Python 3.5
Correct Answer: B
Explanation: Python 2 reached end-of-life in 2020. Python 3 is the current and supported
version, with 3.11+ being stable and regularly updated.
Question 8
To install Python on Windows, you typically: - A) Download the .exe file from [Link]
and run the installer - B) Use the command line only - C) Clone from GitHub - D) Use only
pip commands
Correct Answer: A
Explanation: The standard way to install Python on Windows is to download the
executable installer from the official Python website ([Link]) and run it.
Question 9
What does the .py file extension represent? - A) Python YAML file - B) Python source code
file - C) Python compiled file - D) Python package index file
Correct Answer: B
Explanation: .py is the standard file extension for Python source code files. When
executed, Python interprets these files.
Question 10
Which command is used to execute a Python script from the command line? - A) python
[Link] - B) run [Link] - C) execute [Link] - D) python3 –run [Link]
Correct Answer: A
Explanation: The python [Link] or python3 [Link] command is used to
execute Python scripts from the terminal or command prompt.
SECTION B: DATA TYPES - FUNDAMENTAL DATA TYPES
Question 11
Which of the following is NOT a fundamental data type in Python? - A) int - B) str - C) list - D)
float
Correct Answer: C
Explanation: list is a collection data type, not a fundamental data type. The fundamental
data types in Python are int, float, str, bool, and NoneType.
Question 12
What is the data type of the value 3.14 in Python? - A) int - B) float - C) double - D) decimal
Correct Answer: B
Explanation: 3.14 is a floating-point number, so its data type is float. Python doesn’t have
a separate ‘double’ type.
Question 13
What is the output of type(True) in Python? - A) bool - B) int - C) Boolean - D) str
Correct Answer: A
Explanation: True and False are boolean values in Python. The type() function returns
<class ‘bool’> for boolean values.
Question 14
Which of the following represents a string data type? - A) 123 - B) “Hello” - C) [1, 2, 3] - D)
12.5
Correct Answer: B
Explanation: Strings are enclosed in single quotes (’’), double quotes (““), or triple quotes
in Python.”Hello” is a string value.
Question 15
What is the result of type(None) in Python? - A) NoneType - B) null - C) void - D) None
Correct Answer: A
Explanation: None is a special data type in Python representing the absence of a value.
type(None) returns <class ‘NoneType’>.
Question 16
Which statement about Python’s int data type is true? - A) Integers have a fixed maximum
value - B) Python integers can be arbitrarily large - C) Integers cannot be negative - D)
Python only supports 32-bit integers
Correct Answer: B
Explanation: Python 3 integers have unlimited precision and can be arbitrarily large, unlike
many other programming languages with fixed-size integers.
Question 17
What is the data type of 0x1A in Python? - A) str - B) float - C) int (hexadecimal) - D) hex
Correct Answer: C
Explanation: 0x1A is a hexadecimal integer literal in Python. When interpreted, it equals 26
in decimal and is of type int.
Question 18
What is the data type of the value 1 + 2j in Python? - A) float - B) int - C) complex - D) str
Correct Answer: C
Explanation: 1 + 2j represents a complex number where 1 is the real part and 2 is the
imaginary part. The data type is complex.
Question 19
What will type("123") return? - A) int - B) str - C) numeric - D) float
Correct Answer: B
Explanation: “123” is enclosed in quotes, making it a string value, not a numeric value.
The type is str.
Question 20
Which data type is used for boolean logic in Python? - A) bool - B) boolean - C) int (0 or 1) -
D) str (“True” or “False”)
Correct Answer: A
Explanation: The bool data type is specifically designed for boolean values (True and False)
in Python, though bool is a subclass of int.
SECTION C: COLLECTION DATA TYPES
Question 21
Which of the following is an ordered and mutable collection? - A) Tuple - B) Set - C) List - D)
Frozen set
Correct Answer: C
Explanation: Lists are ordered collections that can be modified (mutable). Tuples are
immutable, sets are unordered, and frozensets are immutable.
Question 22
What is the characteristic feature of a Tuple? - A) Ordered and mutable - B) Unordered and
immutable - C) Ordered and immutable - D) Unordered and mutable
Correct Answer: C
Explanation: Tuples are ordered collections (maintain insertion order) but are immutable
(cannot be modified after creation).
Question 23
How are Lists and Tuples different? - A) Lists are immutable, tuples are mutable - B) Lists
are mutable, tuples are immutable - C) Both are mutable - D) Both are immutable
Correct Answer: B
Explanation: Lists can be modified after creation (mutable), while tuples cannot be
changed once created (immutable).
Question 24
What is a Set in Python? - A) An ordered collection with duplicates allowed - B) An
unordered collection with no duplicates - C) An ordered collection with no duplicates - D)
A collection of key-value pairs
Correct Answer: B
Explanation: Sets are unordered collections that automatically remove duplicate
elements. They are useful for membership testing and removing duplicates.
Question 25
What is the difference between a Set and a Frozenset? - A) Sets are ordered, frozensets are
unordered - B) Sets are mutable, frozensets are immutable - C) Sets cannot have
duplicates, frozensets can - D) There is no difference
Correct Answer: B
Explanation: Both are unordered, but sets are mutable (can be modified) while frozensets
are immutable (cannot be changed).
Question 26
What is a Dictionary in Python? - A) An ordered collection of items - B) A collection of key-
value pairs - C) An unordered collection with no duplicates - D) A set of unique elements
Correct Answer: B
Explanation: Dictionaries store data as key-value pairs, allowing fast lookup and retrieval
of values using their keys.
Question 27
How do you access an element in a list? - A) list{0} - B) list[0] - C) [Link](0) - D)
[Link](0)
Correct Answer: B
Explanation: In Python, square brackets are used for indexing lists. list[0] returns the first
element (index starts at 0).
Question 28
What is the output of [1, 2, 3][1]? - A) 1 - B) 2 - C) 3 - D) [2]
Correct Answer: B
Explanation: Lists use 0-based indexing. Index 1 refers to the second element, which is 2.
Question 29
Which method adds an element to the end of a list? - A) insert() - B) append() - C) extend() -
D) add()
Correct Answer: B
Explanation: The append() method adds a single element to the end of a list. insert() adds
at a specific position, extend() adds multiple elements, and add() is for sets.
Question 30
Can you modify a tuple after it has been created? - A) Yes, using append() - B) Yes, using
index assignment - C) No, tuples are immutable - D) Yes, using extend()
Correct Answer: C
Explanation: Tuples are immutable and cannot be modified after creation. Attempting to
do so will raise an error.
Question 31
What will {1, 2, 2, 3} result in? - A) {1, 2, 2, 3} - B) {1, 2, 3} - C) Error - D) {2}
Correct Answer: B
Explanation: Sets automatically remove duplicate elements. The set {1, 2, 2, 3} becomes
{1, 2, 3}.
Question 32
How do you create an empty dictionary? - A) {} - B) dict() - C) both A and B - D) set()
Correct Answer: C
Explanation: Both {} and dict() create an empty dictionary. Note: {} technically creates an
empty dict, not a set. Use set() for an empty set.
Question 33
How do you access a value in a dictionary? - A) dict[key] - B) [Link](key) - C) both A and B
- D) dict(key)
Correct Answer: C
Explanation: Both dict[key] and [Link](key) can access dictionary values. get() is safer as
it returns None if key doesn’t exist, while [] raises KeyError.
Question 34
What is the output of len([1, 2, 3, 4, 5])? - A) 4 - B) 5 - C) 6 - D) Error
Correct Answer: B
Explanation: The len() function returns the number of elements in a collection. The list [1,
2, 3, 4, 5] has 5 elements.
Question 35
Which collection type allows duplicate elements? - A) Set - B) Frozenset - C) List - D) Both
B and C
Correct Answer: C
Explanation: Lists allow duplicate elements. Sets and frozensets automatically eliminate
duplicates.
SECTION D: VARIABLES
Question 36
How do you create a variable in Python? - A) var x = 5 - B) x = 5 - C) int x = 5 - D) declare x = 5
Correct Answer: B
Explanation: Python uses simple assignment syntax. You don’t need keywords like var,
int, or declare. Python is dynamically typed.
Question 37
What is the naming convention for variables in Python? - A) camelCase - B) PascalCase - C)
snake_case - D) SCREAMING_SNAKE_CASE
Correct Answer: C
Explanation: PEP 8, Python’s style guide, recommends snake_case for variable names.
While Python allows others, snake_case is the convention.
Question 38
Which variable name is valid in Python? - A) 1variable - B) variable-name - C)
_variable_name - D) variable name
Correct Answer: C
Explanation: Variable names must start with a letter or underscore, followed by
alphanumeric characters or underscores. _variable_name follows this rule.
Question 39
What happens when you assign a new value to a variable? - A) An error is raised - B) The old
value is preserved - C) The variable is reassigned to the new value - D) Both values are
stored
Correct Answer: C
Explanation: Variables in Python can be reassigned. The old value is overwritten, and the
variable now refers to the new value.
Question 40
Can multiple variables hold the same value? - A) No, each variable must have a unique
value - B) Yes, multiple variables can reference the same value - C) Only for strings - D)
Only for numbers
Correct Answer: B
Explanation: Multiple variables can be assigned the same value. For example, a = b = c = 5
assigns 5 to all three variables.
Question 41
What is the output of x = 5; x += 3; print(x)? - A) 5 - B) 3 - C) 8 - D) 53
Correct Answer: C
Explanation: += is an augmented assignment operator. x += 3 is equivalent to x = x + 3. So 5
+ 3 = 8.
Question 42
What does the variable _ typically represent in Python? - A) A public variable - B) A private
variable - C) The last evaluated expression in the REPL - D) An invalid variable name
Correct Answer: C
Explanation: In the Python REPL (interactive shell), _ holds the value of the last evaluated
expression.
Question 43
What is dynamic typing in Python? - A) You must declare variable types before use - B)
Variable types are determined at runtime based on the assigned value - C) All variables
must be strings - D) Types cannot be changed
Correct Answer: B
Explanation: Python is dynamically typed. You don’t declare types; Python infers them
from the assigned value, and types can change during execution.
Question 44
What is the output of type(x) where x = "Hello"? - A) str - B) string - C) <class ‘str’> - D)
char
Correct Answer: A
Explanation: The type() function returns the type object. When printed, it shows as <class
‘str’>, but the type itself is str.
Question 45
Can a variable in Python contain different data types at different times? - A) No, the type is
fixed at creation - B) Yes, Python supports dynamic typing - C) Only for lists - D) Only for
dictionaries
Correct Answer: B
Explanation: Due to Python’s dynamic typing, a variable can hold different data types. For
example, x = 5; x = “Hello” is valid.
SECTION E: OPERATORS
Question 46
What is the result of 10 / 3 in Python 3? - A) 3 - B) 3.333… - C) 3.3 - D) Error
Correct Answer: B
Explanation: In Python 3, / performs true division and returns a float. The result is
approximately 3.333… (10 divided by 3).
Question 47
What is the result of 10 // 3 in Python? - A) 3 - B) 3.333… - C) 3.3 - D) Error
Correct Answer: A
Explanation: // is the floor division operator, which returns the integer quotient. 10 // 3 = 3.
Question 48
What is the result of 10 % 3? - A) 3 - B) 1 - C) 3.333… - D) 10
Correct Answer: B
Explanation: % is the modulus operator, which returns the remainder. 10 % 3 = 1 (10
divided by 3 gives quotient 3 and remainder 1).
Question 49
What does the ** operator do? - A) Multiplies two numbers - B) Exponentiation (power) - C)
Pointer dereference - D) Bitwise operation
Correct Answer: B
Explanation: ** is the exponentiation operator. For example, 2 ** 3 = 8 (2 raised to the
power of 3).
Question 50
What is the output of 5 == 5.0? - A) True - B) False - C) Error - D) 1
Correct Answer: A
Explanation: == compares values, not types. 5 (int) and 5.0 (float) have the same value, so
the comparison returns True.
Question 51
What is the difference between == and is? - A) They are the same - B) == compares values,
is compares identity (memory location) - C) is compares values, == compares identity - D)
is is faster than ==
Correct Answer: B
Explanation: == checks if two variables have equal values, while is checks if they refer to
the same object in memory.
Question 52
What is the output of True + True? - A) 2 - B) True - C) False - D) Error
Correct Answer: A
Explanation: In Python, bool is a subclass of int. True is equivalent to 1 and False is 0. So
True + True = 1 + 1 = 2.
Question 53
What does the and operator do? - A) Bitwise AND operation - B) Logical AND - returns True
if both operands are True - C) Concatenation - D) Assignment
Correct Answer: B
Explanation: The and operator is a logical operator. It returns True only if both operands
are true. For example, True and False = False.
Question 54
What is the output of not True? - A) True - B) False - C) 0 - D) Error
Correct Answer: B
Explanation: The not operator is a logical NOT operator. It inverts the boolean value. not
True = False.
Question 55
What is the output of "Hello" + " World"? - A) “Hello World” - B) Error - C) “HelloWorld” -
D) “Hello” + ” World”
Correct Answer: A
Explanation: The + operator concatenates strings. “Hello” + ” World” = “Hello World”.
ANSWER KEY WITH EXPLANATIONS
Q. Answer Key Concept
1 C Python features - automatic memory management
2 A Guido van Rossum created Python
3 B CPython is the reference implementation
4 A Jython runs on JVM
5 B IronPython runs on .NET Framework
6 B PyPy uses JIT compilation for performance
7 B Python 3.11+ is the current stable version
8 A Python installation on Windows
9 B .py is Python source code extension
10 A Executing Python scripts from command line
11 C List is a collection, not fundamental data type
12 B 3.14 is a float data type
13 A type(True) returns bool
14 B Strings are enclosed in quotes
15 A type(None) returns NoneType
16 B Python integers have unlimited precision
17 C 0x1A is a hexadecimal integer
18 C 1 + 2j is a complex number
19 B “123” is a string, not numeric
20 A bool is the boolean data type
21 C Lists are ordered and mutable
22 C Tuples are ordered and immutable
23 B Lists are mutable, tuples are immutable
24 B Sets are unordered collections without duplicates
Q. Answer Key Concept
25 B Sets are mutable, frozensets are immutable
26 B Dictionaries store key-value pairs
27 B Accessing list elements using square brackets
28 B Index 1 of [1, 2, 3] is 2
29 B append() adds element to end of list
30 C Tuples cannot be modified (immutable)
31 B Sets remove duplicate elements
32 C Both {} and dict() create empty dictionaries
33 C Both dict[key] and [Link](key) access values
34 B len() returns 5 for a 5-element list
35 C Lists allow duplicate elements
36 B Simple assignment syntax for variables
37 C snake_case is the Python naming convention
38 C _variable_name is a valid variable name
39 C Variables can be reassigned new values
40 B Multiple variables can hold the same value
41 C x += 3 with x=5 results in 8
42 C _ holds last evaluated expression in REPL
43 B Dynamic typing determines types at runtime
44 A type() returns the type object (str in this case)
45 B Python supports dynamic typing
46 B / performs true division in Python 3
47 A // performs floor division
48 B % (modulus) returns remainder
49 B ** performs exponentiation
50 A == compares values; 5 == 5.0 is True
51 B == compares values, is compares identity
52 A True + True = 1 + 1 = 2
53 B and is a logical AND operator
54 B not True = False
55 A + concatenates strings
EXAM STATISTICS
Total Questions: 55
Total Marks: 55 (1 mark each)
Duration: 90-120 minutes
Difficulty Level: Beginner to Intermediate
Topics Covered:
o Introduction to Python (10 questions)
o Fundamental Data Types (10 questions)
o Collection Data Types (15 questions)
o Variables (10 questions)
o Operators (10 questions)
INSTRUCTIONS FOR CANDIDATES
1. Attempt all questions.
2. Each question carries 1 mark.
3. Choose the most appropriate answer from the four options (A, B, C, D).
4. No negative marking is applied.
5. Write your answers on the answer sheet provided.
6. Do not use any external resources or references.
7. Maintain academic integrity throughout the examination.
End of Examination Paper