0% found this document useful (0 votes)
8 views

Practical File

Uploaded by

shubham saini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Practical File

Uploaded by

shubham saini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

INDEX

S.No. CONTENT SIGN


1. Read a text file line by line and display
each word separated by a '#'.
2. Write a Python program with function to
count the number of lines in a text file ‘
'STORY.TXT’ which is starting with an
alphabet ‘A’ or 'a' .
3. Write a Python program with method/
function DISPLAYWORDS() to read lines
from a text file STORY.TXT, and display
those words, which are less than 4
characters.
4. Remove all the lines that contain the
character `a’ in a file and write it to
another file.
5. Read a text file and display the number of
vowels/ consonants/ uppercase/
lowercase characters in the file.
6. 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.
7. Create a binary file with roll number,
name and marks. Input a roll number and
update the marks.
S. No. CONTENT SIGN
8. Text Files Menu Driven Program:
Choice = 1. Read a text file line by line and
display each word separated by a '#'.
Choice = 2.Python program with function
to count the number of lines in a text file ‘
'STORY.TXT’ which is starting with an
alphabet ‘A’ or 'a'.
Choice= 3. Python program with method/
function DISPLAYWORDS() to read lines
from a text file STORY.TXT, and display
those words, which are less than 4
characters.
9. Text Files Menu Driven Program 2:
Choice= 1. Remove all the lines that
contain the character ‘a’ in a file and write
it to another file.
Choice= 2. Read a text file and display the
number of vowels/consonants/ uppercase/
lowercase characters in the file.
10. Write a python program to implement a
stack using a list data‐structure.
11. Write a Python program to implement a
queue using a list data‐structure.
12. Write a random number generator that
generates random numbers
between 1 and 6 (simulates a dice).
13. Take a sample of 10 phishing e‐mails and
find the most common
S. No. CONTENT SIGN
14. Write a program to input the value of x
and n and print the sum of the series:
x + x^2/2! ‐ x^3/3! + x^4/4! + .............
x^n/n!
15. Write a program for user defined import
modules.
16. Write a program for user defined import
Packages/Libraries.
17. fetchall(), fetchone(), fetchmany() and
rowcount( python interface through
MYSQL)
18. Insert, Update and Delete in a Student
Table(Python Interface through MYSQL)
Program
19. Find the min, max, sum, and average of
the marks in a student marks table(
python interface through MYSQL).
20. Find the total number of customers from
each country in the table (customer ID,
customer name, country) using group by(
python interface through MYSQL).

You might also like