END TERM EXAMINATION | |
Third Semester[BCA] | December 2024 |
Paper Code: BCAT-211 | Subject : Basic of Python Programming |
Time:3 Hours | Maximum Marks:60 |
Note: Attempt 5 questions in all including Q.No.1 which is compulsory. Select one question from each unit. | |
Q1 Write short note on the following (any five) : (5*4=20) | |
(a) Give a brief account of the Origin and need for Python Programming | |
(b) What is IDLE? Write two modes of Python IDLE. | |
(c) Explain any two methods of List with examples. | |
(d) Give a brief account of the Formal Arguments and Actual Arguments | |
(e) Differentiate between break and continue statements. | |
(f) Explain any two features of Python Programming Language. | |
(g) Differentiate between Mutable and Immutable Objects. | |
(h) Explain the difference between Text Files and Binary Files. | |
(i) What is a membership operator in Python? Explain it with an example | |
(j) Explain NumPy Library in brief. | |
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) | |
or | |
Q3. (a) Explain in detail about the various Operators in Python Programming Language. (5) | |
(b) What is String 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 slicing to do the following operations: i) Print the first 3 letters of the list ii) Print any 3 letters from the middle (5) | |
or | |
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 months.
|
|
UNIT III | |
Q6. a) Write a program that uses a user-defined function that accepts name and gender (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) | |
or | |
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, and marks and perform the following operations. (5)
|
|
b) Explain the features of the NumPy Library. Explain any two methods of NumPy Library. (5) | |
or | |
Q9.a) Create a binary file with Item number, Name, Price and perform the following operations. (5)
|
|
b) Explain the features of the matplotlib Library. Explain any two methods of matplotlib Library (5) |