QP CS XII Set1
QP CS XII Set1
Q
No SECTION – A (21X1=21 MARKS) Marks
.
1 State True or False : “ In Python tuple is mutable datatype” 1
2 What will the output of the following code 1
S = "text#next"
print(S.strip("t"))
(A) ext#nex (B) ex#nex
(C) text#nex (D) ext#next
3 What will be the output of the following statement : 1
print( 3 – 2 ** 2 ** 2 + 77 / 11 )
(A) 6 ( B) 6.0 (C) -6.0 (D) Error
4 Consider a list L = [‘H’, ‘U’, ‘L’, ‘K’]. Which of the following operations will 1
result in an error?
(A) L * 2 (B) L + [2]
(C) L * [2] (D) 2 * L
5 Consider the statements given below and then choose the correct output 1
from the given options :
Game="World Cup 2023"
print(Game[-6::-1])
(A) CdrW (B) ce o (C) puC dlroW (D) Error
6 Consider the tuple in python named sub=( “cs”, “phy”, “mat”). 1
Identify the invalid statement(s) from the given below statements:
(A) s=sub[1] (B) print(sub[2])
(C) sub[0]= “ip” (D) list=list(sub)
7 If my_dict is a dictionary as defined below, then which of the following 1
statements will raise an exception?
my_dict = {'apple': 10, 'banana': 20, 'orange': 30}
(A) my_dict.get('orange')
(B) print(my_dict['apple', 'banana'])
(C) my_dict['apple']=20
(D) print(str(my_dict))
Page 1 of 9
8 Which keyword is used for function in python? 1
(A) Fun (B) def (C) DEFINE (D) Function
9 Mr. Ravi is creating a field that contains alphanumeric values and fixed 1
lengths. Which MySQL data type should he choose for the same?
(A) VARCHAR (B) CHAR (C) LONG ( D) NUMBER
10 Which is the valid syntax to write an object onto a binary file opened in the 1
write mode?
(A) pickle.dump(<object to be written>, <file handle of open file>)
(B) pickle.dump(<file handle of open file>, <object to be written>)
(C) dump.pickle(<object>, <file handle>)
(D)None of the above
11 The output of the given expression is 1
>>>20 * (20 / 0)
(A) NameEr ror (B) TypeError
(C)OverflowError (D) ZeroDivisionError
12 What will be the output of the following code? 1
a = 15
def update(x):
global a
a += 2
if x%2==0:
a *= x
else:
a //= x
a=a+5
print(a, end="$")
update(5)
print(a)
(A) 20$11 (B) 15$4 (C) 20$4 (D) 22$4
13 The structure of the table/relation can be displayed using ______ command. 1
(A) view (B) describe (C) show (D) select
14 What will be the output of the query? 1
SELECT * FROM products WHERE product_name LIKE 'App%';
(A) Details of all products whose names start with 'App'
(B) Details of all products whose names end with 'App'
(C) Names of all products whose names start with 'App'
(D) Names of all products whose names end with 'App' .
15 Which of the following statements is FALSE about keys in a relational 1
database?
(A) Any candidate key is eligible to become a primary key.
(B) A primary key uniquely identifies the tuples in a relation.
(C) A candidate key that is not a primary key is a foreign key.
(D) A foreign key is an attribute whose value is derived from the primary
key of another relation.
16 Which aggregate function can be used to find the cardinality of a table? 1
(A)sum() (B)count() (C)avg() (D)max()
17 Which protocol is used to transfer files over the Internet? 1
(A) HTTP (B) Telnet (C) PPP (D)HTTPS
Page 2 of 9
Which network device is used to connect two networks that use different 1
18 protocols?
(A) Modem (B) Gateway (C) Switch (D) Repeater
When you connect two mobile phones using Bluetooth to transfer a picture 1
19 or file which type of network is formed
(A) LAN (B) WAN (C) PAN (D) MAN
Q20 and21 are ASSERTION AND REASONING based questions. Mark the correct
choice as
(A) Both A and R are true and R is the correct explanation for A 4
(B) Both A and R are true and R is not the correct explanation for A
(C) A is True but R is False
(D) A is False but R is True
20 Assertion(A): List is an immutable data type 1
Reasoning(R): When an attempt is made to update the value of an
immutable variable, the old variable is destroyed and a new variable is
created by the same name in memory.
21 Assertion (A): A SELECT command in SQL can have both WHERE and 1
HAVING clauses.
Reasoning (R): WHERE and HAVING clauses are used to check conditions,
therefore, these can be used interchangeably.
SECTION– B (7X2 =14 MARKS)
22 (A) Which of the following is valid arithmetic operator in Python: 2
(i) // (ii) ? (iii) < (iv) and
(B) Write the type of tokens from the following:
(i) if (ii) roll_no
import random
AR=[20,30,40,50,60,70];
FROM=random.randint(1,3)
TO=random.randint(2,4)
for K in range(FROM,TO+1):
print (AR[K],end=”# “)
27 (i) 2
(A) What is the key which depends on the primary value of another table?
OR
(B) What is the keyword to remove duplicate values from selecting the
record from the table?
(ii)
(A) There is a column hobby in a table contacts. The following two
statements are giving different outputs. What may be the possible reason?
SELECT COUNT (*) FROM CONTACTS;
SELECT COUNT(HOBBY) FROM CONTACTS;
OR
(C) Write an SQL command to make the column M_ID the Primary Key of an
already existing table, named MOBILE.
Page 4 of 9
Write one advantage and one disadvantage of each –
(i) STAR Topology
(ii) Tree Topology
(ii) Pop_element(): It pops the objects from the stack and displays them.
Also, the function should display “Stack Empty” when there are no elements
in the stack. For example:
If the nested list contains the following data:
COURSES
C_ID F_ID
Cname Fees
C21 102
Grid Computing 40000
C22 106
System Design 16000
C23 104
Computer Security 8000
C24 106
Human Biology 15000
Computer
C25 102 Network 20000
C26 105 Visual Basic 6000
Page 7 of 9
1.To display details of those Faculties whose salary is greater than 12000.
2. To display the details of courses whose fees is in the range
of 15000 to 50000 (both values included).
3. To increase the fees of all courses by 500 of “System Design” Course.
4. (A) To display details of those courses which are taught by ‘Sulekha’ in
descending order of courses?
OR
(B) Identify the Primary Key in FACULTY and COURSES table
35 Sumit wants to write a code in Python so help him by writing the code to 4
display all the details of the passengers from the table flight in MySQL
database, Travel. The table contains the following attributes:
Page 8 of 9
Law block to Technology Block 80m
Law Block to HR center 105m
Business Block to technology Block 30m
Business Block to HR Center 35m
Technology block to HR center 15m
Mumbai Head Office to Raipur 800 km
BUSINESS BLOCK 25
TECHNOLOGY BLOCK 40
LAW BLOCK 15
HR CENTRE 115
Page 9 of 9