CS Practical 2023
CS Practical 2023
CLASS XII
SET A
Q1. Write a menu driven program in python to perform Push, Pop and Display operation for
stack using list of numbers. (4)
Q2.A table Student is created in the database School. The details of table are given below. (8)
CLASS XII
SET B
Q1. Write a function addemp() and delemp() and disemp() to add a new employee name, remove a employee name
and to display employee names from a list emp, according to Stack Data Structure in Python. (4)
Q2.Observe the following code and fill in the given blanks as directed: (8)
import mysql.connector as mycon
mydb=mycon.connect(_______________________________________) # Statement 1
mycursor=mydb.___________ # Statement 2
mycursor.execute(__________________________________________) # Statement 3
myresult = mycursor.__________ # Statement 4
for x in myresult:
print(x)
The partial code is given for displaying all records from customer table created . The customer table is given
as following:
CustomerID CustomerName City BillAmt MobileNo
111 Abhishek Ahmedabad 1500 9999999999
222 Ram kumar Chennai 1501 8888888888 i.
Write the parameters and values required to fill statement 1. The parametersvalues are as follows:
Database Server : localhost
User : root
Pasword : rootpass
Database : customer
ii. Write function name to create cursor and fill in the gap for statement 2.
iii. Write a query to fill statement 3 to display all records from customer table.
iv. Write function to fill statement 4 to fetch all records from customer table.