The document lists 8 assignments involving writing Python programs with functions for manipulating text and binary files. The assignments involve adding, reading, updating, searching, counting, and deleting data from files.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
37 views
Assignment On Text and Binary Files
The document lists 8 assignments involving writing Python programs with functions for manipulating text and binary files. The assignments involve adding, reading, updating, searching, counting, and deleting data from files.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
LIST OF CS ASSIGNMENT
(text and binary files)
1)Write a function add(n) to add n lines in a text file jvm.dat. Also write a function display() which will count and display lines starting with a vowel. Invoke these functions.
2)Write a program in python having these functions:
Add() for adding lines in “jvm.dat” and words() for counting words with length >4 characters in each line. Invoke these functions.
3) Write a program in python having these functions:
Add() for adding lines , display() to read a text file line by line and display each word separated by #.
4) Write a program in python having these functions:
i)add():- for adding lines. ii)rem():- copy all lines that contain character “a” in a file to another file.
5) Write a program in python having these functions:
i)add():- for adding lines. ii)count():- read a text file and display number of vowels , upper case, lower case, digits and blank space in a file.
6) Write a program in python having these functions:
i)add():-for creating a binary file with name ,roll no and marks and store n records ii)update():- input a roll no and update the marks after updation,display whole file.
7) Write a program in python having these functions:
i)add():- for creating a binary file with name and roll no and store n records ii)search()-input a roll no and display the name,if not found display appropriate message.
8) ) Write a program in python having these functions:
i)add():- for adding n records in binary file. Structure[item number, item name, unit price, quantity] ii)display():- for displaying all records of binary file iii)search():- to print total values for those items whose quantity >100 and also to print quantity of such items. iv)update():- input item number and modify unit price and quantity. v)delete(): deleting those items where quantity is 0.