Comp Sc.practical Revision List of Programs
Comp Sc.practical Revision List of Programs
Text Files
1. To write a Python Program to Read a text file "Story.txt" line by line and display each word separated by
'#'.
2. To write a Python Program to read a text file "Story.txt" and displays the number of digits, alphabets
and special characters in the file.
3. To write a Python Program to read a text file "Story.txt" and displays the number of Vowels/
Consonants/ Lowercase / Uppercase/characters in the file.
4. Read the lines from poem.txt and display those words which are less than 5 characters.
5. To write a Python Program to display the lines starting with the letter "a" in the file Sample.txt.
Binary File
1. To write a Python Program to Create a binary file student.dat with roll number and name. Search for a
given roll number and display the name, if not found display appropriate message.
2. To write a Python Program to Create a binary file student.dat with name and marks. Display names of
the students who scored above 75, if not found display appropriate message.
Stack
Write a program in Python to implement the following operation on Stack containing (employee code and
name) as a list. Write functions for
1. PUSH
2. POP
3. DISPLAY