Class 12 List of Practicals 2022 11 27
Class 12 List of Practicals 2022 11 27
Ser
Topic Sub Topic Practical
No
Write a Python program to Read two lists. Create a functionMergeList (ListA, ListB) that
Create Function
1. Functions
+ List operation merges two lists such that taking one element from each list one by one and appending
the rest of the items of the list when one list is finished.
Create Function Write a Python function to create and print a list where the values are square of numbers
2. Functions + List Ops + between two numbers (both included). Read two numbers from user and execute the
Maths Function function and print result on screen.
Create Function Write a python program which reads Principal, Rate, Time and uses a function Interest
with Default
which returns Simple interest and compound interest for the same value of PRT. The
3. Functions parameter,
Returning function should have a default value for Rate = 3.5 and Time = 2 years, Compound
Multiple Values interest is calculated yearly.
Local, global Write a python program to demonstrate use of global keyword.
4. Functions
parameters
Read Text, String Write a python program to read text from user and save it in a text file. Read the text file
Handling
5. Text File: and display the number of vowels/ consonants/ uppercase/ lowercase characters in the
(islower, isupper,
membership test) file
Readline, Write a python program read a text file line by line and display each word separated by a
6. Text File: String Method
‘#’.
(split, join)
Readlines, string Write a python program to remove all the lines that contain the character ‘a’ in a file and
7. Text File: Method ( find/
write it to another file.
membership )
Two File Write a Python program to combine each line from first file with the corresponding line in
operation,
second file and append part left from larger file.
8. Text File: List Operation,
Writing into Text
file
Create a CSV Write a python program to create a CSV file that contains record of Name, Admission_No,
9. CSV File file, display date_of_birth and Adhar_Card. Add atleast 5 records in the file. Display the Contents of
contents the file.
You have been given a CSV file that contains the Schedule of Rajdhani train. Write a
Read a CSV File, python program to Find out if the Train stops at a particular station and calculate the
Search, apply
10. CSV File
calculation and stoppage time.
print Format of CSV File is :
SerNo, Station_Name, SchTime_Arriva, SchTime_Dept, Distance
Read a CSV File, A CSV file contains record of Name, Admission_No, date_of_birth and Adhar_Card.
Search, Update
11. CSV File Update the name whose Admission_No = 5 to new name = “Venkat Rama Swami” in the
data and Display
Contents. file. Display the Contents of the file.
Create Binary Create a binary file which stores record of students roll number, name and marks. Read
File, Create
12. Binary File roll number, Name & Marks and store it using Dictionary.
Dictionary, add
contents ,
Read a Binary There is a binary file with name and roll number. Search for a given roll number and
File, Search data
display the name, if not found display appropriate message. Use dictionary for storing
13. Binary File store in a
dictionary object records
and Print it.
Read a Binary There is a binary file with name and roll number of students of your class. The data has
File, Search data
been stored for each student as individual dictionary. Update the name whose Roll
store in a
14. Binary File
dictionary object, Number = 5 to new name = “Venkat Rama Swami” in the file. Display the Contents of the
update it and binary file.
Print it.
Implement all the Write a Python program to implement a stack using a list data-structure. It should have
15. Stack
functions of stack push, pop, isempty functions.
Write a function in Python PUSH_IN (myList), where myList is a list of numbers. From this
Segregate data
list, push all even numbers into a stack which is implemented by using another list named
16. Stack from a list and
Store it in a stack EvenStack. Show the output by taking a sample data of 10 random integers. Implement
this functionality using stack data structure.
Sahil has created a dictionary containing Product names and prices as key value pairs of
4 products. Write a program to implement the following and who its output:
ProductPush() which takes a list as stack and the above dictionary as the
Create a parameters.
Function, Push the keys (Pname of the product) of the dictionary into a stack, where the
Segregate data
17. Stack
from a Dictionary corresponding price of the products is less than 6000.
and Store it in a Example of data: -
stack Product= { "TV" : 10000,
"MOBILE" : 4500,
"PC" : 12500,
"FURNITURE" : 5500 }
Make a python program with function a NumberPush() which takes a list as stack and the
tuple of numbers as the parameters. Push the numbers of the tuple which are divisible by
Create a 5 into a stack. Show the full output
Function,
18. Stack Segregate data
from a tuple and Sample Data:
Store it in a stack M = (2, 10,13,17,25,32,38,44, 56, 60,21, 74, 35,15)
Sample Output
[10, 25, 60, 35, 15]
Networking
Network Study how your school is connected with internet and internal LAN structure. Draw the
Topology, Type
layout of school’s LAN, mark the location where routers, wifi-access point, switches and
of Media,
1. Networking Network Device hubs are connected and Type of media used for connection.
Identification,
Internet Service
Connection
Study how your school is connected with internet. You school canteen is not connected
Internet Service
with internet or Lan. It is proposed to provide wifi internet connection for Teacher. Draw a
2. Networking Connection
Extension layout and plan how can you extend internet service there from existing school internet
infrastructure.
Basic Network Run the following command in your PC and observer the output:
3. Networking Trouble Shooting Ping, ARP -a, IPCONFIG, nslookup, route print
Commands
Table: student
Admission_No First_Name Last_Name DOB
012355 Rahul Singh 2005-05-16
012358 Mukesh Kumar 2004-09-15
012360 Pawan Verma 2004-03-03
DML Queries
4. RDBMS based on single
Table (a) Identify the attribute best suitable to be declared as Primary Key. Add a primary
key to the table.
(b) Insert the following data in table student: Admission_No = 012368,
First_Name = Kamlesh, Last_Name = Sharma, DOB=01 Jan 2004.
(c) Delete all the rows which are having letter M in their name.
(d) Show the details of the persons who are having their birthday today.
(e) Display the all details in the order of First name, LastName sorted in descending
order.
Consider the following tables Sender and Recipient. Write SQL commands for the
statements (i) to (iv)
Table: Sender
SenderID SenderName SenderAddress Sendercity
ND01 R Jain 2, ABC Appls New Delhi
MU02 H Sinha 12 Newtown Mumbai
MU15 S Jha 27/A, Park Street Mumbai
ND50 T Prasad 122-K,SDA New Delhi
Table: Recipients
RecID SenderID RecName RecAddress recCity
DML Queries KO05 ND01 R Bajpayee 5, Central Avenue Kolkata
5. RDBMS based on two ND08 MU02 S Mahajan 116, A-Vihar New
Table Delhi
MU19 ND01 H Singh 2A, Andheri East Mumbai
MU32 MU15 P K Swamy B5, C S Terminals Mumbai
ND48 ND50 S Tripathi 13, BI, Mayur Vihar New
delhi
Consider the following tables Worker and PayLevel and answer (a) and (b) parts of this
question:
E_Code Name Design P_Level DOJ DOB
11 Radhe Shyam Supervisor P001 13-Sep-22 23-Aug-1980
12 Shyam Das Operator P002 02-Jul-20 14-Mar-1986
13 Anant Singh Operator P002 31-Aug-19 21-Feb-1985
14 Albert Sam Mechanic P003 29-Jun-21 26-Oct-1982
15 Sanya Mechanic P003 22-Apr-20 03-Dec-1981
18 Tanya Operator P002 12-May-22 11-Nov-1989
DML Queries
P_Level Basic_Pay Allowance
6. RDBMS based on two P001 35000 10000
Table P002 30000 8000
P003 25000 7000
Write a Python code to Create Database, Table and add student using MySQL
connectivity and show result. The structure of table is:
Database Name DB_KVSchool
Python SQL UserId StudentLogin
1. Python - Connectivity –
Password aS23Jk
MySQL Database
creation Name of Table Tbl_Student ( RollNo, Name, Age, Class, City)
Constraints : Primary Key RollNo
Constraints : Not Null Roll No, Name, Age Can’t be Null
Write a Python code to search student whose age is between 12 and 14 and belongs to
City Basohli in database using MySQL connectivity and show result.:
Host Localhost
Database Name DB_KVSchool
UserId StudentLogin
Password aS23Jk
Table : tbl_Student
Python SQL Roll_No Student_Name Age Class City
Python - Connectivity –
1 A Kumar 12 7 Kathua
2.
MySQL DML Query,
Show result 2 B Tiwari 13 7 Lakhanpur
3 C Pandey 14 8 Kathua
4 D Jasrotia 11 7 Kathua
5 E Yadav 12 8 Lakhanpur
6 F Tiwari 13 7 Dhanore
7 G Sharma 14 8 Basohli
8 H Gupta 12 7 Basholi
Write a Python code to delete details of student as per given roll number in database
using MySQL connectivity and show result.
Host Localhost
Database Name DB_KVSchool
UserId StudentLogin
Password aS23Jk
Table : tbl_Student
Python SQL
3. Python - Connectivity – RollNo Name Age Class City
MySQL DML Query, 1 A Kumar 12 7 Kathua
Show result
2 B Tiwari 13 7 Lakhanpur
3 C Pandey 14 8 Kathua
4 D Jasrotia 11 7 Kathua
5 E Yadav 12 8 Lakhanpur
6 F Tiwari 13 7 Dhanore
7 G Sharma 14 8 Basohli
8 H Gupta 12 7 Basholi
Write a Python code to update the age of all students of the class by 1 Year in database
using MySQL connectivity and show result.
Host Localhost
Database Name DB_KVSchool
UserId StudentLogin
Password aS23Jk
Table : tbl_Student
Python SQL RollNo Name Age Class City
Python - Connectivity –
4. 1 A Kumar 12 7 Kathua
MySQL DML Query,
Show result 2 B Tiwari 13 7 Lakhanpur
3 C Pandey 14 8 Kathua
4 D Jasrotia 11 7 Kathua
5 E Yadav 12 8 Lakhanpur
6 F Tiwari 13 7 Dhanore
7 G Sharma 14 8 Basohli
8 H Gupta 12 7 Basholi
You have been provided with the table with following details.
Host Localhost
Database Name DB_KVSchool
UserId StudentLogin
Password aS23Jk
Table : tbl_Student
1 A Kumar 12 7 Kathua
Python SQL 2 B Tiwari 13 7 Lakhanpur
Python - Connectivity – 3 C Pandey 14 8 Kathua
5.
MySQL DML Query,
4 D Jasrotia 11 7 Kathua
Show result
5 E Yadav 12 8 Lakhanpur
6 F Tiwari 13 7 Dhanore
7 G Sharma 14 8 Basohli
8 H Gupta 12 7 Basholi
Write a Python code to insert a new record (studying in class 8, Roll No = 9, Age is 14,
Name of the student is J Kumar, residing in City Dhanore) in above mentioned table
database using MySQL connectivity and show result. The sequence of the fields to be
inserted in the SQL query should be in the sequence Class, Age, Name, City.