12 Xii CS
12 Xii CS
MADURAI-625019
XII -UNIT TEST-Computer Science (083)
Maximum Marks: 50 Time : 2.15 hours
General Instructions:
1. Thisquestionpapercontainstwo partsA,B and C.Each partiscompulsory.
2. PartAhas10 question each one carry 1 mark.
3. Part Bhas5 question each one carry 2 mark.
4. PartChas5 question each one carry 3 mark.
5. PartChas3 question each one carry 5 mark.
PART-A
1. print(__name__) 1
(a) void (b) # (c) __name__ (d) __main__
2. def calc(x,y,z=5): 1
print(x+y+z)
for the above function definition which is not the legal function call statement in the given
below. (a) calc(7,3,0) (b) calc(y=7,x=5,9) (c) calc(x=5,z=10,y=7) (d) calc(6,9)
3. >>> n=25 1
>>> hex(n)
(a)’0x19’ (b) 0x32 (c) 0o24 (d) Error
4. x=10 1
def state( x ):
x=1000
print( x )
x=100
state( 7)
(a) 10 (b) 100 (c) 1000 (d) 7
5. State true or false. 1
If any changes in mutable types are reflected in caller function. if it’s name is not assigned a
different variable or data types.
6. ………….. is a repository of software for python programming language 1
(a) NUMpy (b) PyPI (c) module (d)SQL
7. >>>T = (“JAY”, “HARSH”, “SEEMA”, “HAMMA”) 1
>>> min(T)
(a) “JAY” (b) “HARSH” (c) “SEEMA” (d) “PRAKASH”
8. >>>import random 1
>>> print(random.randint()*(35-15)+15)
(a) 25 (b) 14 (c) 36 (d) Error
9. >>>import string 1
>>>”$$”.join(6,7,8)
(a) ‘$$6$$7$$8’ (b) $$6$$7$$8 (c) ‘$$6$$7$$8$$’ (d) Error
10. def check(a,b): 1
return
print(a*b)
print(check(7,1))
(a) 7 (b) 71 (c) None (d) 7 None
PART-B
11. What is library? 2
12. Write the output of the following code. 2
>>>import math,random
>>>print(math.floor(random.random()))
13. Name the python library modules which need to be imported to include the following 2
function i) sin() ii)randint()
14. Write a short note on any two aggregate function. 2
15. Write the output of the following code. 2
def inc( n):
n.extend([4,5,6])
return n
L=[1,2,3]
M=inc(L)
print(L,M)
PART-C
#program
From temp import *
X=10
Print(x)
PART-D
21. Explain about python built-in string function with suitable example. 5
22. Write the outputs of the SQL queries (i) to (iii) based on relations EMP and DESIG given 5
below:
Table: EMP
E_ID Name Gender Age DOJ Designation
1 Om Prakash M 35 10/11/2009 Manager
2 Jai Kishan M 25 12/05/2013 Accountant
3 Shreya Sharma F 30 05/02/2015 Clerk
4 Rakesh Minhas M 29 15/05/2007 Manager
5 Himani Singh F 45 19/09/2010 Clerk
Table: DESIG
Salary E_ID DEPT_ID
45000 1 D101
35000 2 D102
45000 4 D101
i) SELECT Designation, count(*) FROM EMP GROUP BY Designation;
ii) SELECT AVG(Age) FROM EMP;
iii) SELECT EMP.Name, EMP.Designation,DESIG.Salary FROM EMP, DESIG WHERE
EMP.E_ID = DESIG.E_ID AND EMP.Age>35;
(OR)
Explain about three types of formal arguments/parameters.