DEPARTMENT OF ARTIFICIAL INTELLEGENCE AND DATA SCIENCE
MODEL EXAMINATION-I
AD25201 PYTHON FOR DATA SCIENCE
Question Paper Code: 021440
PART – A (10 × 1 = 10)
1. Which of the following is a mutable data type in Python?
A) Tuple B) String C) List D) Frozen set
2. What will be the output of:
print(2 ** 3)
A) 6 B) 8 C) 9 D) 5
3. Which keyword is used to define a function in Python?
A) function B) define C) def D) fun
4. Which statement is used to handle exceptions?
A) try–catch B) try–except C) catch–block D) error–handle
5. Which of the following is used to read a file line by line?
A) read() B) readline() C) readlines() D) openline()
6. Which of the following is not a valid Python data structure?
A) List B) Queue C) Set D) Dictionary
7. What is the output of:
len("Data")
A) 3 B) 4 C) 5 D) Error
8. In data science, what is the first step?
A) Modeling B) Visualization C) Data collection D) Deployment
9. Which process involves handling missing or incorrect data?
A) Data modelling B) Data cleaning C) Data visualization D) Data storage
10. EDA mainly helps to:
A) Build models B) Store data C) Understand data D) Delete data
PART – B (10 × 3 = 30 Marks)
1. Differentiate between mutable and immutable data types with examples.
2. Explain list, tuple, and set with one example each.
3. Write a note on control flow statements in Python.
4. Explain dictionary data structure and its key features.
5. Define a function in Python. What are its advantages?
6. Explain different types of function arguments with examples.
7. What is exception handling? Write the syntax of try-except.
8. Explain file handling modes in Python (read, write, append).
9. What is data science? List its applications.
10. Explain data cleaning and its importance.
PART – C (5 X 12 = 60)
1. A) (i) Explain Python data types in detail with examples. (6)
(ii) Differentiate between list, tuple, set, and dictionary with suitable examples.
(6)
OR
B) (i) Discuss various operators in Python with examples. (6)
(ii) Describe list operations such as slicing, indexing, and methods. (6)
2. A) (i) Explain functions in Python with syntax and examples. (6)
(ii) Discuss different types of function arguments in detail. (3)
(iii) Explain recursive functions with an example.
(3)
OR
B) (i) Describe file handling in Python with different modes and examples.
(6)
(ii) Explain exception handling with try, except, else, and finally. (6)
3. A) (i) Explain classes and objects in Python with examples. (6)
(ii) Discuss inheritance in Python with types and examples. (6)
OR
B) (i) Explain the data science lifecycle with steps. (6)
(ii) Discuss data collection methods and sources.
(6)
4. A) (i) Explain data pre-processing techniques in detail. (6)
(ii) Describe data cleaning methods with examples. (6)
OR
B) (i) Explain handling missing values and outliers.
(6)
(ii) Discuss Exploratory Data Analysis (EDA) and its techniques. (6)
5. A) (i) Explain control flow statements (if, for, while) with examples. (6)
(ii) Explain set operations (union, intersection, difference) with examples. (6)
OR
B) (i) Discuss string formatting techniques in Python (%, format(), f-strings) with examples. (6)
(ii) Describe the steps involved in data transformation during data pre-processing. (6)
*****ALL THE BEST*****