Write a Python program that create a binary file with roll
10. number, name and marks. Input a roll number and update
the marks.
Write a program to add (PUSH), delete (POP) and display
11. the records using list through Stack.
Write a program to display unique vowels present in the
12. given word using stack.
Write a Python program that prints the first n rows of
13. Pascal's triangle.
Write a Python program that read a text file line by line
14. and display each word separated by a #.
Write a Python program that read a text file and display
15. the number of
(a) vowels
b) consonants
(c) uppercase
(d) lowercase characters in the file.
Write a Python program that create a binary file with
16. name and roll number. Search for a given roll number and
display the name, if not found display appropriate
message.
Write a menu-driven program to demonstrate four major
17. operations performed on a table through MYSQL-Python
connectivity.
Write a program to demonstrate all read operations using
18. MYSQL- Python connectivity.
Create a student table and insert data. Implement the
19. following SQL commands on the student table:
(a) ALTER table to add new attributes / modify data type /
drop attribute.
(b) UPDATE table to modify data.
(c) ORDER BY to display data in ascending / descending
order. (d) DELETE to remove record(s).
(e) GROUP BY and Having Clause.
(f) Find the min, max, sum, count and average.
Create a two tables and show commands for joining of
20.
two tables.
A.K. CHILDREN ACADEMY,
RAJ NAGAR Extension, GZB
Practical File on
Computer Science(083)
Session: 2024-2025
TOPICS COVERED:
Python My SQL
SUBMITTED TO: SUBMITTED BY:
Ms. Achla Agarwal Ummi Parthasarathi
PGT(COMP.SCI) Class: XI-A
Roll No.: 21692861
Index
S. No Topic T. Sign
Write a program that performs the following operations
1. on a string:
(a)Prompt the user to input a string.
(b) Extract all the digits from the string.
(c) If there are digits in the inputted string:
• Calculate and display the sum of the digits.
• Also display:
The original string
The digits
The sum of the digits
Write a program with a user-defined function with string
2. as a parameter which replaces all vowels in the string with
“*”
Write a python program to remove duplicates from a list.
3. A = [10, 20, 30, 20, 10, 50, 60, 40, 80, 50, 40]
Write a Python program that generates random
4. numbers between 1 and 6 (simulates a dice)
Write a program that defines a function which will print
5. Fibonacci series till n passed as argument to the function.
Write a Python program that defines a method to find and
6. display the prime numbers between 2 to N. Pass N as
argument to the method.
Remove all the lines that contain the character `a' in a file
7. and write it to another file.
Write a Python program to print just the last line of a text
8. file "data.txt" along with total lines in a text file.
Write a menu-driven program implementing userdefined
9. functions to perform different operations onto a
student.csv file having fields roll number, name, stream
and marks such as:
a) Write a single record to CSV.
b) Write all the records in one single go onto the CSV.
c) Display the contents of the CSV file.
Write a menu-driven program implementing user-defined functions
to perform different operations onto a student.csv file having fields
roll number, name, stream and marks such as:
(a) Write a single record to CSV.
(b) Write all the records in one single go onto the CSV.
(c) Display the contents of the CSV file.
Input:
Output:
Write a Python program that create a binary file with roll
number, name and marks. Input a roll number and update
the marks
Input:
Output:
Write a menu-driven program to demonstrate four major
operations performed on a table through MYSQL-Python
connectivity.
Input:
Write a program to demonstrate all read operations using
MYSQL- Python connectivity.
Input:
Create a student table and insert data. Implement the
following SQL commands on the student table:
(a) ALTER table to add new attributes / modify data type /
drop attribute.
(b) UPDATE table to modify data.
(c) ORDER BY to display data in ascending / descending
order.
(d)DELETE to remove record(s).
(e)GROUP BY and Having Clause.
(f)Find the min, max, sum, count and average.
Create a two tables and show commands for
joining of two tables.