| END TERM EXAMINATION | |
| Third Semester[BCA] | Dec 2025-Jan, 2026 |
| Paper Code: BCA-201T | Subject : Python Programming |
| Time:3 Hours | Maximum Marks:60 |
| Note: Attempt five questions in all including Q.No.1 which is compulsory. Select one question from each unit. | |
| Q1 Answer the following in brief. (Any four) (4×5=20) | |
| (a) What do you mean by mutable and immutable? Which datatypes are considered mutable and immutable in Python? | |
| (b) Explain string methods: lower(), upper(), len(), find(), count(). Give examples of each. | |
| (c) Elaborate “Python is interpreted as well as integrated programming environment.” | |
| (d) Justify the significance of self keyword. Give an example. | |
| (e) Write the difference between indexing and slicing with example. | |
| (f) Explain the following functions with respect to NumPy: reshape(), arrange(). | |
| (g) Consider a List L = [15, 20, 25, 30, 35, 40]. Find the output of the following statements: | |
| i) L[1] = L[1] + 2 | ii) L=L+5 |
| iii) L[0] = 100 | iv) L = L[::-1] |
| v) L = L[-2:-4:-1] | |
| (h) Write the Python script to find the factorial of a number using Recursion. | |
| Q2. a) Explain the membership operator and escape sequence with an example. (5) | |
| Q2. b) Write a Python script to identify whether the given string is a palindrome or not. (5) | |
| OR | |
| Q3. a) Explain the keywords, expressions, and variables in Python programming with examples. (5) | |
| Q3. b) What is the difference between for loop and while loop in Python. Explain using examples. (5) | |
| Q4. Explain the List Methods: append(), extend(), remove(), pop(), insert(). How are positive and negative indices used to access the elements of list? (10) | |
| OR | |
| Q5. Explain dictionary methods: len, str, clear, copy, update, get. Give an example of each. Write a Python script to remove the duplicate items from a tuple. (10) | |
| Q6. a) What are Functions? Explain different types of arguments with suitable examples. Also, explain position-only, key-value arguments only, using suitable examples. (5) | |
| b) Create a module “Calculator” that has the functions for basic arithmetic operations. Write the Python script for performing the required arithmetic operations using the module. (5) | |
| OR | |
| Q7 Write a Python script to create a binary file having Rollno, Name and Marks of 5 students and perform the following operations: (2.5×4 = 10) | |
| a) Insert a record | |
| b) Search for a record based on the Rollno | |
| c) Update a record based on the Rollno where Rollno cannot be changed | |
| d) Display all records | |
| Q.8 Explain the file modes used to perform all the operations of file handling. Give examples of each type of files. (10) | |
| OR | |
| Q9. a) Explain the concept of classes and object in Python? Give an appropriate example showing the usage of a Constructor while creating the class. (5) |
|
| b) Differentiate the concept of Overloading and overriding. Explain using an appropriate example. (5) |
|