University/College Practice Examination — Python Fundamentals,
NumPy, Pandas, Data Cleaning, Data Analysis, Visualization,
Statistics, Machine Learning & Problem Solving — 190 Multiple-
Choice Questions with Answers & Detailed Rationales
SECTION 1: Python Fundamentals (Questions 1–25)
Question 1
Which of the following best describes the primary characteristic of Python that makes it
suitable for data science?
A. It requires explicit memory management by the programmer
B. It is an interpreted, high-level language with extensive library support
C. It compiles directly to machine code for maximum performance
D. It enforces strict static typing at compile time
Correct Answer: B
Explanation: Python is interpreted and high-level, offering rich libraries like NumPy and
pandas that accelerate data science workflows.
Question 2
In Python, what is the primary difference between a list and a tuple?
,A. Lists can only store numeric data, while tuples store any data type
B. Tuples are mutable, while lists are immutable
C. Lists are mutable, while tuples are immutable
D. Tuples require more memory than lists for identical data
Correct Answer: C
Explanation: Lists allow modification after creation; tuples cannot be changed, making them
suitable for fixed data collections.
Question 3
A data analyst writes the following code:
python
x = [1, 2, 3, 4, 5]
y = x[1:4]
What is the value of y?
A. [1, 2, 3]
B. [2, 3, 4]
C. [2, 3, 4, 5]
,D. [1, 2, 3, 4]
Correct Answer: B
Explanation: Python slicing is zero-indexed and excludes the end index, so indices 1, 2, and 3
yield [2, 3, 4].
Question 4
Which Python data structure would be most appropriate for storing unique values while
preserving insertion order?
A. List
B. Tuple
C. Set
D. Dictionary
Correct Answer: D
Explanation: In Python 3.7+, dictionaries preserve insertion order and enforce unique keys,
ideal for ordered unique mappings.
Question 5
What will be the output of the following expression?
, python
print(type())
A. <class 'int'>
B. <class 'float'>
C. <class 'double'>
D. <class 'decimal'>
Correct Answer: B
Explanation: The division operator / in Python 3 always returns a float, even when both
operands are integers.
Question 6
A data scientist needs to iterate over both indices and values of a list simultaneously. Which
approach is most Pythonic?
A. Using a for loop with manual index increment
B. Using enumerate() in a for loop
C. Using range() with list indexing
D. Using a while loop with a counter variable