Enrollment No. ...........

MID TERM EXAMINATION

Third Semester (BCA) NOV 2024

Paper Code: BCA-211

Subject: Basics of Python Programming

Time: 2 Hours

Maximum Marks: 60

Note: Attempt five questions in all, including Q.no.1, which is compulsory. Select one question from each unit.



Q1. (a) Explain the salient features of Python programming language. [5]

(b) Write a Python program to print a dictionary that contains a number (between 1 and n) in the form (x, x*x). [5]

(c) Explain the following operators in Python with examples: [5]


Q2. (a) Consider a string mystr = "Cinderella". Write a Python program to: [10]

(b) Write a program to find and calculate the square of only those numbers whose last significant digit is 5. [5]


Q3. (a) Write program control statements in Python. [5]

(b) Explain the following flow charts: [10]


Q4. (a) Convert a 1D array of size 12 into 2D array of size 4x3. [5]

(b) Differentiate between list/tuple. Explain any two methods of element (with example) in list and tuple. [10]


Q5. (a) How can you define a function in Python (with keyword, positional, arbitrary (var args) and default arguments)? Explain with example. [10]

(b) Display the Python code to convert NumPy array into list. [5]