100% found this document useful (1 vote)
519 views4 pages

12th - Main - Practical Exam Question Paper

This document contains two Python programming questions as part of a Senior School Certificate Examination for Computer Science. Question 1 involves writing a menu-driven Python program to implement stack operations such as push, pop, peek and display. Question 2 provides partial Python code to connect to a MySQL database called "customers" and perform database operations such as inserting a record. Students are asked to fill in the gaps to import modules, connect to the database, create a cursor, execute queries, and save records.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
519 views4 pages

12th - Main - Practical Exam Question Paper

This document contains two Python programming questions as part of a Senior School Certificate Examination for Computer Science. Question 1 involves writing a menu-driven Python program to implement stack operations such as push, pop, peek and display. Question 2 provides partial Python code to connect to a MySQL database called "customers" and perform database operations such as inserting a record. Students are asked to fill in the gaps to import modules, connect to the database, create a cursor, execute queries, and save records.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Senior School Certificate Examination – 2022 - 23

Practical Exam Question Paper


Subject : Computer science (083) Class : 12
Time : 3.00 Hours Max.Marks : 30

Set – 1
Part 1 Python Program 7
Q 1. Write a menu-driven program to implement stack operations.

1. Push
2. Pop
3. Peek
4. Display
5. Exit

Part II Python Database Connectivity


Q2. Observe the following code and fill in the given blanks as directed: 5

import ______________________ as mycon # Statement 1

mydb=mycon.connect(_____________________________________) # Statement 2

mycursor=mydb.___________ # Statement 3

mycursor.execute(_______________________________________) # Statement 4

mydb._____________ # Statement 5

print(mycursor.rowcount, "record inserted.")

The partial code is given for inserting a record in customer table created.
The customer table is given as following:

CustomerID CustomerName City BillAmt MobileNo

111 Abhishek Chennai 1500 9897989786


Senior School Certificate Examination – 2022 - 23
Practical Exam Question Paper
Subject : Computer science (083) Class : 12
Time : 3.00 Hours Max.Marks : 30

i. Write name of the module to fill statement 1 to be imported.


ii. Write the parameters and values required to fill statement 2. The
parameter values are as follows.

Database Server User Password Database

localhost root 0000 customers

iii. Write function name to create cursor and fill in the gap for
statement 3.

iv. Write a query to fill statement 4 with desired values.

v. Write function to fill statement 5 to save the records into table.

Practical file 7
Project file 8
Viva-voce 3

************
Senior School Certificate Examination – 2022 - 23
Practical Exam Question Paper
Subject : Computer science (083) Class : 12
Time : 3.00 Hours Max.Marks : 30

Set – 2
Part 1 Python Program 7
Q 1. Write a program to create a binary file to store rollno and name, search
any rollno and display name if rollno found otherwise “Rollno not found”.

Part II Python Database Connectivity


Q 2. Observe the following code and fill in the given blanks as directed: 5

import ______________________ as mycon # Statement 1

mydb=mycon.connect(_____________________________________) # Statement 2

mycursor=mydb.___________ # Statement 3

mycursor.execute(_______________________________________) # Statement 4

Myresult = mycursor.____________________ # Statement 5

for x in myresult:

print(x)

The partial code is given for displaying all the records from customer table
created. . The customer table is given as following:

CustomerID CustomerName City BillAmt MobileNo

111 Abhishek Chennai 1500 9897989786

222 Anburaj Mumbai 3400 8978675678


Senior School Certificate Examination – 2022 - 23
Practical Exam Question Paper
Subject : Computer science (083) Class : 12
Time : 3.00 Hours Max.Marks : 30

i. Write name of the module to fill statement 1 to be imported.


ii. Write the parameters and values required to fill statement 2. The
parameter values are as follows.

Database Server User Password Database

localhost root 0000 customers

iii. Write function name to create cursor and fill in the gap for
statement 3.

iv. Write a query to fill statement 4 to display all records from customer
table.

v. Write function to fill statement 5 to fetch all records from customer


table.

Practical file 7
Project file 8
Viva-voce 3

************

You might also like