0% found this document useful (0 votes)
38 views3 pages

12 Practical Programs

Uploaded by

ayyydiii21
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)
38 views3 pages

12 Practical Programs

Uploaded by

ayyydiii21
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/ 3

Practical Programs

1 Python program – Fibonacci series


2 Python program – Mathematical functions
3 Menu driven program using user defined functions to perform arithmetic
operations
4 Menu driven program using user defined functions to find factorial and sum of list
of numbers
Text File Programs
5 To write a program to read a text file PARA.txt line by line and display
each word separated by a #.
6 Write a Python Program to Read a File STORY.TXT and Capitalize the
First Letter of Every Word in the File and write it in Cap.txt
7 Read a text file book.txt and display the number of digits/ vowels/
consonants/special char/uppercase/lowercase characters in the
file.
8 Read a file story.txt , Remove all the lines that starts with letter 'a'
and write it to another file.
9 Write a Python Program that Reads a Text File “para.txt” and Counts
the Number of Times word “the” Appears in the Text File.
Binary File
10 Create a binary file with name and roll number. Search for a given roll number
and display the name, if not found display appropriate message
11 Create a binary file with roll number, name and marks. Input a roll number and
update the marks.
12 Create a binary file with book details using dictionary with the following keys
bno, bname, author, publisher, price. search and display those books whose
price are greater than 700
13

14 write a python code to create a binary file “book.dat” that has structure [BookNo,
Book_Name, Author, Price]. The following user defined function
CreateFile() is created to take input data for a record and add to book.dat and
another user defined function CountRec(Author) which accepts the Author name as
parameter and count and return number of books by the given Author.
RemoveRec() is created to delete the file matching with the author name passes as
argument.
UpdateRec() is ysed to modify the price for specific book.
Create a menu driven program for the same.
CSV File
15 Create a CSV file by entering user-id and password, read and search the
password for given userid.
16 Create a csv file for employee details with the following fields [eno,ename,
doj,desgn,basic,da,hra ] append and calculate the gross pay
17 Create csv file for employee details with the following fields [eno,ename,
doj,desgn,basic,da,hra ] search and update a record.
18 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.
(ii) COUNTR() – To count the number of records present in the CSV file named
‘record.csv’.

Data Structure
19 Stack – Menu driven program using List
20 Write a function in Python, Push(SItem) where, SItem is a dictionary containing
the details of stationary items– {Sname:price}. The function should push the
names of those items in the stack who have price greater than 25. Also display the
count of elements pushed into the stack.

You might also like