QP CS XII Set1
QP CS XII Set1
Q
SECTION – A (21X1=21 MARKS) Marks
No.
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]
(i) Day={1:’monday’,2:’tuesday’,3:’wednesday’}
(ii) Day=(1;’monday’,2;’tuesday’,3;’wednesday’)
(iii) Day=[1:’monday’,2:’tuesday’,3:’wednesday’]
(iv) Day={1’monday’,2’tuesday’,3’wednesday’]
24 (i) Consider the List prices L=[23.811,237.81,238.91] then 2
(Answer using built in function only)
(A) Write a statement to sort the elements of list prices in ascending order
OR
(B) Write the statement to find the minimum or smallest element from list
(ii) Consider the List prices L=[“Jan”,”Feb”,”Mar”] then
Page 3 of 10
(Answer using built in function only)
(A) Add the element “Apr” at the last
OR
(B) Find the index of “Feb”
25 What possible output(s) are expected to be displayed on screen at the time 2
of execution of the program from the following code? Also specify the
maximum values that can be assigned to each of the variables FROM and
TO.
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=”# “)
def fibonacci()
first=0 second=1
print((“first no. is “, first)
print (“second no. is,second)
for a in range (1,9):
third=first+second
print(third)
first,second=second,third
fibonacci()
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 10
28 (A) Expand the following terms: 2
i. SMTP ii. TCP/IP
(B) Give one difference between XML and HTML?
OR
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:
Page 6 of 10
10 VIKAS 400 MATHS 57 II
OR
(B) Give the output of following sql statement based on the above table
1. Select MIN(AVERAGE) from GRADUATE where SUBJECT=”PHYSICS”;
2. Select SUM(STIPEND) from GRADUATE WHERE div=2;
3. Select AVG(STIPEND) from GRADUATE where AVERAGE>=65;
4. Select COUNT(distinct SUBJECT) from GRADUATE;
Page 7 of 10
24-12-199
103 Nitin Vyas 4 8000
104 Rakshit Soni 18-5-2001 14000
105 Rashmi Malhotra 11-9-2004 11000
106 Sulekha Srivastava 5-6-2006 10000
COURSES
C_I F_I
D D Cname Fees
C21 102 Grid Computing 40000
C22 106 System Design 16000
C23 104 Computer Security 8000
C24 106 Human Biology 15000
C25 102 Computer Network 20000
C26 105 Visual Basic 6000
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:
BUSINESS BLOCK 25
TECHNOLOGY BLOCK 40
LAW BLOCK 15
HR CENTRE 115
Page 9 of 10
OR
(B) What would be your recommendation for enabling live visual
communication between the Admin Office at the Mumbai campus and the
DELHI Head Office from the following options:
a) Video Conferencing b) Email c) Telephony d) Instant Messaging
Page 10 of 10