0% found this document useful (0 votes)
12 views2 pages

Practical Term1

Uploaded by

medha04097
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Practical Term1

Uploaded by

medha04097
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PRACTICAL PROGRAM LIST & INSTRUCTIONS – 2024-25

For practical one program from each set (totally 3 programs) will be asked

SET - A

1. Write a program to accept a list of integers and do the following(without using predefined
function)
a. Sort using Bubble sort
b. Search a integer using Binary Search
2. Write a program to accept a list of integers and do the following
a. Sort using Insertion sort
b. Push the positive numbers to the beginning of the list
3. Write a program to accept a list of integers and do the following(without using predefined
function)
a. Swap the Alternate values of the list
(Example : Given list : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Resultant : 2, 1, 4, 3, 6, 5, 8, 7, 10, 9 )
b. Insert an integer when Data to insert is given by the user
4. Write a program to accept a list of integers and do the following(without using predefined
function)
a. Sort using Selection sort
b. Delete an integer when index to insert is given by the user
5. Write a program to accept a 2D tuple of integers of size M x N and do the following
a. Find Sum of each row and column
b. Find the sum of Left and Right diagonals if M = N
6. Write a program to accept a 2D tuple of integers of size M x N and do the following
a. Display the values in the boundary
b. Display the Upper and lower triangle

7. Write a program to accept a dictionary with Roll number as key, Name and Salary as values and
do the following
a. Find the total salary of all
b. Transfer the dictionary whose salary is above 10000 into the binary file of records and
display the file

8. Write a program to accept a Sentence from the user and do the following
a. find the frequency of each alphabet using the concept of dictionary
b. Find number of words, uppercase case alphabets, lower case alphabets, digits and other
characters

9. Accept a list of integers of Size N(EVEN) and do the following (Display all 4 arrays )
 Tranfer to a 2D tuple of size N x N in the following format
o Given list [ 8, 2, 3 , 4 , 7 ]
o 2D tuple( ( 8 0 0 0 0 )
( 8 2 0 0 0)
( 8 2 3 0 0)
( 8 2 3 4 0)
( 8 2 3 4 7 ))
 Tranfer to a 2D tuple of size N x N in the following format
o Given list [ 8, 2, 3 , 4 , 7 ]
o 2D tuple ( ( 0 0 0 0 8 )
(0 0 0 2 8)
(0 0 3 2 8)
(0 4 3 2 8)
(7 4 3 2 8 ))
 Tranfer to a 2D tuple of size N x N in the following format
o Given list [ 8, 2, 3 , 4 , 7 ]
o 2D tuple ( ( 8 2 3 4 7 )
(0 2 3 4 0 )
(0 0 2 0 0)
(0 2 3 4 0)
(8 2 3 4 7 )
10. Write a program to accept 2 lists of size M and N. Merge the lists into single sorted list without
duplication. The resultant list must be get sorted while merging. Sort the given lists using any
sort. (Order will be given )
11. Write a program to accept a string (Sentence) from the user and do the following
a. Count number of words
b. Count number of “The” in the sentence
c. Find the frequency of each character given by the user

SET – B
1. Write a program to create a text file and do the following (ABC.TXT)
a. Count number of words, lines and characters
b. Transfer the Uppercase alphabets into a list
c. Display the contents of the file and list

2. Write a program to create a text file and do the following (ABC.TXT)


a. Count number of Uppercase alphabets , lowercase alphabets , digits and other characters
in each line
b. Count number of “The” & “the” in each line of the file

3. Write a program to create two text files “ABC1.txt” and “ABC2.txt” and do the following
a. Merge the contents of both the files into “ABC.txt”.
b. Transfer the first and last word of each line of ABC1.txt into a list and display the list

4. Write a menu based program to do the following operations


a. Create_Bin() – To create a binary file of (Name, age, Salary) records
b. Modify() – To modify a record when the name of the person to be modified is given
c. App_Record() – To append more records into the existing file

5. Write a menu based program to do the following operations


a. Create_Bin() – To create a binary file of (Name, age, Salary) records
b. Update() – To Update all records by increasing the salary by 10%
c. Ins_Record() – To insert more a record after a record (Name is given)
6. Write a menu based program to do the following
a. Create_Bin() - To create a binary file of (EnpId, EmpName, Designation )
b. Insert() : To insert before a particular record. (when name is given)
c. Del_Record() : To Delete a record when the name is given
SET – C

1. Write a program to create a CSV file (Bookcode, Bookname, cost) and do the following
a. Display the contents of the file
b. Count number of records whose cost is below 100 rupee
2. Write a program to accept List of tuples with (Name, age, gender) and do the following
a. Transfer to the CSV file called ABC.CSV
b. Display the contents of the file
c. Count number of records whose age is below 10 from the CSV file

3. Write a Program in Python that defines and calls the following user defined functions:
ADD() – To accept and add data of an employee to a CSV file ‘record.csv’. Each record
consists of a list with field elements as empid, name and mobile to store employee id, employee
name and employee salary respectively.
COUNTR() – To count the number of records present in the CSV file named ‘record.csv’.
DISP() – To display the contents of the file

4. Write a Program in Python that defines and calls the following user defined functions:
Add() – To accept and add data of an employee to a CSV file ‘furdata.csv’. Each record consists
of a list with field elements as fid, fname and fprice to store furniture id, furniture name and
furniture price respectively.
Search()- To display the records of the furniture whose price is more than 10000.
Disp() – To display the contents of the file

You might also like