0% found this document useful (0 votes)
8 views5 pages

Practical Assignment

The document outlines a series of Python programming tasks, including searching elements in lists, managing book records with dictionaries, file operations, and database connectivity with MySQL. It covers various functionalities such as data manipulation, file handling, and implementing data structures like stacks. Additionally, it emphasizes exception handling, input validation, and generating reports based on database queries.

Uploaded by

bowif65838
Copyright
© All Rights Reserved
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% found this document useful (0 votes)
8 views5 pages

Practical Assignment

The document outlines a series of Python programming tasks, including searching elements in lists, managing book records with dictionaries, file operations, and database connectivity with MySQL. It covers various functionalities such as data manipulation, file handling, and implementing data structures like stacks. Additionally, it emphasizes exception handling, input validation, and generating reports based on database queries.

Uploaded by

bowif65838
Copyright
© All Rights Reserved
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

1. Write a program in python to search for a element in a list.

Also display
frequency of each element.

2. Write a Python program to create a dictionary storing:


Book ID as key and Book Name as value.

The program should:

Add new books , Search a book using Book ID ,Display all book details

3. Write a program to pass a list to a function and doubles the odd value and
triples the even value present. Return the updated list
4. Write a python program to read a text file and copy all those words that
begins with a vowel to another file .
5. Write a python program to remove all the lines that contain any special
character in a text file.
6. Write a python program to create a Binay file with name , roll and Marks
for 10 students. Search for a given roll number and display its name, if not
found display appropriate message
7. Write a python program to create a Binay file with name , roll and Marks
for 10 students. Input for a roll number and update value for marks
8. Write a python program to create a csv file with empid, name and mobile
number for 10 employee. Search empid , update the value for mobile
number by user entered value
9. Write a python program to remove all duplicate words present in a text file
.
[Link] a Python program to create a CSV file named student_marks.csv
containing the following fields:
Roll Number, Name, Class, Section, Subject, Marks.
The program should provide menu-driven options to:
Add new student records
Display all records
Display students scoring above 75 marks
Update marks of a student using Roll Number
Delete a student record
Ensure proper exception handling and input validation
11. Employee Payroll Processing using Binary File
Create a binary file [Link] to store employee records with the
following details:
Employee ID, Name, Designation, Basic Salary.
Write a Python program to:
Add employee records
Calculate and display Gross Salary
(HRA = 20% of Basic, DA = 10% of Basic)
Display employees whose Gross Salary exceeds ₹50,000
Search an employee using Employee ID
Use the pickle module and handle file-related errors.
[Link] of Sales Data using CSV File
A company maintains monthly sales data in a CSV file [Link] with fields:
Invoice Number, Product Name, Quantity Sold, Price per Unit.

Write a Python program to:

Compute total sales amount for each record

Display records where total sales exceed ₹25,000

[Link] Result Processing using Binary File

Create a binary file [Link] to store student result records containing:


Roll Number, Name, Marks in Physics, Chemistry, Mathematics.

Write a Python program to:

Add student records

Calculate total marks and percentage

Display students who have failed (less than 33 in any subject)

[Link] a Python program to implement a stack of integers using a list.


The program should:
Push n integers onto the stack
Reverse the stack without using any additional data structure
Display the reversed stack
Count and display the number of even and odd elements present in the
stack
15 . Write a Python program to implement a stack of student records,
where each stack element is a dictionary containing the following keys:
Roll No, Name, Class, Section.
The program should allow:
Push a student record onto the stack
Pop a student record from the stack
Display all student records present in the stack
16..Write a Python program to define a function that accepts a number and
returns whether the number is Palindrome or not.

17.. Student Performance Analyzer (Nested Dictionary)


Create a program to store student academic records using a nested dictionary in the

format:

{roll_no: {"name": str, "marks": {"Maths": int, "CS": int, "Physics": int}}}
Tasks:

 Accept details for n students


 Calculate average marks per student
 Display the topper based on highest average
 Display subject-wise highest scorer

[Link] a program in python to simulate action of Bank Account Management System


Create a dictionary where each key is an account number and value is:

{account_no: {"name": str, "balance": float}}

Menu Options:

1. Create Account
2. Deposit Amount
3. Withdraw Amount (check minimum balance ₹1000)
4. Display Account Details
5. Display All Accounts with Balance > ₹50,000

19. Python SQL Database connectivity-I :

Write a program in python to connect with MySQL and perform operations on a table:

Table: student(admno, name, class, section, marks)

Tasks:

 Add a new student record


 Display all records
 Search student by Admission No.
 Update marks of a student
 Delete a student record

20. Python SQL Database connectivity-I :


Library Book Issue Register

Use MySQL to maintain issue details.

Tables:

 books(book_id, title, author, copies)


 issue(book_id, student_name, issue_date)

Tasks:

 Display all books


 Issue a book (only if copies > 0, then reduce copies)
 Show all issued books
21. Python SQL Database connectivity-I I

Write a Python program to connect to a MySQL database and create a table named
EMPLOYEE with the following structure:

Field Name Data Type


emp_id Integer (Primary Key)
name Varchar(40)
department Varchar(30)
basic_salary Float
date_of_joining Date

The program should:

 Establish MySQL connection using [Link]


 Create the table only if it does not already exist
 Display a suitable message after successful creation

22. Python SQL Database connectivity-III

Write a Python program to calculate and display the gross salary of an employee using
MySQL data.

Rules:

 HRA = 20% of basic salary


 DA = 15% of basic salary
 Gross Salary = Basic + HRA + DA

The program should:

 Accept employee ID as input


 Fetch data from the database
 Display employee name, department, basic salary, and gross salary

23. Python SQL Database connectivity-IV

Write a Python program to generate the following reports using SQL queries:

 Department-wise average basic salary


 Name and department of the highest paid employee
 List of employees earning above the department average salary

24. MYSQL Table Based Question SET –I


25. MYSQL Table Based Question SET –II
26. MYSQL Table Based Question SET –III
27. MYSQL Table Based Question SET –IV
28. MYSQL Table Based Question SET –I
NOTE : 1. FOR QUESTION NUMBER 24 TO 28 DRAW THE STRUCTURE OF TABLE
ALONG WITH DATA AS GIVEN IN QUESTION PAPER AND SOLVE ANY 5 QUERY
BASED ON UNDERLYING TABLE .
2. For all Question write output on white side of Practical Note book.

You might also like