0% found this document useful (0 votes)
6 views3 pages

Board Practical (Python) - 2025

The document outlines a series of programming tasks in Python, focusing on user-defined functions for various operations such as stack manipulation, file handling (CSV and binary), and database interactions using MySQL. Key functionalities include adding, removing, searching, and updating records for books, employees, and students, as well as performing calculations and data manipulations on lists. Additionally, it emphasizes creating and managing SQL tables and performing queries based on specified criteria.

Uploaded by

debansu0009
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)
6 views3 pages

Board Practical (Python) - 2025

The document outlines a series of programming tasks in Python, focusing on user-defined functions for various operations such as stack manipulation, file handling (CSV and binary), and database interactions using MySQL. Key functionalities include adding, removing, searching, and updating records for books, employees, and students, as well as performing calculations and data manipulations on lists. Additionally, it emphasizes creating and managing SQL tables and performing queries based on specified criteria.

Uploaded by

debansu0009
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

1.

Write a program with two user defined functions considering them to act as PUSH and POP
operations of the data structure stack.

I. Addnew(Book) - To add a new book to a list of Books


II. Remove(Book) – To remove a book from a list of Books.

2. Write a program with separate user defined functions to perform the following operations on a
list containing 10 integers.
i. A user defined function to traverse the content of the list and push the even
numbers into a stack.
ii. Pop and display the content of the stack.

3. Write a Program in Python that defines and calls the following user defined functions:
i. add() – To accept and add data of a furniture to a CSV file ‘[Link]’. Each record
consists of a list with field elements as fid, fname and fprice to store furniture id,
furniture name and furniture price respectively.
ii. search()- To display the records of the furniture whose price is more than 10000

4. Write a Program in Python that defines and calls the following user defined functions:
a. ADD() – To accept and add data of an employee to a CSV file ‘[Link]’. Each record
consists of a list with field elements as empid, name and sal to store employee id,
employee name and employee salary respectively.
b. COUNTR() – To count the number of records present in the CSV file named
‘[Link]’.

5. Write the following user defined functions to perform given operations on the stack named
status:
a. Push_element() - To Push an object containing name and Phone number of customers
who live in Goa to the stack
b. Pop_element() - To Pop the objects from the stack and display them. Also, display
“Stack Empty” when there are no elements in the stack.
Consider the information are stored as in the form of a list as [ name, phone,place]

6. Write a menu driven program to perform following operations into a binary file [Link].
Information as p={‘pid’:_____,‘pname’:____, ‘price’:____}
a) Add record
b) Display records
c) Search record
d) Exit
The structure of file content is: [p_id, name, brand, price]

7. Write a program to create CSV file and store empno, name and salary of employee. Display
the records whose salary in range of 5000 to 15000.
8. Write a menu-driven program in python to implement following on binary file of the given
structure: [Emp_Id, Emp_Name, Desig, Salary]
I. Write a record to the file
II. Read all the records from the file
III. Update Record
IV. Exit

9. Write a menu drive program to perform following operations into [Link].


i. Add record
ii. Display records
iii. Search record
iv. Exit
The structure of file content is: [t_id, name, brand, price]

10. Write functions in python for the following:


a. To create a text file “[Link]” and write 10 lines to it.
b. To print the count of number of lines that starts with “A” or “a” and word count in each
line is above 6 from “[Link]”.

11. Write functions in python for the following:


a. To create a text file “[Link]” and write 10 lines to it.
b. To print the count of number of independent word “step” and word that does not starts
with a lower case vowels from “[Link]”.
12. Write functions in python for the following:
a. To create a text file “[Link]” and write 10 lines to it.
b. To print the count of number of upper case vowels, upper case alphabet and digits from
the text file “[Link]”.

13. Write a program using a function to read from a binary file “[Link]” and update the
salary by 10% for the employee working in “Accounts” department. (The same program will
create the binary file and store records enumber,name,salary,department)

14. Write a function update() to update the record in the binary file “[Link]”, which consists of
student id, student name and marks represented using a dictionary. The updation should be
done in the marks of the student on the basis of student id entered by the user. The program
will also print “record does not exist”, if no such record is found in the file.

15. Write a function in python to reverse each half of the list containing integers and reverse the
entire same list.[Don’t use any list based method]

16. Write a function to store the sum of each alternate elements of a list in a new list as its
element and print it.
17. Write a python program with a function that accept the title of a book as parameter and find
out whether the record is present in the table library or not.

 Create the table library having the attribute names ( bid- integer type, title – string,
author- string, price – float)
Consider the following for connection of python with mysql:
host- local host, user – root, password – mps123, database name - mothers

18. Write a function update to accept the employee number as parameter and update the record
in employee table.
 Create the table employee having the attribute names( eno – integer, name- string,
desig-string, sal – float)

Consider the following for connection of python with mysql:

host- local host, user – root, password – mps123, database name - mothers

19. Write a python program with a function that connects to the database and delete the record of
a student whose roll number will be entered by the user.
 Create the table student having the attribute names( roll – integer, name- string, sec-
string, avg – float)
Consider the following for connection of python with mysql:

host- local host, user – root, password – mps123, database name - mothers

20. Create a sql table using python and accept the information of 10 persons and display them by
arranging the records in descending order as per their age those having more than 40 years of
age.

 Create the table person having the attribute names( aadhar – integer, name- string, add
-string, age - integer)
Consider the following for connection of python with mysql:

host- local host, user – root, password – mps123, database name - mothers

You might also like