LORDS INSTITUTE OF ENGINEERING & TECHNOLOGY
(UGC Autonomous)
Approved by AICTE | Affiliated to Osmania University | Estd.2003.
Department of CSE-AIML
A.Y: 2024-2025
B.E. III SEMESTER
Name of the Subject: PYTHON PROGRAMMING (U23CM301)
Assignment – II
Assignment Questions: 10 Date:29-11-2024 Max.Marks:10
Bloom’s
Q. Course
Question Marks Taxonomy
No. Outcome
Level
1. Write a Python program that finds common 1 CO3 BTL3
elements between two dictionaries' values and
two sets. Demonstrate how you can efficiently
intersect both?
2. Create a class Student with attributes name, age, 1 CO3 BTL6
and marks. If a student's marks are below 40,
raise an exception LowMarksException. Handle
this exception and display a custom message.
3. Write a Python program where you dynamically 1 CO3 BTL3
create a class using type(). The class should have
at least two methods and one attribute?
4. Write a Python program that asks the user to 1 CO3 BTL3
input two numbers and performs division. Use
exception handling to catch any errors such as
dividing by zero or invalid input (non-numeric
input). Handle the exceptions and display
appropriate messages?
5 What is array transposition in NumPy, and how 1 CO5 BTL2
do you transpose a 2D array?
6 Write a Python function to count how many 1 CO3 BTL3
words are in a given string. Words are
separated by spaces?
7 How do you create a NumPy array from a 1 CO5 BTL3
Python list?
How do you create a Pandas Series and access
its elements?
8 How is polymorphism implemented in Python? 1 CO3 BTL6
Write a Python program where a parent class
defines a method that is overridden by child
classes to show different behaviors for the
same method?
9 Write a Python program to fetch records from 1 CO4 BTL3
the Books table, but with pagination:
Fetch only 3 records at a time (limit 3).
Allow the user to specify which page of
records to fetch (i.e., the starting point).
Implement this using LIMIT and OFFSET
in the SQL query.
10 Write a Python function to: 1 CO4 BTL3
Create a new database named Library in
MySQL if it does not already exist.
Use the CREATE DATABASE SQL query
to create the database.
Print a message confirming the creation of
the database.
Note: Assignment Questions must be given at higher order BTL.
Bloom's Taxonomy Levels (BTL)
BTL1 –Remember BTL2 Understand BTL3 –Apply
BTL4-Analyze BTL5 –Evaluate BTL6 –Create
Note:
1. Answer all Questions.
2. Answer to the assignment questions are to be written on A4 size papers only.
3. Each page of the assignment paper should contain full roll number of the student.
4. The hard copy of the assignment is to be submitted on or before 10-12-2024.