The document is a sample paper for the CSE2025 Python Programming End Term Examination, consisting of two sections: Logic and Application-Based Questions (32 Marks) and Conceptual Questions (8 Marks). Section A includes tasks such as writing programs for prime number extraction, word frequency counting, file reading, and data visualization using libraries like NumPy and Matplotlib. Section B covers conceptual topics like mutable vs immutable types, lambda functions, the significance of the __init__() method, and differences between lists and tuples.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
20 views
Python_EndTerm_Sample paper first year
The document is a sample paper for the CSE2025 Python Programming End Term Examination, consisting of two sections: Logic and Application-Based Questions (32 Marks) and Conceptual Questions (8 Marks). Section A includes tasks such as writing programs for prime number extraction, word frequency counting, file reading, and data visualization using libraries like NumPy and Matplotlib. Section B covers conceptual topics like mutable vs immutable types, lambda functions, the significance of the __init__() method, and differences between lists and tuples.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
CSE2025 – PYTHON PROGRAMMING
End Term Examination – Sample Paper
Max Marks: 40 Duration: 2 Hours
Instructions: - All questions are compulsory. - Assume any missing data if necessary. - Use of calculator (non-scientific) is allowed.
Section A – Logic and Application-Based Questions (32 Marks)
1. Write a Python program that takes a list of integers and returns a new list containing only the prime numbers from the original list. (Hint: Implement a function to check if a number is prime.) [4 Marks] 2. Create a Python program that takes a sentence from the user and prints the frequency of each word in the sentence. (Use a dictionary for word counts.) [4 Marks] 3. Write a Python function that takes a dictionary where keys are product names and values are their prices. The function should return the product with the maximum price. [4 Marks] 4. Write a Python program that reads a file named `data.txt` and counts the number of lines, words, and characters in the file. (Assume the file exists and is accessible.) [4 Marks] 5. Define a class `Student` with attributes `name`, `marks` (dictionary of subjects and marks), and methods to calculate total marks and percentage. Demonstrate usage with a sample object. [4 Marks] 6. Write a Python program that: - Generates random marks (0–100) for 5 students in 3 subjects using NumPy. - Stores them in a Pandas DataFrame. - Adds a column for the average marks of each student. - Plots a bar chart of average marks using Matplotlib. [6 Marks] 7. Write a Python function using exception handling to perform division of two numbers. It should handle the following: - Division by zero - Invalid input (non-numeric) [6 Marks]
Section B – Conceptual Questions (8 Marks)
8. Differentiate between mutable and immutable data types in Python with suitable examples. [2 Marks] 9. Explain the concept of lambda functions. Provide an example where it is used with `map()`. [2 Marks] 10. What is the significance of the `__init__()` method in Python classes? [2 Marks] 11. List any four differences between lists and tuples. [2 Marks]