Class 12 Pre 2024-25
Class 12 Pre 2024-25
Marks: 70
Instructions
Section – A
Q2.Which of the following Python function displays the memory id of a variable? [1]
(a) type()
(b) str()
(c) getid()
(d) id()
Q 3.Which of the following operator performs an integer division? [1]
(a) *
(b) //
(c) /
(d)**
a=5
b = a = 15
c = (a < 15)
print ("a = ”, a)
print (“b = ”, b)
print (“c = ”, c)
(a) a= 15
b=15
c=False
(b) a=15
b=10
c=True
(c) a=15
b=None
c=False
(d) None of these
Q 10.A primary key of a relation must be ………..
(a) UNIQUE only
(b) NOT NULL only
(c) Both UNIQUE and NOT NULL
(d) Neither UNIQUE nor NOT NULL
Q 11.Fill in the blank function will read entire contents of a text file.
(a) read()
(b) readfull()
(c) readline()
(d) readfile()
Q 12.The ………… clause can group records on the basis of common values in a field.
(a) AGGREGATE
(b) GROUP
(c) GROUP BY
(d) JOIN
Q 17.Assertion (A) A Python function that accepts parameters can be called without any parameters.
[1]
Reason (R) Functions can carry default values that are used, whenever values are not received from calling
function.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.
Q 18.Assertion (A) A CSV file is by default delimited by comma(,), but the delimiter character can be
changed. [1]
Reason (R) The writerowf) function for CSV files has a “delimiter” parameter that can be used to specify the
delimiter to be used for a CSV file.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.
Section – B
>>> l1 = [1, 2, 3, 4]
>>> l2 = [1, 2, 3, 4]
>>> l1 > l2
>>> l2 [2] = 9
>> l1 > l2
Q22.Mention the various advantages of using a DBMS. [2]
Or
P_Name VARCHAR(20)
DOJ Date
SAL NUMBER
(i) Display the name of the programmer, which has the highest salary.
(ii) Update the salary of all programmer by 2000, whose name start with letter R.
Q 23.
Define the update() method with its syntax in dictionary. [2]
Syntax dictionary_name1.update(dictionary_name2)
number = 2
def Fun ():
number = 5
print (“Number(s):”)
print (number)
Fun ()
print (number)
Or
Observe the following tuple and answer the questions that follow:
t1 = (70, 56, ‘Hello’, 22, 2, ‘Hi’, ‘The’, ‘World’, 3)
(i) t1 [2 : 4]
(ii) t1[- 6]
Q 25.The code given below will give an error on execution. Identify the type of the error and modify
the code to handle such type of an error.
Q26.Write outputs for the SQL commands (i) to (iii) based on the table CUSTOMER given below: [1 × 3 = 3]
TABLE: CUSTOMER
Or
Write a program in Python to open a text file “lines.txt” and display all those words whose length is greater
than 5.
Q28Write the queries for the questions (i) to (iii) on the basis of the following tables SHOPPE and
ACCESSORIES. [1 × 3 = 3]
TABLE: SHOPPE
TABLE: ACCESSORIES
(i) To display Name and Price of all the ACCESSORIES in ascending order of their Price.
(ii) To display Id and SName of all SHOPPE located in Nehru Place.
(iii) To display Minimum and Maximum Price of each Name of ACCESSORIES.
Q 29.Write a user-defined function parser(L) that accepts a list as parameter and creates another two lists
storing the numbers from the original list, that are even and numbers that are odd. [3]
Q 30.Consider the following stack of characters, where STACK is allocated N = 8 memory cells.
STACK : A, C, D, F, K, …, …, … [3]
Describe the STACK at the end of the following operations. Here, Pop and Push are algorithms for deleting
and adding an element to the stack.
(i) Pop (STACK, ITEM)
(ii) Pop (STACK, ITEM)
(iii) Push (STACK, L)
(iv) Push (STACK, P)
(v) Pop (STACK, ITEM)
(vi) Push (STACK, R)
(vii) Push (STACK, S)
(viii) Pop (STACK, ITEM)
Section – D
Section – E
Q 33.Trine Tech Corporation (TTC) is a professional consultancy company. The company is planning to set up
their new offices in India with its hub at Hyderabad. As a network adviser, you have to understand their
requirement and suggest them the best available solutions. Their queries are mentioned as (i) to (v) below.
[1 × 5 = 5]
Physical locations of the blocks of TTC
Conference Finance 80
Human Resource 25
Finance 120
Conference 90
(i) Which will be the most appropriate block, where TTC should plan to install their server?
(ii) Draw a block to block cable layout to connect all the buildings in the most appropriate manner for
efficient communication.
(iii) Suggest a suitable topology to connect the computers in each building.
(iv) Which of the following device will be suggested by you to connect each computer in each of the buildings?
(a) Switch/Hub
(b) Modem
(c) Gateway
(v) Company is planning to connect its offices in Hyderabad which is less than 1 km. Which type of network
will be formed?
Or
1, Nilesh, 65
2, Akshay, 75
showSelect() To display only roll number and marks of the students from the CSV file “student.csv”
Q 35.(i) If R1 is relation with 8 rows and 5 columns, then what will be the cardinality of R1?
If 5 rows are added more, what will be the degree of the table now? [1 + 4 = 5]
(ii) Below is a table Item in database Inventory.
Riya created this table but forget to add column ManufacturingDate. Can she add this column after creation of
table?
Note the following to establish the connection between Python and MySQL:
Host: localhost
Username : system
Password : test
Database : Inventory
Or
(i) Identify command/function for the following action.
To display only records of Trains from the Train table whose starting station is “NDLS”.
(Column for starting station is “start”, table name is ‘Train”)
(ii) Consider the following table structure
Table: Faculty
F_ID(P)
Fname
Lname
Hire_date
Salary
Write the Python code to create the above table.
Consider:
host: localhost
UserName : root
Password : system
Database : School
https://www.learncbse.in/cbse-sample-papers-for-class-12-computer-science-set-3/