END TERM EXAMINATION
Third Semester (BCA) December 2024
Paper Code: BCAT-211
Subject: Basics of 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. Write short notes on the following:
- (i) Give a brief account of the origin and need for Python Programming. 5
- (ii) Write two modes of Python IDLE. 5
- (iii) Explain any two methods of List with examples. 5
- (iv) Give an account of the difference between Formal and Actual Arguments. 5
- (v) Briefly explain the features of Python Programming Language. 5
- (vi) Explain any two features of Python Programming Language. 5
- (vii) Differentiate between Files and Immutable Objects. 5
- (viii) Explain the concept of Files and Mutable Objects. 5
- (ix) What is a membership operator in Python? Explain it with an example. 5
- (x) Explain NumPy Library in brief. 5
UNIT-I
Q2. (a) Explain in detail the various data types in Python Programming Language. 5
(b) Differentiate between for Loop and while Loop with Python code. 5
Q3. (a) Explain in detail about the various Operators in Python Programming Language. 5
(b) What are Strings in Python Programming Language? Give examples of various String handling functions and methods in Python. 5
UNIT-II
Q4. (a) Explain the Dictionary and its various operations and methods with examples. 5
(b) Make a list of the first 10 letters of the alphabet, then use the list to do the following operations: 5
- (i) Print the first 3 letters of the list
- (ii) Print any 3 letters from the middle(6)
Q5. (a) Explain Tuples and its various operations and methods with examples. 5
(b) Create a dictionary whose keys are month names and whose values are the number of days in the corresponding month. 5
- (i) Ask the user to enter a month name and use the dictionary to tell them how many days are in the month.
- (ii) Print all the months with 31 days.
- (iii) Print out all the months with less than 31 days.
UNIT-III
Q6. (a) Write a program that uses a user-defined function that accepts name prefixes (as M for Male, F for Female) and prefixes Mr. / Ms. Based on the gender. 5
(b) Explain any three methods of math module with an example. 5
Q7. (a) Write a menu-driven program to implement a basic calculator. 5
(b) Explain any three methods of random module with an example. 5
UNIT-IV
Q8. (a) Create a binary file with roll number, name, marks and perform the following operations. 5
- (i) Update the marks.
- (ii) Delete the records.
- (iii) Display the records.
(b) Explain the features of the NumPy Library. Explain any two methods of NumPy Library. 5
Q9. (a) Create a binary file with Item number, Name, Price and perform the following operations. 5
- (i) Search the marks.
- (ii) Append the records.
- (iii) Display the records.
(b) Explain the features of the matplotlibLibrary. Explain any two methods of matplotlibLibrary. 5