Professional Documents
Culture Documents
CBSE BOARD PRACTICAL PROGRAMS SETWISE New Patternpage Setting
CBSE BOARD PRACTICAL PROGRAMS SETWISE New Patternpage Setting
Q1: Write a Menu Driven Python Program to create a Binary File CLASSXII.DAT to enter records of students of your
class. Display all the records of the file . Also search & display the details of students having Science stream. Students
details should contain Admission No, Name, Phone number & stream. 8
Menu should be
1. Create
2. Search
3. Display
4. Exit
import mysql.connector as m
mydb = m.connect(user="root",passwd="root",host="localhost")
mycur=mydb.cursor()
mycur.execute("create database school1")
mycur.execute("________ statement 1”)
mycur.execute("________statement 2")
nm=input("Enter the name")
mycur.execute("________statement 3 ")
myrec=mycur.fetchall()
print(myrec)
mycur.execute("__________Statement 4")
mycur.execute("Desc per_inf")
for i in mycur:
print(i)
SET-2
Q1: Write a Menu Driven Python Program to perform all operation on STACK of employees of DAV Ashok Vihar. Each
element of stack should contain Employee name & his salary. 7
Menu should be
1. Push
2. Pop
3. Display
4. Exit
1. Create
2. Search
3. Display
4. Exit
import mysql.connector as m
mydb = m.connect(user="root",passwd="root",host="localhost")
mycur=mydb.cursor()
mycur.execute("create database school1")
mycur.execute("________ statement 1”)
mycur.execute("________statement 2")
nm=input("Enter the name")
mycur.execute("________statement 3 ")
myrec=mycur.fetchall()
print(myrec)
mycur.execute("__________Statement 4")
mycur.execute("Desc per_inf")
for i in mycur:
print(i)
SET-4
Q1: Write a Menu Driven Python Program to perform different operations on STACK. Stack should contain details of
Books like Book No., Book name, Author name & No. of copies. 7
Menu should be
1. Push
2. Pop
3. Display
4. Exit
import mysql.connector as m
mydb = m.connect(user="root",passwd="root",host="localhost")
mycur=mydb.cursor()
mycur.execute("create database school1")
mycur.execute("________ statement 1”)
mycur.execute("________statement 2")
nm=input("Enter the name")
mycur.execute("________statement 3 ")
myrec=mycur.fetchall()
print(myrec)
mycur.execute("__________Statement 4")
mycur.execute("Desc per_inf")
for i in mycur:
print(i)