0% found this document useful (0 votes)
29 views4 pages

12 Xii CS

This document contains the questions and instructions for a computer science exam with multiple choice and written answer questions. It is divided into 4 parts - Part A has 10 single mark multiple choice questions, Part B has 5 two mark questions, Part C has 5 three mark questions, and Part D has 3 five mark questions. The questions cover topics like Python functions, modules, strings, SQL queries, and other programming concepts.

Uploaded by

malathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views4 pages

12 Xii CS

This document contains the questions and instructions for a computer science exam with multiple choice and written answer questions. It is divided into 4 parts - Part A has 10 single mark multiple choice questions, Part B has 5 two mark questions, Part C has 5 three mark questions, and Part D has 3 five mark questions. The questions cover topics like Python functions, modules, strings, SQL queries, and other programming concepts.

Uploaded by

malathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

KMR INTERNATIONAL SCHOOL (CBSE)

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

16. Write the expected output for the following program 3


x = 'apple, pear, peach, grapefruit'
y = x. split(', ' )
for z in y :
if z < 'm' :
print(str.upper(z))
else :
print(str.lower(z))
17. What are the possible outcome(s) executed from the following code ? Also specify the 3
maximum and minimum values that can be assigned to variable N.
import random
SIDES=["EAST","WEST","NORTH","SOUTH"]
N=random.randint(1,3)
OUT=""
for I in range(N,1,–1):
OUT=OUT+SIDES[I]
print(OUT)
18. Write the expected output for the following program. 3
def fun(s):
k=len(s)
m=” “
for i in range(0,k):
if(s[i].isupper()):
m=m+s[i]. upper()
elif s[i].isalpha():
m=m+s[i]. lower()
else:
m=m +’bb’
print(m)
fun(‘KMRschool2@com’)
19. What is namespace? 3
20. Find the output of the code. #temp module 3
def test( x ):
print(x)
x=99

#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.

23. What will be the output of following code? 5


X = 50
def Alpha(num1):
global X
num1 += X
X += 20
num1 = Beta(num1)
return num1
def Beta(num1):
global X
num1 += X
X += 10
num1 = Gamma(num1)
return num1
def Gamma(num1):
X = 200
num1 += X
return num1
num = 100
num = Alpha(num)
print(num,X)

You might also like