Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

PM SHRI K V Berhampore: MT-3 (July) CLASS 12 (COMPUTER SCIENCE) MM:40 TIME:90 Mins 2024-25

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

PM SHRI K V Berhampore

MT-3 (July) CLASS 12 (COMPUTER SCIENCE) MM:40 TIME:90 Mins 2024-25

Note: All questions are compulsory

1. True/False: (5) 5. Write the output of the following code. (1)


(a) A Function can call another function or
itself? D = {1:10, 2: 20, 3: 30, 1:40}

(b) Function can alter only mutable data print(D.keys())


types?
(c) Positional arguments must be written (a) dict_keys([1, 2, 3])
before keyword arguments. (b) [1, 2, 3]
(d) The values of default arguments must (c) (1, 2, 3)
be passed from the calling function. (d) None of these
(e) Variable length argument values assign 6. Write the output of the following code. (1)
as a tuple in the function definition.
2. Fill in the blanks: (5) S="Hello India"

(a) keyword is used to define a print(len(S))


function
(b) By default a function return ------------ (a) 5
(c) randint() is a function of------------ module. (b) 10
(d) mode() is a function of ------------- module. (c) 15
(e) A function must be defined ------- function (d) None of these
calling. 7. Which of the following is the correct
3. Write the output of the following code. function header? (1)
(1)
(a) def add(a, b=10, c):
L = [1, 5, 8, 6, 9] (b) def add(a=5, b= 10, c):

print(L[3]) (c) def add(a, b=10, c=15):


(d) def add(a=5, b, c=15):
(a) 8
8. What will be the output of the following
(b) 6 code? (3)
(c) 3
(d) None of these
4. Write the output of the following code. (1)
def check():
global num
T1 = (1, 2)
num=1000
T2 = (3, 4)
print(num)
print (T1+T2) num=100
(a) (1, 2, 3, 4) print(num)
(b) (4, 6) check()
(c) Error print(num)
(d) None of these
9. What will be the output of the following code?(4)
12. What will be the output of the following code? (4)

def drawline(char='$',time=5): def Alter(M,N=50):


print(char*time) M = M + N
drawline() N = M - N
drawline('@',10) print(M,"@",N)
drawline(65) return M
drawline(chr(65)) A=200
B=100
A = Alter(A,B)
10. What will be the output of the following code?( 4)
print(A,"#",B) B
def Fun1(mylist):
= Alter(B)
for i in
print(A,"@",B)
range(len(mylist)):
if mylist[i]%2==0:
mylist[i]/=2 13. What is the difference between actual and
else: formal parameter? Give example for each. (2)
mylist[i]*=2 14. What are the different types of
list1 = [21, 20, 6, 7, 9, 18, 100, 50, 13] function arguments? Explain each with

Fun1(list1) example. (3)


15. Differentiate between Mutable and
print(list1)
Immutable data types. (2)

11. What will be the output of the following code?( 3)

X = 100
def Change(P=10, Q=25):
global X
if P%6==0:
X+=100
else:
X+=50
Sum=P+Q+X
print(P,'#',Q,'$',Sum)
Change()
Change(18,50)
Change(30,100)

You might also like