Practical File CS 2025
Practical File CS 2025
Practical File CS 2025
Set -2
6. WAP to read a text file “myfile.txt” line by line and display each word separated
by a #.
7. WAP to read a text file “myfile.txt” and display the number of vowels/
consonants/ uppercase/ lowercase characters in the file.
8. WAP that Removes all the lines that contain the character `a’ in a file and write it
to another file.
9. Write a program to create a text file and print the lines starting with ‘T’ or ‘P’. (Both
uppercase and lowercase).
10. Read a text file to print the frequency of the word ‘He’ and ‘She’ found in the file.
11. 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.
12. Create a binary file with roll number, name and marks. Input a roll number and
update the marks.
13. Read a CSV file from hard disc and print all the details on the screen.
14. Read a CSV file (containing item no, name, rate, QOH) from hard disc and print
all the items whose rate is between Rs 500 and Rs 1000.
15. Create a CSV file by entering user-id and password, read and search the
password for given userid.
16. WAP in Python to demonstrate linear search.
17. Write a Python program to implement a stack using a list data-structure.
18. WAP to pass an integer list as stack to a function and push only those elements
in the Stack which are divisible by 7.
Set – 3
19. Queries using Create database, Show databases, Use, Create table, Show
Tables, Describe, Rename, Alter, Select, From, Where, Insert, Update
commands.
20. Queries using DISTINCT, BETWEEN, IN, LIKE, IS NULL, ORDER BY, GROUP BY,
HAVING
21. Queries for Aggregate functions- SUM( ), AVG( ), MIN( ), MAX( ), COUNT( )
22. WAP to connect Python with MySQL using database connectivity and perform
the following operation on data in database: Create a table in database
23. WAP to connect Python with MySQL using database connectivity and perform
the following operation on data in database: Insert record in the table
24. WAP to connect Python with MySQL using database connectivity and perform
the following operation on data in database: Fetch records from the table using
fetchone( ), fetchall() and fetchmany( ).
25. WAP to connect Python with MySQL using database connectivity and perform
the following operation on data in database: Update record in the table and
Delete record from the table