STD – XII SCI.
SUBJECT: COMPUTER SCIENCE
PRACTICAL PROGRAMS - II
No. Python Programs
1 Write a program to read a text file line by line and display each word
separated by ‘#’.
Write a program to read a text file and display the number of vowels /
2
consonants/uppercase/lowercase characters in the file.
3 Write a program to remove all the lines that contain the character a’ in a file
and write it to another file.
4 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.
5 Create a binary file with roll number, name and marks. Input a roll number
and update the marks.
Write a Python program to create a CSV file to store Empno, Name, Salary
6 and search any Empno and display Name, Salary and if not found display
appropriate message.
7 Write a menu-driven python program to implement stack operation using
list.
8 Write a program to implement a stack for these book-details (bookno, book
name). Just implement Push and Display operations
1. Write a program to read a text file line by line and display each word separated
by ‘#’.
2. Write a program to read a text file and display the number of vowels / consonants /
uppercase/lowercase characters in the file .
3. Write a program to remove all the lines that contain the character a’ in a file and
write it to another file.
OUTPUT:
4. 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.
OUTPUT:
5. Create a binary file with roll number, name and marks. Input a roll number and
update the marks.
OUTPUT:
6. Write a Python program to create a CSV file to store Empno, Name, Salary and
search any Empno and display Name, Salary and if not found display appropriate
message.
OUTPUT:
7. Write a menu-driven python program to implement stack operation using list.
8. Write a program to implement a stack for these book-details (bookno, book name). Just
implement Push and Display operations