END TERM EXAMINATION
Third Semester (BCA) January 2024
Paper Code: BCAT-211
Subject: Basics of Python Programming
Time: 3 Hours
Maximum Marks: 75
Note: Attempt five questions in all, including Q.no.1, which is compulsory. Select one question from each unit.
Q1. Write short notes on the following: (Any Five) (5x5=25)
- (a) Elaborate - "Python is an interpreted as well as an integrated programming language?" 5
- (b) How is a unary operator different from a binary operator? Give an example of each. 5
- (c) Explain the use of the __init__ method in Python programming? 5
- (d) Differentiate between list and tuple? 5
- (e) Explain the use of pandas library with an example? 5
- (f) Justify the significance of the self keyword? Give an example? 5
UNIT-I
Q2.
- (a) Explain while loop and for loop with an example. Elaborate the difference between them. 4.5
- (b) Explain membership operator, identity operator, escape sequence, slicing with an example? 8
Q3.
-
(a) Perform the following slicing operation on the string "PYTHON
PROGRAMMING":
string [2:15:2] ,
string [-3:-16:-2] ,
string [3:-16:2] ,
string [:13] ,
string [6:] ,
string [:-2] ,
string [3:14:3] 6 - (b) Write a program to print stars in a right triangle pattern (value entered by the user)? 6.5
UNIT-II
Q4.
Q5.
- (a) Explain list methods- append, extend, remove, index, pop, insert, sort? Give example of each? 6.5
- (b) Explain dictionary methods- len, str, clear, copy, update, get? Give an example of each. 6
UNIT-III
Q6. Explain the concept of class, objects, functions, data member with help of program? Also explain call by value and call by reference?
- 12.5
Q7. Explain the following terms with examples:
-
(i) Scope and lifetime of a function.
(ii) Importing modules
(iii) Formal, Actual, Default, keyword arguments
(iv) Concept of modules 12.5
UNIT-IV
Q8.
- (a) Elaborate the importance of pip command to install any library in Python? 4.5
- (b) By using NumPy library in program, perform the following operations: Creation of 1D array, Re-shaping of an Array, Array Slicing, Aggregate Operations. 8
Q9.
- (a) Explain file modes of file handling? Give example of each? 4.5
- (b) Explain the use of NumPy, Pandas, Matplotlib in Python programming? Give example of each? 8