C.S Practical File
C.S Practical File
Science,
Practical file
Python and
MySQL
2024-25
Student Details
Name: PANAV BORA
Class: XII Science(PCM)
Roll Number: 1212
School : KV O.N.G.C JORHAT, ASSAM
Submitted to : Mrs Hema Sharma
ACKNOWLEDGEMENT
This is to certify that, student
named Panav Bora of class XII
has successfully completed the
Computer Science p Under the
guidance of Mrs. Hema Sharma
________
Signature
Mrs. Hema Sharma
1 To display first 10 characters of second line TEXT FILE
from the file data.txt func name is first10()
2 to count the number of 5-letter words in a TEXT FILE
text file named data.txt
3 to reverse the content of a text file TEXT FILE
21
20 to calculate the average value per customer MY SQL
FILE:
OUTPUT:
CODE-2
#WAP to count the number of 5-
letter words in a text file named
data.txt:
OUTPUT:
CODE-3
#WAP to count the number of
vowels and consonants in a text
file along with their percentage:
OUTPUT:
CODE-4
#WAP to reverse the content of a
text file:
OUTPUT:
CODE-5
#WAP to change a specific word an
all its occurrences in a text
file:
OUTPUT:
CODE-6
#WAP To Add sports info and check
for gold medal in a csv file:
OUTPUT:
CODE-7
#WAP to append data and display data
of student with more than 85% in a
csv file
OUTPUT:
CODE-8
#WAP to filter out the people
with the age above 30:
OUTPUT:
CODE-9
#WAP to sort the records in a csv
file by age in ascending order:
OUTPUT:
CODE-10
#WAP to calculate the total sales
for each product, and write the
updated data to a new CSV file.
OUTPUT:
CODE-11
#WAP To write name, age, roll
number into a binary file :
OUTPUT:
CODE-12
#WAP to read data from a binary
file:
OUTPUT:
CODE-13
#WAP to append data into a binary
file:
OUTPUT:
CODE-14
#WAP to store a list of
dictionaries in a binary file:
OUTPUT:
CODE-15
#WAP to read a list of
dictionaries In a binary file:
OUTPUT:
CODE-16
#Write a query to:
Display the total number of students, highest
marks obtained in each class and combine the
results into a single query
QUERY-OUTPUT:
CODE-19
#WAQ to display customers who
have spent more than 400:
QUERY-OUTPUT:
CODE-20
#WAQ to calculate the average
value per customer:
QUERY-OUTPUT:
CODE-21
#Write 4 functions named- push,
pop, is_empty and display for a
stack in python
OUTPUT:
CODE-22
#Write a function to convert
decimal number to binary using
stack in python:
OUTPUT:
CODE-23
#WAP to connect to MYSQL and
create a table in python:
OUTPUT:
At SQL:
CODE-24
#WAP to insert data into a
database from python using
python-MYSQL connectivity:
OUTPUT:
At SQL:
CODE-25
#WAP to update the grade to
Graduated for the student John
Doe using python-SQL
connectivity:
OUTPUT:
At SQL:
CODE-26
#WAP to delete a record from SQL
database using python-SQL
connectivity:
OUTPUT:
At SQL:
CODE-27
#WAP to add a
column(phone_number) into the
database using python-SQL
connectivity:
OUTPUT:
At SQL:
CODE-28
#WAP to count the number of
records using SQL-python
connectivity:
OUTUPUT:
CODE-29
#WAP to fetch and display the
titles, genres, authors, and
their countries using SQL-python
connectivity:
OUTPUT:
CODE-30
#WAP to fetch records of
students with age more than or
equal to 17 using SQL-python
connectivity:
0
OUTPUT: