Class 11 Bio CS 26122023
Class 11 Bio CS 26122023
Class 11 Bio CS 26122023
SECTION:A
Which of the following properly expresses the precedence of operators (using
parentheses) in
1 the following expression: 5*3 > 10 and 4+6==11 1
1.((5*3) > 10) and ((4+6) == 11) 2.(5*(3 > 10)) and (4 + (6 == 11))
3.((((5*3) > 10) and 4)+6) == 11 4.((5*3) > (10 and (4+6))) == 11
Based on the following code answer the questions (Follow Q,no2 to 6)
import ___________________ #1
AR=[20,30,40,50,60,70]
FROM=random.randint(1,3)
TO=random.randint(2,4)
2 1
for K in range(FROM,TO+1):
print (AR[K],end=”#“)
1. What module should be imported To execute the above code #1?
(i) math (ii) random (iii) pickle (iv) csv
What will Be the maximum value of the variables FROM and TO?
3 1
(i) 3,4 (ii) 4,3 (iii) 2,4 (iv) 4,2
What will Be the minimum value of the variables FROM and TO?
4 (i) 2, 1 (ii) 1, 2 (iii) 1, 3 (iv) 1, 4 1
19 2
a)What will be value of diff ? What output following program will produce
c1='A' v1='1'
20 c2='a' v2= 1
2
diff= ord(c1)-ord(c2) v3=v1==v2
print(diff)
22 b) identify one possible output of this code out of the following options: 2
from random import*
Low=randint(2,3)
High=randrange(5,7)
for N in range(Low,High):
print(N,end=' ')
(a) 3 4 5 (b) 2 3 (c) 4 5 (d) 3 4 5 6
SECTION:C
a)What will be the output after the following statements?
x = 27
y=9
while x < 30 and y < 15:
x=x+1
y=y+1
print(x,y)
b)Given the nested if-else below, what will be the value x when the source code executed
successfully:
x=0
26 a=5 3
b=5
if a>0:
if b<0:
x=x+5
elif a>5:
x=x+4
else:
x=x+3
else:
x=x+2
print (x)
What will be the output of the following code:
27 3
(a) What will be the output of the above code?
(b) How many times the loop executed?
(b) Ms. Ragini is confused on the way to compare the strings. Help her in choosing the
correctstatement.
(i) equal() (ii) equals() (iii) == (iv) compare()
28 3
(c) Tejas is confused in the output of the following code. Help him to choose the correct option.
age = 12
txt = "My name is Tejas, I am " , age
print(txt)
(i) ('My name is Tejas, I am ', 12) (ii) My name is Tejas, and I am 12
(iii) (My name is Tejas, I am , 12) (iv) [My name is Tejas, I am , 12]
1. Help mini to choose the correct output of the following Python code.
rollno = 3
name = "Mini"
Average = 88.76
Txt = "My name is {1}, having roll no {0} and scored {2} percent."
print(Txt.format(rollno, name, Average))
(i) My name is ‘Mini’, having roll no 3 and scored 88.76 percent.
(ii) My name is Mini, having roll no 3 and scored 88.76 percent.
(iii) ‘My name is Mini, having roll no 3 and scored 88.76 percent.’
29 (iv) (My name is Mini, having roll no 3 and scored 88.76 percent.) 3
2. Help Gurnika to choose the correct option for the following Python code.
b = "Hello, World!"
print(b[-5:2])
(i) Hello, World! (ii) orl (iii) Error (iv) No Output
3. What error occurs when you execute the following Python code snippet?
apple = mango
a) SyntaxError b) NameError c) ValueError d) TypeError
30 3
34 4