0% found this document useful (0 votes)
13 views9 pages

Transformation

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views9 pages

Transformation

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

CSV file

Q1)Write a Python program to repeatedly accept student details (roll


number, name, marks) from the user and store them in a CSV file using
the csv module.

Q2) Write a Python menu-driven program to create a CSV file, add


multiple student records, display all records, or exit based on user input.

Q3) Write a Python program to append employee records (Eno, Name,


Pay) to an existing CSV file using the csv module and user input inside a
loop.

Data File Handling

Q4)Write a Python program to read a text file and handle the


FileNotFoundError using exception handling.

Q5) Write a Python program to read the first 5 characters from a text file
and handle FileNotFoundError using exception handling.

Q6) Write a Python program to read the first line from a file using
readline() and handle FileNotFoundError.

Q7)Write a function addrecord() a add new record to the binary file


“student” using list. The list should consist of student number, student
name and marks of the student.

Q8) Write a function readall() the record from the binary file “student” and
display all the records

Q9) Write a function search () to search a record in a binary file according


to the student number entered by the user.
Output
Q10) Write a function update () to update the record in the binary file
“student”, which consist of student number, student name and marks. The
updation should be done on the basis of student number entered by the
user.'
Output

Q11) Write a function delrecord() to delete the record form the binary file
“student”. The record should be delete on the basis of student number.'
Output

Q12) Write a menu-driven Python program using binary file handling to


add, display, search, update, and delete student records.
Output

Q13) Write a Python program to create a user-defined MySQL database,


handle exceptions, and display all available databases.
Q14) Write a Python program to insert a record into a table using the
format() function for SQL query construction.

Q15) Write a Python program to search for a student record by name from
a MySQL table.

Q16) Write a Python program to search for a student record by roll number
from a MySQL table.
Q17)Write a Python program to delete a student record from a
MySQL table using roll number.

Q18) Write a Python program to update a student's name and


marks in a MySQL table using roll number.

Q19) Write a Python program to read data from a CSV file and insert all
records into a MySQL table named Stud.

Q20)

You might also like