0% found this document useful (0 votes)
514 views2 pages

Practical List 2025-26

The document outlines a list of practical programming exercises for Class XII Computer Science using Python. It includes tasks such as searching elements in lists, manipulating tuples, creating dictionaries, file handling, and SQL queries. Additionally, it covers operations related to CSV files and database connectivity with MySQL.

Uploaded by

anupamabhay05
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)
514 views2 pages

Practical List 2025-26

The document outlines a list of practical programming exercises for Class XII Computer Science using Python. It includes tasks such as searching elements in lists, manipulating tuples, creating dictionaries, file handling, and SQL queries. Additionally, it covers operations related to CSV files and database connectivity with MySQL.

Uploaded by

anupamabhay05
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/ 2

PRACTICAL FILE- COMPUTER SCIENCE (083)

LIST OF PRACTICALS (2025-26) CLASS-XII


Programming Language : Python
S.
NAME OF PRACTICAL
No.
1 Write a python program to search an element in a list and display the frequency of
elements present in the list and their location using Linear search by using a user defined
function. [List and search element should be entered by user]
2 Write a python program to pass a list to a function and double the odd values and half
even values of a list and display list elements after changing.
3 Write a Python program to input n numbers in tuple and pass it to function and count
even and odd numbers .
4 Write a Python program using function to create a dictionary with key and value (Name
and Percentage) , and update value at that key in the dictionary entered by the user.
Write a Python program to pass a string to a function and count how many vowels
5 present in the string.
6 Write a function in python which accept a number from user to return True, if the
number is a prime number else return False. Use this function to print all prime numbers
from 1 to 100.
7 Write a Menu driven program in python to count spaces, digits, words and lines from
text file TOY.txt
8 Write a program to count number of words starting with Tor t in a text file “sample.txt.
9 Write a program to generate random numbers between 1 to 6 and check whether a user
won a lottery or not.
10 Read a text file and display the number of vowels/ consonants/uppercase/ lowercase
characters in the file.
11 Read a text file line by line and display each word separated by #.
12 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.
13 Create a binary file with roll number, name and marks. Input a roll number and update
the marks.
A list containing records of products as
14 L = [("Laptop", 90000), ("Mobile", 30000), ("Pen", 50), ("Headphones", 1500)]
Write the following user-defined functions to perform operations on a stack named Product to:

I. Push_element() – To push an item containing the product name and price of products costing more than 50
into the stack.

Output: [('Laptop', 90000), ('Mobile', 30000), ('Headphones', 1500)]


II. Pop_element() – To pop the items from the stack and display them. Also, display "Stack Empty" when there
are no elements in the stack.
Output:
('Headphones', 1500)
('Mobile', 30000)
('Laptop', 90000)
Stack Emply
III. Display Stack Data in reverse order
15 Read a CSV file “ Item.csv” (containing item no, name, rate, Quantity) and print all the
items whose rate is between Rs 500 and Rs 1000.
In Practical File also show content of csv file tgh notepad to verify correct output.
Write a menu driven python program to create a CSV file by entering dept-id, name and
16 city. Read and search the record for given dept-id.
MENU
1. Create csv file
2. Search record as per dept no
3.Exit
17 Raj is the manager of a medical store. To keep track of sales records, he has created a CSV file named
Sales.csv, which stores the details of each sale.
The columns of the CSV file are: Product_ID, Product_Name, Quantity_Sold and Price_Per_Unit.
Help him to efficiently maintain the data by creating the following user-defined functions:
I. Accept() – to accept a sales record from the user and add it to the file Sales.csv.
II. CalculateTotalSales() – to calculate and return the total sales based on the Quantity_Sold and
Price_Per_Unit.

SQL Queries :
18 Create a student table with the student id, name, and marks as attributes where the
student id is the primary key.
19 Insert the details of a new student in the above table.
20 Delete the details of a student in the above table.
21 Use the select command to get the details of the students with marks more than 80.
22 Find the min, max, sum, and average of the marks in a student marks table.
23 Add a new Column stream in the student table whose datatype is varchar and size is 30.
24 Modify the size of stream column from 30 to 40.
25 Update the marks of all students by 10
26 Write a SQL query to order the (student ID, marks) table in descending order of the
marks.
27 Delete the student Table
28 Find the total number of customers from each country in the table (customer ID,
customer, Name, country) using group by.
29 Find the total number of customers from each country in the table (customer ID,
customer, Name, country) using group by where number of customers are more than 5.
30 Write a program to connect Python with MySQL using database connectivity and perform
the following operations on data in database: Fetch, Update and delete the data
31 MySQL database named WarehouseDB has a product table in MySQL which contains the following
attributes:
• Item_code: Item code (Integer)
• Product_name: Name of product (String)
• Quantity: Quantity of product (Integer)
• Cost: Cost of product (Integer)

Write a Python program to change the Quantity of the product to 91 whose Item_code is 208 in the product
table.

You might also like